From aed9157ed6b4419e6b534f440862d87ecc3d4e29 Mon Sep 17 00:00:00 2001 From: dingyongkang Date: Wed, 27 Aug 2025 15:13:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- static/js/async/{6219.eb2dbbc8.js => 6219.153c6aac.js} | 4 ++-- .../js/async/{6219.eb2dbbc8.js.map => 6219.153c6aac.js.map} | 2 +- static/js/async/{6785.f07343a6.js => 6785.a093596d.js} | 4 ++-- .../js/async/{6785.f07343a6.js.map => 6785.a093596d.js.map} | 2 +- static/js/index~0.85a00b75.js | 2 ++ .../js/{index~0.f81fa612.js.map => index~0.85a00b75.js.map} | 2 +- static/js/index~0.f81fa612.js | 2 -- static/js/index~1.380932fc.js | 2 -- static/js/index~1.380932fc.js.map | 1 - static/js/index~1.b482a05a.js | 2 ++ static/js/index~1.b482a05a.js.map | 1 + static/js/{index~2.6112b9af.js => index~2.046de999.js} | 4 ++-- .../js/{index~2.6112b9af.js.map => index~2.046de999.js.map} | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) rename static/js/async/{6219.eb2dbbc8.js => 6219.153c6aac.js} (99%) rename static/js/async/{6219.eb2dbbc8.js.map => 6219.153c6aac.js.map} (99%) rename static/js/async/{6785.f07343a6.js => 6785.a093596d.js} (99%) rename static/js/async/{6785.f07343a6.js.map => 6785.a093596d.js.map} (95%) create mode 100644 static/js/index~0.85a00b75.js rename static/js/{index~0.f81fa612.js.map => index~0.85a00b75.js.map} (52%) delete mode 100644 static/js/index~0.f81fa612.js delete mode 100644 static/js/index~1.380932fc.js delete mode 100644 static/js/index~1.380932fc.js.map create mode 100644 static/js/index~1.b482a05a.js create mode 100644 static/js/index~1.b482a05a.js.map rename static/js/{index~2.6112b9af.js => index~2.046de999.js} (99%) rename static/js/{index~2.6112b9af.js.map => index~2.046de999.js.map} (99%) diff --git a/index.html b/index.html index 30cb4b252e..dfb0dfd9da 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ @coze-studio/app - +
diff --git a/static/js/async/6219.eb2dbbc8.js b/static/js/async/6219.153c6aac.js similarity index 99% rename from static/js/async/6219.eb2dbbc8.js rename to static/js/async/6219.153c6aac.js index 61f116408c..071077ec6d 100644 --- a/static/js/async/6219.eb2dbbc8.js +++ b/static/js/async/6219.153c6aac.js @@ -1,2 +1,2 @@ -(self.webpackChunk_coze_studio_app=self.webpackChunk_coze_studio_app||[]).push([["6219"],{18174:function(e,t,n){var r,o;r=0,o=function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n.",e$="String expected.",e0=[],e1="__dbnames",e2="readonly",e4="readwrite";function e6(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var e5={type:3,lower:-Infinity,lowerOpen:!1,upper:[[]],upperOpen:!1};function e3(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=P(t))[e],t}}function e8(){throw Z.Type()}function e9(e,t){try{var n=e7(e),r=e7(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return ta+s&&n(a+p)})})})(0).then(function(){if(0o(e[c],n[c])?e.substr(0,c)+n[c]+n.substr(c+1):0>o(e[c],r[c])?e.substr(0,c)+r[c]+n.substr(c+1):0<=l?e.substr(0,l)+t[l]+n.substr(l+1):null;0>o(e[c],d)&&(l=c)}return s=o(e[0],e[1])}))return ty(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Z.InvalidArgument);var c=!t||!1!==t.includeLowers,d=t&&!0===t.includeUppers,u,h=o;function p(e,t){return h(e[0],t[0])}try{(u=e.reduce(function(e,t){for(var n=0,o=e.length;nr(t[0],a[1])&&0e9(n,e.from))return o?t5(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},t7(e);if(0e9(t,e.from)&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0=e9(l.from,o.to)&&0<=e9(l.to,o.from))return!0;0>e9(o.from,l.from)?o=(r=n.next(l.from)).value:l=(s=a.next(o.from)).value}return!1}function t9(e){var t=t4(e)?null:{s:0,n:e};return{next:function(e){for(var n=0e9(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||0>=e9(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function t7(e){var n,r,o=((null===(n=e.r)||void 0===n?void 0:n.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),a=1=e9(t.from,e)&&0<=e9(t.to,e)}})[D]=function(){return t9(this)},W));var nr={},ni={},no=!1;function na(e){nt(ni,e),no||(no=!0,setTimeout(function(){no=!1,ns(ni,(ni={},!1))},0))}function ns(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,o=Object.values(nr);re9(e,t.upper):0>=e9(e,t.upper)))}function nx(e,t,n,r,o,a){if(!n||0===n.length)return e;var l=t.query.index,c=l.multiEntry,d=t.query.range,u=r.schema.primaryKey.extractKey,h=l.extractKey,p=(l.lowLevelIndex||l).extractKey,n=n.reduce(function(e,n){var r=e,o=[];if("add"===n.type||"put"===n.type)for(var a=new t6,l=n.values.length-1;0<=l;--l){var p,f=n.values[l],m=u(f);a.hasKey(m)||(p=h(f),(c&&s(p)?p.some(function(e){return nw(e,d)}):nw(p,d))&&(a.addKey(m),o.push(f)))}switch(n.type){case"add":var v=(new t6).addKeys(t.values?e.map(function(e){return u(e)}):e),r=e.concat(t.values?o.filter(function(e){return e=u(e),!v.hasKey(e)&&(v.addKey(e),!0)}):o.map(function(e){return u(e)}).filter(function(e){return!v.hasKey(e)&&(v.addKey(e),!0)}));break;case"put":var g=(new t6).addKeys(n.values.map(function(e){return u(e)}));r=e.filter(function(e){return!g.hasKey(t.values?u(e):e)}).concat(t.values?o:o.map(function(e){return u(e)}));break;case"delete":var b=(new t6).addKeys(n.keys);r=e.filter(function(e){return!b.hasKey(t.values?u(e):e)});break;case"deleteRange":var y=n.range;r=e.filter(function(e){return!nw(u(e),y)})}return r},e);return n===e?e:(n.sort(function(e,t){return e9(p(e),p(t))||e9(u(e),u(t))}),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length=r.limit&&(!r.values||e.req.values)&&(t=e.req.query.range,n=r.query.range,0>=function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=e9(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return -1}return t}(t.lower,n.lower,t.lowerOpen,n.lowerOpen)&&0<=function(e,t,n,r){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return -1;if(0===(t=e9(e,t))){if(n&&r)return 0;if(n)return -1;if(r)return 1}return t}(t.upper,n.upper,t.upperOpen,n.upperOpen))}),!1,o,a];case"count":return[s=a.find(function(e){return nS(e.req.query.range,r.query.range)}),!!s,o,a]}}(n,r,"query",e),f=p[0],d=p[1],m=p[2],v=p[3];return f&&d?f.obsSet=e.obsSet:(d=o.query(e).then(function(e){var t=e.result;if(f&&(f.res=t),c){for(var n=0,r=t.length;n0x4000000000000000?0:r.oldVersion)<1,e.idbdb=f.result,s&&function(e,t){tZ(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=tX(0,e.idbdb,t);tQ(e,e._dbSchema,t);for(var r=0,o=tK(n,e._dbSchema).change;r=t})).length?(e.forEach(function(e){n.push(function(){var n=r,o=e._cfg.dbschema;tQ(l,n,m),tQ(l,o,m),r=l._dbSchema=o;var s=tK(n,o);s.add.forEach(function(e){tq(m,e[0],e[1].primKey,e[1].indexes)}),s.change.forEach(function(e){if(e.recreate)throw new Z.Upgrade("Not yet support for changing primary key");var t=m.objectStore(e.name);e.add.forEach(function(e){return tY(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),tY(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var c=e._cfg.contentUpgrade;if(c&&e._cfg.version>t){tF(l,m),b._memoizedTables={};var d=k(o);s.del.forEach(function(e){d[e]=n[e]}),tU(l,[l.Transaction.prototype]),tH(l,[l.Transaction.prototype],a(d),d),b.schema=d;var u,h=O(c);return h&&eF(),s=ew.follow(function(){var e;(u=c(b))&&h&&(e=eH.bind(null,null),u.then(e,e))}),u&&"function"==typeof u.then?ew.resolve(u):s.then(function(){return u})}}),n.push(function(t){var n=e._cfg.dbschema;[].slice.call(t.db.objectStoreNames).forEach(function(e){return null==n[e]&&t.db.deleteObjectStore(e)}),tU(l,[l.Transaction.prototype]),tH(l,[l.Transaction.prototype],l._storeNames,l._dbSchema),b.schema=l._dbSchema}),n.push(function(t){l.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(l.idbdb.version/10)===e._cfg.version?(l.idbdb.deleteObjectStore("$meta"),delete l._dbSchema.$meta,l._storeNames=l._storeNames.filter(function(e){return"$meta"!==e})):t.objectStore("$meta").put(e._cfg.version,"version"))})}),(function e(){return n.length?ew.resolve(n.shift()(b.idbtrans)).then(e):ew.resolve()})().then(function(){tZ(r,m)})):ew.resolve()}).catch(y)):(a(g).forEach(function(e){tq(m,e,g[e].primKey,g[e].indexes)}),tF(l,m),void ew.follow(function(){return l.on.populate.fire(b)}).catch(y))}))},d),f.onsuccess=eD(function(){u=null;var n,l,d,m=e.idbdb=f.result,v=b(m.objectStoreNames);if(0e9(e,t)?e:t},this._IDBKeyRange=d._deps.IDBKeyRange,!this._IDBKeyRange)throw new Z.MissingAPI})),this.on("versionchange",function(e){0B,rm:()=>r.rm,qz:()=>W.q});var r=n("910376");n("786406");var o=n("825955"),a=n("808549"),s=n("120454"),l=n("151064"),c=n("455069"),d=n("626389"),u=n.n(d),h=n("252237"),p=n.n(h),f=n("287487"),m=n("336205"),v=n("707107"),g=n("214942"),b=n("775699"),y=n("966219"),_=n("458949"),w=n("178385"),x=n("382534"),S=n("407821"),k=n.n(S),C=n("472772"),j=n.n(C),E=n("395245"),T=n.n(E),I=n("297998"),P=n.n(I),M=n("646576"),R=n.n(M),D=n("606121"),A=n.n(D),N=n("376756"),L={};L.styleTagTransform=A(),L.setAttributes=P(),L.insert=T().bind(null,"head"),L.domAPI=j(),L.insertStyleElement=R(),k()(N.Z,L);var z=N.Z&&N.Z.locals?N.Z.locals:void 0,O=[{label:"cURL",value:_.gR.Curl},{label:"Wget",value:_.gR.Wget},{label:"Node.js",value:_.gR.NodeJS},{label:"Python",value:_.gR.Python},{label:"Golang",value:_.gR.Golang}],B=e=>{var{onCancel:t,visible:n,pluginAPIInfo:r}=e,[d,h]=(0,c.useState)(_.gR.Curl),[S,k]=(0,c.useState)(""),{id:C,space_type:j}=(0,g.rY)(e=>e.space),E=j===w.Sn.Personal,T=f.Z.useUserInfo();return(0,c.useEffect)(()=>{h(_.gR.Curl),k("")},[n]),(0,c.useEffect)(()=>{if(r){var e;(e=(0,o._)(function*(){k("");var e=yield x.Js.PluginAPI2Code({plugin_id:r.plugin_id||"",api_id:r.api_id||"",space_id:C||"",dev_id:(null==T?void 0:T.user_id_str)||"",program_lang:d});k((null==e?void 0:e.program_code)||"")}),function(){return e.apply(this,arguments)})()}},[d,r]),(0,l.jsx)(b.M5,{type:"base-composition",title:m.o.t("code_snippet"),visible:n,onCancel:t,footer:(0,l.jsx)(b.T,{children:(0,l.jsx)(b.y3,{theme:"solid",type:"primary",onClick:()=>{var e=u()(S),t={environment:"cn-boe",workspace_id:C||"",workspace_type:E?"personal_workspace":"team_workspace",tool_id:(null==r?void 0:r.api_id)||"",code_type:function(e){switch(e){case _.gR.Curl:return"curl";case _.gR.Wget:return"wget";case _.gR.NodeJS:return"javascript";case _.gR.Python:return"python";case _.gR.Golang:return"golang";default:return""}}(d)||"",status:1};e?(b.O$.success({content:m.o.t("copy_success")}),(0,v.Gg)(v.Kg.code_snippet_front,(0,s._)((0,a._)({},t),{status:0}))):(b.O$.warning({content:m.o.t("copy_failed")}),(0,v.Gg)(v.Kg.code_snippet_front,(0,s._)((0,a._)({},t),{status:1,error_message:"copy_failed"})))},children:m.o.t("copy")})}),maskClosable:!1,children:(0,l.jsxs)("div",{className:"h-[100%] flex flex-col min-h-0",children:[(0,l.jsx)("div",{children:(0,l.jsx)(b.FX,{type:"card",options:O,defaultValue:d,className:"mb-[16px]",value:d,onChange:e=>h(e.target.value)})}),(0,l.jsx)("div",{className:p()(z["editor-container"],"flex-1 min-h-0"),children:(0,l.jsx)(y.Editor,{className:z.editor,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1},language:function(e){switch(e){case _.gR.Curl:case _.gR.Wget:case _.gR.NodeJS:return"javascript";case _.gR.Python:return"python";case _.gR.Golang:return"go";default:return"javascript"}}(d),theme:"tomorrow",width:"100%",value:S})})]})})};n("3779"),n("512421");var W=n("317612")},988179:function(e,t,n){"use strict";n.d(t,{iN:()=>y,zb:()=>B,A7:()=>Y,Pj:()=>X,B5:()=>Z});var r=n("808549"),o=n("151064"),a=n("455069"),s=n("354428"),l=n("336205"),c=n("659596"),d=n("775699"),u=n("486613"),h=n("479886"),p=n.n(h),f=n("287487"),m=n("388993"),v=n("707107"),g=n("214942"),b=n("178385");function y(e,t){var{botId:n}=m.G.getState(),o=f.Z.getUserInfo(),{space:{id:a,space_type:s}}=g.rY.getState(),l=s===b.Sn.Personal,c=Date.now();(0,v.Gg)(e,(0,r._)({user_id:null==o?void 0:o.user_id_str,timestamp:c,bot_id:n,workspace_id:a,workspace_type:l?"personal_workspace":"team_workspace"},t))}var _=e=>{try{if(!e)return e;var t=e.match(/timestamp:"(\d{10,13})"/);if(t){var n=null==t?void 0:t[1],r="YYYY-MM-DD HH:mm:ss",o="".concat(n).length;if(10===o)return'"'.concat(p().unix(Number(n)).format(r),'"');if(13===o)return'"'.concat(p()(Number(n)).format(r),'"')}return e}catch(t){return e}},w=n("157728"),x=()=>{var e=(0,w.useParams)(),t=e.space_id||"",n=e.bot_id||"";return{sendViewDiffEvent:()=>{(0,v.Gg)(v.Kg.bot_diff_viewdetail,{workspace_id:t,bot_id:n})},sendManualMergeEvent:e=>{(0,v.Gg)(v.Kg.bot_merge_manual,{workspace_id:t,bot_id:n,submit_or_not:e})}}},S=n("407821"),k=n.n(S),C=n("472772"),j=n.n(C),E=n("395245"),T=n.n(E),I=n("297998"),P=n.n(I),M=n("646576"),R=n.n(M),D=n("606121"),A=n.n(D),N=n("367689"),L={};L.styleTagTransform=A(),L.setAttributes=P(),L.insert=T().bind(null,"head"),L.domAPI=j(),L.insertStyleElement=R(),k()(N.Z,L);var z=N.Z&&N.Z.locals?N.Z.locals:void 0,O=e=>{try{return JSON.parse(e)}catch(e){return""}},B=e=>{var t,{left:n,right:a,node:s}=e;if((null==s?void 0:null===(t=s.diff_res)||void 0===t?void 0:t.diff_style)===u.jY.TextDetail)return(0,o.jsx)(W,(0,r._)({},e));var l=_(n),c=_(a),h=null==l?void 0:l.includes("template_NewLine"),p=e=>(0,o.jsx)(d.ZT.Text,{className:z["multiline-text"],type:"secondary",size:"small",children:e.replaceAll("template_NewLine","\n")});return h?(0,o.jsxs)(d.ZT.Text,{className:z["multiline-container"],type:"secondary",size:"small",children:[p(null!=l?l:""),(0,o.jsx)(d.ZT.Text,{className:"mx-2",type:"secondary",size:"small",children:"->"}),p(null!=c?c:"")]}):(0,o.jsx)(d.ZT.Text,{type:"secondary",size:"small",ellipsis:{showTooltip:{opts:{content:"".concat(l," -> ").concat(c),style:{wordBreak:"break-word"}}}},children:"".concat(l," -> ").concat(c)})},W=e=>{var t,n,r,u,{node:h,type:p="diff"}=e,f="diff"===p,[m,v]=(0,a.useState)(!1),{sendViewDiffEvent:g}=x(),b=O(null===(t=O(null==h?void 0:null===(n=h.diff_res)||void 0===n?void 0:n.origin_left))||void 0===t?void 0:t.OriginStr),y=O(null===(r=O(null==h?void 0:null===(u=h.diff_res)||void 0===u?void 0:u.origin_right))||void 0===r?void 0:r.OriginStr);return(0,o.jsxs)("div",{children:[(0,o.jsx)(d.ZT.Text,{link:!0,onClick:()=>{v(!0),g()},className:"text-xs",children:l.o.t("coze_bot_diff_btn_view_diff")}),(0,o.jsx)(c.u_,{visible:m,title:(0,o.jsx)("div",{className:"flex gap-1 items-center",children:l.o.t("coze_bot_diff_diffdetail_pagetitle")}),footer:null,width:1e3,onCancel:()=>{v(!1)},children:(0,o.jsxs)("div",{className:z["editor-container"],children:[(0,o.jsxs)("div",{className:z["editor-header"],children:[(0,o.jsx)("div",{className:z["editor-title"],children:l.o.t(f?"coze_bot_diff_diffdetail_latestversion":"coze_bot_diff_diffdetail_onlineversion")}),(0,o.jsx)(d.iz,{className:z["editor-divider"],layout:"vertical"}),(0,o.jsx)("div",{className:z["editor-title"],children:l.o.t(f?"coze_bot_diff_diffdetail_mydraft":"coze_bot_diff_diffdetail_tobereleasedversion")})]}),(0,o.jsx)("div",{className:"h-[600px]",children:(0,o.jsx)(s.DiffEditor,{theme:"light",className:z.editor,original:b,modified:y,language:"text",options:{minimap:{enabled:!1},wordWrap:"on",diffWordWrap:"on",lineNumbers:"on",readOnly:!0,scrollBeyondLastLine:!1,renderOverviewRuler:!1,enableSplitViewResizing:!1,unicodeHighlight:{ambiguousCharacters:!1},suggestLineHeight:32,lineHeight:20,fontSize:12},loading:(0,o.jsx)("div",{className:"h-[100%] w-[100%] flex items-center justify-center",children:(0,o.jsx)(d.yC,{})})})})]})})]})},F=n("252237"),H=n.n(F),U=n("675940"),V={};V.styleTagTransform=A(),V.setAttributes=P(),V.insert=T().bind(null,"head"),V.domAPI=j(),V.insertStyleElement=R(),k()(U.Z,V);var K=U.Z&&U.Z.locals?U.Z.locals:void 0,q=e=>{var{dataSource:t}=e,[n,r]=(0,a.useState)(!1),s=()=>{r(!1)};return{node:(0,o.jsx)(d.M5,{type:"info",title:l.o.t("publish_terms_title"),visible:n,centered:!0,footer:(0,o.jsx)(d.y3,{onClick:s,theme:"solid",children:l.o.t("got_it")}),onCancel:s,children:(0,o.jsx)(d.aV,{dataSource:t,renderItem:e=>(0,o.jsx)(d.aV.Item,{className:K.list,align:"center",header:(0,o.jsxs)("div",{className:"flex items-center w-full",children:[(0,o.jsx)(d.Ee,{className:"border-1",src:e.icon,width:24,height:24,preview:!1,style:{flexShrink:0}}),(0,o.jsx)(d.ZT.Text,{className:"ml-2 font-semibold ",style:{minWidth:90},ellipsis:{showTooltip:{opts:{content:e.name}}},children:e.name})]}),main:(0,o.jsxs)(d.T,{spacing:0,className:"justify-end",children:[e.privacy_policy?(0,o.jsx)(d.y3,{theme:"borderless",className:"!px-2",children:(0,o.jsx)(d.ZT.Text,{link:{href:e.privacy_policy,target:"_blank"},children:l.o.t("about_privacy_policy")})}):null,e.user_agreement?(0,o.jsx)(d.y3,{theme:"borderless",className:"!px-2",children:(0,o.jsx)(d.ZT.Text,{link:{href:e.user_agreement,target:"_blank"},children:l.o.t("terms_of_service")})}):null]})})})}),close:s,open:()=>{r(!0)}}},Z=e=>{var{termServiceData:t,scene:n="bot",className:r}=e,{node:a,open:s}=q({dataSource:t});return(0,o.jsxs)(o.Fragment,{children:[a,(0,o.jsx)(c.ZT.Text,{className:H()("py-[12px] coz-fg-primary leading-[16px]",r),children:l.o.t("bot"===n?"bot_publish_select_desc_compliance_new":"project_publish_select_desc_compliance_new",{publish_terms_title:(0,o.jsx)(c.ZT.Text,{link:!0,onClick:s,className:"!coz-fg-hglt !font-normal",children:l.o.t("publish_terms_title")})})})]})},Y=20,X=8},601477:function(e,t,n){"use strict";n.d(t,{S:function(){return f}});var r=n(808549),o=n(120454),a=n(151064),s=n(336205),l=n(659596),c=n(707107),d=n(775699),u=n(178385),h=n(49695),p=n(150500),f=e=>{var{status:t,id:n,agentType:f="bot",channelName:m,revokeSuccess:v,origin:g,authInfo:b,isMouseIn:y=!0,isV2:_=!1,v2ButtonProps:w={color:"highlight",size:"small"},onBeforeAuthRedirect:x}=e,S=[u._6.Configured,u._6.Configuring].includes(t),k=()=>{if(!(0,p.Tn)(b)){(0,p.ci)();return}("publish"===g&&t===u._6.NotConfigured||"setting"===g&&t===u.tD.Unauthorized)&&((0,c.Gg)("publish"===g?c.Kg.publish_oauth_button_click:c.Kg.settings_oauth_button_click,{action:"授权",channel_name:m}),null==x||x({id:n,authInfo:b,origin:g}),(0,p.OF)({id:n,authInfo:b,origin:g})),("publish"===g&&S||"setting"===g&&t===u.tD.Authorized)&&((0,c.Gg)("publish"===g?c.Kg.publish_oauth_button_click:c.Kg.settings_oauth_button_click,{action:"解除授权",channel_name:m}),E())},{revokeLoading:C,runRevoke:j}=(0,p.To)({id:n,onRevokeSuccess:v,onRevokeFinally:()=>T()}),{open:E,close:T,modal:I,visible:P}=(0,d.q0)({confirmLoading:C,type:"info",title:s.o.t("user_revoke_authorization_title"),onOk:j,okText:s.o.t("Confirm"),cancelText:s.o.t("Cancel"),icon:(0,a.jsx)(h.Z,{style:{color:"var(--semi-color-danger)"},size:"extra-large"}),onCancel:()=>{T()},okButtonProps:{type:"danger"}}),M=s.o.t(S?"bot_publish_columns_action_revoke_authorize":"bot_publish_columns_action_authorize"),R=_?(0,a.jsx)(l.zx,(0,o._)((0,r._)({onClick:k},w),{children:M})):(0,a.jsx)(d.y3,{onClick:k,theme:"borderless",children:M});return t===u._6.Configured?(0,a.jsxs)(a.Fragment,{children:[y||P?R:null,I("project"===f?(0,a.jsx)(d.ZT.Text,{type:"secondary",children:s.o.t("project_release_cancel1_desc")}):null)]}):R}},493278:function(e,t,n){"use strict";n.d(t,{T:function(){return p}});var r=n(151064),o=n(336205),a=n(775699),s=n(486613),l=n(988179),c=n(561641),d=n(269087),u=n(841622),h={[s.sv.Add]:"devops_publish_multibranch_changeset_add",[s.sv.Delete]:"devops_publish_multibranch_changeset_delete",[s.sv.Modify]:"devops_publish_multibranch_changeset_modify",[s.sv.Remove]:"devops_publish_multibranch_changeset_remove"},p=e=>{var{diffData:t,hasError:n}=e;return(0,r.jsx)("div",{className:u.Z.container,children:(null==t?void 0:t.length)>0?t.map(e=>{var t;return(0,r.jsxs)("div",{className:u.Z["info-block"],children:[(0,r.jsx)("div",{className:u.Z["info-title"],children:e.display_name}),(null==e?void 0:null===(t=e.sub_nodes)||void 0===t?void 0:t.length)?(0,r.jsx)(f,{blockDiffData:e.sub_nodes}):null]},e.display_name)}):(0,r.jsxs)("div",{className:u.Z["empty-container"],children:[(0,r.jsx)("img",{src:d.Z}),(0,r.jsx)(a.ZT.Text,{className:u.Z["empty-info"],children:o.o.t(n?"devops_publish_multibranch_NetworkError":"devops_publish_multibranch_nodiff")})]})})},f=e=>{var{blockDiffData:t}=e,n=[{title:o.o.t("devops_publish_multibranch_property"),width:280,render:e=>(0,r.jsxs)(a.ZT.Text,{ellipsis:{showTooltip:{opts:{content:e.display_name,className:u.Z["property-tooltip"]}}},className:u.Z["cell-span"],children:[e.level>0?(0,r.jsx)(a.ZT.Text,{style:{marginLeft:l.Pj+l.A7*(e.level-1),marginRight:8},children:"-"}):null,e.display_name]})},{title:o.o.t("devops_publish_multibranch_changetype"),render:e=>{var t;return e.diff_res&&(null===(t=e.diff_res)||void 0===t?void 0:t.action)!==s.sv.Unknown?(0,r.jsx)(a.fS,{className:u.Z["tag-".concat(e.diff_res.action)],children:o.o.t(h[e.diff_res.action])}):""},width:120},{title:o.o.t("devops_publish_multibranch_changes"),render:e=>{var t,n,o;return(null==e?void 0:null===(t=e.diff_res)||void 0===t?void 0:t.action)===s.sv.Modify?(0,r.jsx)(l.zb,{node:e,left:(null==e?void 0:null===(n=e.diff_res)||void 0===n?void 0:n.display_left)||"",right:(null==e?void 0:null===(o=e.diff_res)||void 0===o?void 0:o.display_right)||""}):""},ellipsis:!0}];return t?(0,r.jsx)(a.iA,{dataSource:(0,c.pX)(t),columns:n,pagination:!1,onRow:()=>({className:u.Z["table-row"]}),className:u.Z["diff-table"]}):null}},714393:function(e,t,n){"use strict";n.d(t,{LH:function(){return p}});var r=n(151064),o=n(336205),a=n(775699),s=n(486613),l=n(988179),c=n(561641),d=n(269087),u=n(841622),h={[s.sv.Add]:"devops_publish_multibranch_changeset_add",[s.sv.Delete]:"devops_publish_multibranch_changeset_delete",[s.sv.Modify]:"devops_publish_multibranch_changeset_modify",[s.sv.Remove]:"devops_publish_multibranch_changeset_remove"},p=e=>{var{diffData:t,hasError:n,type:s="diff"}=e;return(0,r.jsxs)("div",{className:u.Z.container,children:[(null==t?void 0:t.length)>0?t.map(e=>{var t,n;return(0,r.jsxs)("div",{className:u.Z["info-block"],children:[(0,r.jsx)("div",{className:u.Z["info-title"],children:e.display_name}),(null==e?void 0:null===(t=e.sub_nodes)||void 0===t?void 0:t.length)?null==e?void 0:null===(n=e.sub_nodes)||void 0===n?void 0:n.map((e,t)=>(0,r.jsx)(f,{node:e,type:s},t)):null]},e.display_name)}):(0,r.jsxs)("div",{className:u.Z["empty-container"],children:[(0,r.jsx)("img",{src:d.Z}),(0,r.jsx)(a.ZT.Text,{className:u.Z["empty-info"],children:o.o.t(n?"devops_publish_multibranch_NetworkError":"devops_publish_multibranch_nodiff")})]}),(0,r.jsx)("div",{className:"h-[32px]"}),(0,r.jsx)("div",{className:u.Z.mask})]})},f=e=>{var t,{node:n,type:o="diff"}=e,{display_name:a}=n;return(0,r.jsxs)("div",{children:[a?(0,r.jsx)("div",{className:u.Z["info-subtitle"],children:a}):(0,r.jsx)(r.Fragment,{}),(null==n?void 0:null===(t=n.sub_nodes)||void 0===t?void 0:t.length)?(0,r.jsx)(m,{blockDiffData:null==n?void 0:n.sub_nodes,type:o}):null]})},m=e=>{var{blockDiffData:t,type:n="diff"}=e;if(!t)return null;var d=e=>(0,r.jsxs)(a.ZT.Text,{ellipsis:{showTooltip:{opts:{content:e.display_name,className:u.Z["property-tooltip"]}}},className:u.Z["property-title"],children:[e.level>0?(0,r.jsx)(a.ZT.Text,{style:{marginLeft:l.Pj+l.A7*(e.level-1),marginRight:8},children:"-"}):null,e.display_name]}),p=e=>{var t;return e.diff_res&&(null===(t=e.diff_res)||void 0===t?void 0:t.action)!==s.sv.Unknown?(0,r.jsx)(a.fS,{className:u.Z["tag-".concat(e.diff_res.action)],children:o.o.t(h[e.diff_res.action])}):""},f=e=>{var t,o,a;return(null==e?void 0:null===(t=e.diff_res)||void 0===t?void 0:t.action)===s.sv.Modify?(0,r.jsx)(l.zb,{left:(null==e?void 0:null===(o=e.diff_res)||void 0===o?void 0:o.display_left)||"",right:(null==e?void 0:null===(a=e.diff_res)||void 0===a?void 0:a.display_right)||"",node:e,type:n}):""};return(0,r.jsx)(a.aV,{dataSource:(0,c.pX)(t),bordered:!0,className:u.Z.list,renderItem:e=>(0,r.jsx)(a.aV.Item,{children:(0,r.jsxs)("div",{className:u.Z["list-item"],children:[d(e),(0,r.jsxs)("div",{children:[" ",p(e)]}),f(e)]})})})}},243238:function(e,t,n){"use strict";n.d(t,{S:()=>el,O:()=>e_});var r,o=n("151064"),a=n("336205"),s=n("659596"),l=n("775699"),c=n("178385"),d=n("157728"),u=n("825955"),h=n("808549"),p=n("120454"),f=n("455069"),m=n("735114"),v=n("499283");var g=((r={})[r.NotQuery=0]="NotQuery",r[r.GetBindConnectorConfig=1]="GetBindConnectorConfig",r[r.SaveBindConnectorConfig=2]="SaveBindConnectorConfig",r[r.BindConnector=3]="BindConnector",r[r.UnBindConnector=4]="UnBindConnector",r),b=n("382534"),y=n("39663"),_=n("978028"),w=n("475759"),x=e=>{var t,n,r,o,a,s,{botId:l,origin:c="bot",schemaPages:h,onNextStepSuccess:p,onNextStepError:v}=e,[y,_]=(0,f.useState)(0),{space_id:w=""}=(0,d.useParams)(),x="bot"===c?0:1,S=null!==(s=null==h?void 0:null===(a=h[y])||void 0===a?void 0:a.api_action)&&void 0!==s?s:g.BindConnector;var k={[g.NotQuery]:(0,u._)(function*(){return yield Promise.resolve()}),[g.GetBindConnectorConfig]:(t=(0,u._)(function*(e){var t,n;return yield b.nA.GetBindConnectorConfig({connector_id:null!==(t=null==e?void 0:e.connectorId)&&void 0!==t?t:"",detail:null!==(n=null==e?void 0:e.assignFormValue)&&void 0!==n?n:{},agent_type:x,bot_id:l,space_id:w})}),function(e){return t.apply(this,arguments)}),[g.SaveBindConnectorConfig]:(n=(0,u._)(function*(e){var t,n;return yield b.nA.SaveBindConnectorConfig({connector_id:null!==(t=null==e?void 0:e.connectorId)&&void 0!==t?t:"",detail:null!==(n=null==e?void 0:e.assignFormValue)&&void 0!==n?n:{},agent_type:x,bot_id:l,space_id:w})}),function(e){return n.apply(this,arguments)}),[g.BindConnector]:(r=(0,u._)(function*(e){var t,n;return yield b.nA.BindConnector({connector_id:null!==(t=null==e?void 0:e.connectorId)&&void 0!==t?t:"",connector_info:null!==(n=null==e?void 0:e.assignFormValue)&&void 0!==n?n:{},agent_type:x,bot_id:l,space_id:w},{__disableErrorToast:!0})}),function(e){return r.apply(this,arguments)})};var{run:C,loading:j}=(0,m.Z)((o=(0,u._)(function*(e){return yield k[S](e)}),function(e){return o.apply(this,arguments)}),{manual:!0,ready:Object.keys(k).includes(String(S)),onSuccess:e=>{null==p||p({data:e,action:S})},onError:e=>{v(e)}});return{run:C,loading:j,step:y,setStep:_}},S=n("484782"),k=n("407821"),C=n.n(k),j=n("472772"),E=n.n(j),T=n("395245"),I=n.n(T),P=n("297998"),M=n.n(P),R=n("646576"),D=n.n(R),A=n("606121"),N=n.n(A),L=n("642801"),z={};z.styleTagTransform=N(),z.setAttributes=M(),z.insert=I().bind(null,"head"),z.domAPI=E(),z.insertStyleElement=D(),C()(L.Z,z);var O=L.Z&&L.Z.locals?L.Z.locals:void 0,B=e=>{var t,{copyLinkAreaInfo:n={},agentType:r="bot",botId:a="",initValue:s={}}=e,c=e=>{var t=null!=e?e:"";return t&&(t=(t="project"===r?t.replace(/{project_id}/g,a):t.replace(/{bot_id}/g,a)).replace(/{hostname}/g,window.location.hostname).replace(/{corp_id}/g,s.corp_id)),t};return(0,o.jsxs)("div",{className:O["link-area"],children:[(null==n?void 0:n.title_text)?(0,o.jsxs)(l.T,{spacing:12,align:"start",children:[(0,o.jsx)("span",{className:O["step-order"],children:n.step_order||1}),(0,o.jsx)("div",{className:O["step-content"],children:(0,o.jsx)("div",{className:O["step-title"],children:n.title_text})})]}):null,(null==n?void 0:n.description)?(0,o.jsx)(S.D,{skipHtml:!0,className:O.markdown,children:n.description}):null,(null==n?void 0:null===(t=n.link_list)||void 0===t?void 0:t.length)?(0,o.jsx)("div",{className:O["link-list"],children:null==n?void 0:n.link_list.map(e=>(0,o.jsxs)("div",{style:{marginBottom:32},children:[(0,o.jsx)(l.ZT.Title,{className:O.title,children:e.title}),(0,o.jsx)(l.ZT.Text,{className:O.link,copyable:!0,children:c(e.link)})]},e.link))}):null]})},W=n("783915"),F={};F.styleTagTransform=N(),F.setAttributes=M(),F.insert=I().bind(null,"head"),F.domAPI=E(),F.insertStyleElement=D(),C()(W.Z,F);var H=W.Z&&W.Z.locals?W.Z.locals:void 0,U=e=>{var{connectorConfigInfo:t={}}=e;return(0,o.jsxs)("div",{className:H.guide,children:[(null==t?void 0:t.start_text)?(0,o.jsx)(S.D,{skipHtml:!0,linkTarget:"_blank",className:H.markdown,children:null==t?void 0:t.start_text}):null,(null==t?void 0:t.guide_link_url)&&(null==t?void 0:t.guide_link_text)?(0,o.jsx)("div",{children:(0,o.jsx)(l.ZT.Text,{link:{href:null==t?void 0:t.guide_link_url},className:H["config-link"],children:null==t?void 0:t.guide_link_text})}):null]})},V=n("61279"),K=n("297158"),q=n("873183"),Z=n("298203"),Y=n("293758"),X={};X.styleTagTransform=N(),X.setAttributes=M(),X.insert=I().bind(null,"head"),X.domAPI=E(),X.insertStyleElement=D(),C()(Y.Z,X);var Q=Y.Z&&Y.Z.locals?Y.Z.locals:void 0,G=e=>{var{formItemSchema:t,isReadOnly:n,initValue:r}=e,c=null==r?void 0:r[t.name];if(n){;return(0,o.jsxs)("div",{className:Q["disable-field"],children:[(0,o.jsx)("div",{className:Q.title,children:t.title}),"array"===t.type?(0,o.jsx)(s.QS,{tagList:(u=c,p=t.enums,(f=(0,Z.f5)(u))?f.map(e=>{var t,n;return{children:null!==(n=null==p?void 0:null===(t=p.find(t=>t.value===e))||void 0===t?void 0:t.label)&&void 0!==n?n:e}}):[])}):(0,o.jsx)(l.ZT.Text,{style:{width:"100%"},ellipsis:{showTooltip:{opts:{content:c,style:{wordBreak:"break-word"}}}},children:c})]})}function d(e){var t,n,r=(null!==(t=e.rules)&&void 0!==t?t:[]).map(t=>{var n=t.message?a.o.t(t.message,{field:e.name}):void 0;return(0,h._)({},t,n&&{message:n})});return r.push({required:e.required,message:a.o.t("bot_publish_field_placeholder",{field:null!==(n=e.title)&&void 0!==n?n:""})}),r}if(!t.name)return null;switch(t.component){case"Input":if("array"===t.type){var u,p,f,m,v=[];try{v=JSON.parse(c)}catch(e){K.kg.error({error:e}),v=[]}return!v.length&&v.push(""),(0,o.jsx)(s.OF,{field:t.name,initValue:v,children:e=>{var{arrayFields:n,add:r}=e;return(0,o.jsxs)(o.Fragment,{children:[n.map((e,r)=>{var s,{key:c,field:u,remove:h}=e;return(0,o.jsx)(l.K9,{placeholder:a.o.t("bot_publish_field_placeholder",{field:null!==(s=t.title)&&void 0!==s?s:""}),field:u,label:t.title,noLabel:r>0,required:t.required,rules:d(t),fieldClassName:Q.input,suffix:n.length<=1?null:(0,o.jsx)(q.dVD,{onClick:h})},c)}),(0,o.jsx)(s.zx,{className:Q["link-button"],color:"highlight",size:"small",icon:(0,o.jsx)(q.PwN,{}),onClick:r,children:a.o.t("binding_add_card")})]})}})}return(0,o.jsx)(l.K9,{placeholder:a.o.t("bot_publish_field_placeholder",{field:null!==(m=t.title)&&void 0!==m?m:""}),field:t.name,label:t.title,required:t.required,showClear:!0,rules:d(t),initValue:c},t.name);case"Select":var g="array"===t.type,b=g?(0,Z.f5)(c):c;return(0,o.jsx)(l.l0.Select,{placeholder:"Enter ".concat(t.title),field:t.name,label:t.title,optionList:t.enums,multiple:g,rules:d(t),initValue:b},t.name);default:return null}},J=n("205136"),$={};$.styleTagTransform=N(),$.setAttributes=M(),$.insert=I().bind(null,"head"),$.domAPI=E(),$.insertStyleElement=D(),C()(J.Z,$);var ee=J.Z&&J.Z.locals?J.Z.locals:void 0,et=(0,f.forwardRef)((e,t)=>{var n,r,a,s,{schemaAreaInfo:c,initValue:d,getFormDisable:h,isReadOnly:p,setErrorMessage:m}=e,v=(0,f.useRef)(),g=(0,V.Z)();(0,f.useImperativeHandle)(t,()=>({submit:(0,u._)(function*(){var e,t=yield null===(e=v.current)||void 0===e?void 0:e.validate();return Object.fromEntries(Object.entries(null!=t?t:{}).map(e=>{var[t,n]=e;return[t,Array.isArray(n)?JSON.stringify(n):n]}))}),reset:()=>{var e;return null===(e=v.current)||void 0===e?void 0:e.reset()}})),(0,f.useEffect)(()=>{g()},[c]);var b=(null==c?void 0:null===(n=c.schema_list)||void 0===n?void 0:n.filter(e=>e.required).some(e=>{var t,n=null===(t=v.current)||void 0===t?void 0:t.getValue(e.name);return Array.isArray(n)?!n.length||1===n.length&&!n[0]:!n}))||!(null==c?void 0:null===(r=c.schema_list)||void 0===r?void 0:r.length);return(0,f.useEffect)(()=>{h(b)},[b]),(0,o.jsxs)("div",{children:[(null==c?void 0:c.title_text)?(0,o.jsxs)(l.T,{spacing:12,align:"start",children:[(0,o.jsx)("span",{className:ee["step-order"],children:c.step_order||2}),(0,o.jsx)("div",{className:ee["step-content"],children:(0,o.jsx)("div",{className:ee["step-title"],children:c.title_text})})]}):null,(null==c?void 0:c.description)?(0,o.jsx)(S.D,{skipHtml:!0,className:ee.markdown,children:null==c?void 0:c.description}):null,(null==c?void 0:null===(a=c.schema_list)||void 0===a?void 0:a.length)?(0,o.jsx)(l.l0,{initValues:d,className:ee["config-form"],onValueChange:()=>{g(),m(void 0)},getFormApi:e=>v.current=e,autoScrollToError:!0,allowEmpty:!0,children:null==c?void 0:null===(s=c.schema_list)||void 0===s?void 0:s.map(e=>(0,o.jsx)(G,{initValue:d,formItemSchema:e,isReadOnly:p},e.name))}):null]})}),en=n("434414"),er={};er.styleTagTransform=N(),er.setAttributes=M(),er.insert=I().bind(null,"head"),er.domAPI=E(),er.insertStyleElement=D(),C()(en.Z,er);var ei=en.Z&&en.Z.locals?en.Z.locals:void 0,eo=e=>{var t,n,{errorMessage:r}=e,s=null!==(n=null==r?void 0:r.raw)&&void 0!==n?n:{};return(0,o.jsx)(l.l0.ErrorMessage,{error:(t=s,["bind_bot_id","bind_bot_name","bind_space_id"].every(e=>e in t))?(0,o.jsx)("div",{className:ei["error-link"],children:a.o.t("bot_publish_bind_error",{bot_name:(0,o.jsx)(l.ZT.Text,{className:ei["error-link-underline"],link:{href:"/space/".concat(s.bind_space_id,"/").concat(1===s.bind_agent_type?"project-ide":"bot","/").concat(s.bind_bot_id)},ellipsis:{showTooltip:{opts:{content:s.bind_bot_name}}},children:s.bind_bot_name}),key_name:"token"})}):null==r?void 0:r.msg,className:ei["error-container"]})},ea=e=>{var t,n,r,s,d,S,k,{botId:C,origin:j="bot",onSuccess:E,onUnbind:T}=e,I=(0,f.useRef)(null),[P,M]=(0,f.useState)(),{initValue:R}=null!=P?P:{},[D,A]=(0,f.useState)(),[N,L]=(0,f.useState)(!1),[z,O]=(0,f.useState)(),W=(0,f.useRef)(""),F=()=>{var e;A(void 0),ee(0),O(void 0),null===(e=I.current)||void 0===e||e.reset(),el()},H=()=>{F(),T?T():E((0,p._)((0,h._)({},R),{bind_info:{},bind_id:""})),l.O$.success(a.o.t("bot_publish_disconnect_success"))},[V,K]=(0,f.useState)(),q=(0,f.useRef)(),{loading:Z}=(0,m.Z)((0,u._)(function*(){var e;return yield b.nA.QuerySchemaList({connector_id:null!==(e=null==R?void 0:R.id)&&void 0!==e?e:"",scene:j})}),{ready:!!(null==R?void 0:R.id),refreshDeps:[null==R?void 0:R.id],onBefore:()=>{(null==R?void 0:R.id)!==q.current&&(q.current=null==R?void 0:R.id,K({}))},onSuccess:e=>{var t;!(null===(t=e.schema_area_pages)||void 0===t?void 0:t.length)&&(e.schema_area_pages=[{schema_area:e.schema_area,copy_link_area:e.copy_link_area}]),K(e)},onError:()=>{K({})}}),{schema_area_pages:Y=[]}=null!=V?V:{},X=e=>{if((null==R?void 0:R.bind_type)===c.P0.KvAuthBind&&((null==e?void 0:e.client_id)||(null==e?void 0:e.auth_params)))(0,y.HL)({navigatePath:"".concat(location.pathname).concat(location.search),type:"oauth",extra:{origin:"publish",encrypt_state:null==e?void 0:e.encrypt_state}},(null==R?void 0:R.id)||"",(0,h._)((0,p._)((0,h._)({},null==R?void 0:R.auth_login_info),{client_id:null==e?void 0:e.client_id}),e.auth_params));else{var t;W.current=null!==(t=null==e?void 0:e.bind_id)&&void 0!==t?t:""}},Q=()=>{$===(null==Y?void 0:Y.length)-1?(R&&E((0,p._)((0,h._)({},R),{bind_info:(0,h._)({},z),bind_id:W.current})),F()):ee($+1)},{loading:G,run:J,step:$,setStep:ee}=x({botId:C,origin:j,schemaPages:Y,onNextStepSuccess:e=>{if(e.action===g.BindConnector&&X(e.data),e.action===g.GetBindConnectorConfig){var t;O((0,h._)({},z,null===(t=e.data.config)||void 0===t?void 0:t.detail))}Q()},onNextStepError:e=>{(0,v.k0)(e)&&A(e)}}),{node:en,open:er}=(0,w.O)({botId:C,origin:j,platformInfo:R,onUnbind:()=>{H()}});var ei=(t=(0,u._)(function*(){var e,t,n=yield null===(e=I.current)||void 0===e?void 0:e.submit();O((0,h._)({},z,n)),J({connectorId:null!==(t=null==R?void 0:R.id)&&void 0!==t?t:"",assignFormValue:(0,h._)({},z,n)})}),function(){return t.apply(this,arguments)});var{modal:ea,open:es,close:el}=(0,l.q0)({type:"action-small",footer:(null==R?void 0:R.bind_id)?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.y3,{theme:"light",type:"tertiary",onClick:()=>{el(),ee(0)},children:a.o.t("Cancel")}),(0,o.jsx)(l.y3,{theme:"solid",type:"danger",onClick:er,children:a.o.t("bot_publish_disconnect",{platform:null!==(s=null==R?void 0:R.name)&&void 0!==s?s:""})})]}):(0,o.jsxs)(o.Fragment,{children:[(null==Y?void 0:Y.length)&&0!==$&&(null===(n=Y[$])||void 0===n?void 0:n.api_action)!==g.NotQuery?(0,o.jsx)(l.y3,{theme:"solid",onClick:()=>{A(void 0),ee($-1)},children:a.o.t("Previous_1")}):null,(0,o.jsx)(l.y3,{theme:"solid",onClick:ei,disabled:N,loading:G,children:$===(null!==(d=null==Y?void 0:Y.length)&&void 0!==d?d:0)-1?(null===(r=Y[$])||void 0===r?void 0:r.api_action)!==g.NotQuery?a.o.t("Save"):a.o.t("Complete"):a.o.t("Next_1")})]}),onCancel:F,title:null==V?void 0:V.title_text}),ec=(e,t)=>(0,o.jsxs)(o.Fragment,{children:[e?(0,o.jsx)(B,{copyLinkAreaInfo:e,agentType:j,botId:C,initValue:(0,h._)({},null==R?void 0:R.bind_info,z)}):null,t?(0,o.jsx)(et,{schemaAreaInfo:t,initValue:(0,h._)({},null==R?void 0:R.bind_info,z),ref:I,getFormDisable:e=>L(e),isReadOnly:!!(null==R?void 0:R.bind_id),setErrorMessage:A}):null,D?(0,o.jsx)(eo,{errorMessage:D}):null]});return{node:ea((0,o.jsxs)(l.yC,{wrapperClassName:_.Z["config-area"],spinning:Z,children:[(0,o.jsx)(U,{connectorConfigInfo:V}),(null==Y?void 0:Y.length)&&!(null==R?void 0:R.bind_id)?(0,o.jsx)("div",{children:ec(null===(S=Y[$])||void 0===S?void 0:S.copy_link_area,null===(k=Y[$])||void 0===k?void 0:k.schema_area)}):null,(null==R?void 0:R.bind_id)&&(null==Y?void 0:Y.length)?(0,o.jsx)(o.Fragment,{children:null==Y?void 0:Y.map((e,t)=>(0,o.jsx)("div",{children:ec(e.copy_link_area,e.schema_area)},t))}):null,en]})),open:e=>{M(e),es()},close:el}},es=n("561641"),el=e=>{var{setDataSource:t,setSelectedPlatforms:n,record:r,bindSuccessCallback:u,unbindCallback:h,origin:p="bot",originId:f}=e,{bot_id:m="",project_id:v=""}=(0,d.useParams)(),{node:g,open:b}=ea({botId:null!=f?f:"bot"===p?m:v,origin:p,onSuccess:e=>{if(u){u(e);return}null==t||t(t=>{var n,r=t.find(t=>t.id===(null==e?void 0:e.id));if(r){if(r.id===es.zW&&!(null==e?void 0:e.bind_id))return t.filter(e=>e.id!==es.zW);r.bind_id=null==e?void 0:e.bind_id,r.bind_info=null!==(n=null==e?void 0:e.bind_info)&&void 0!==n?n:{},r.config_status=(null==e?void 0:e.bind_id)?c._6.Configured:c._6.NotConfigured}return[...t]}),!(null==e?void 0:e.bind_id)&&(null==n||n(t=>t.filter(t=>t!==(null==e?void 0:e.id))))},onUnbind:h}),y=()=>b({initValue:r}),_=a.o.t("bot_publish_action_configure");return(0,o.jsxs)(o.Fragment,{children:["project"===p?(0,o.jsx)(s.zx,{onClick:y,size:"small",color:"primary",children:_}):(0,o.jsx)(l.y3,{onClick:y,theme:"borderless",children:_}),g]})},ec=n("707107"),ed=n("44172"),eu=n("988179"),eh=n("391962"),ep=n("458620"),ef=n("189284"),em=n("486613"),ev=n("714393"),eg=n("493278"),eb=(0,ep.z)({eventName:ep.b.getBotDiffError}),ey=()=>{var e,t,[n,r]=(0,f.useState)(),s=(0,d.useParams)(),[c]=(0,ef.V)(),h=!!(null==c?void 0:c["bot.devops.merge_prompt_diff"]);var{data:p,loading:v,run:g,mutate:y,error:w}=(0,m.Z)((e=(0,u._)(function*(e){var{bot_id:t="",space_id:n="",commit_version:r}=s;return(yield b.bV.BotDiff({space_id:n,bot_id:t,left:{branch:em.I0.Publish,connector_id:e.id},template_key:h?"diff_template_when_publish_v2":"",right:{branch:em.I0.Base,version_id:r}})).data}),function(t){return e.apply(this,arguments)}),{manual:!0,onBefore:()=>{eb.start()},onSuccess:e=>{eb.success()},onError:e=>{eb.error({reason:"get publish diff error",error:e})}}),x=()=>{y({origin_bot_dl:"",diff_display_node:[]}),C()},{modal:S,open:k,close:C}=(0,l.q0)({type:"info",okText:a.o.t("devops_publish_multibranch_done"),okType:"tertiary",okButtonProps:{className:"semi-button-light"},hasCancel:!1,className:_.Z["diff-modal"],onCancel:x,onOk:x,title:a.o.t("devops_publish_multibranch_diffwithin",{connectorName:null!==(t=null==n?void 0:n.name)&&void 0!==t?t:""})});return{node:S((0,o.jsx)("div",{className:_.Z["diff-modal-container"],children:v?(0,o.jsx)(l.yC,{}):h?(0,o.jsx)(ev.LH,{diffData:(null==p?void 0:p.diff_display_node)||[],hasError:void 0!==w,type:"publish"}):(0,o.jsx)(eg.T,{diffData:(null==p?void 0:p.diff_display_node)||[],hasError:void 0!==w})})),open:e=>{r(e),g(e),k()},close:C}},e_=e=>{var{record:t,isMouseIn:n}=e,{open:r,node:s}=ey(),c=(0,eh.R)(e=>e.isCollaboration),d=e=>{(0,eu.iN)(ec.Kg.bot_publish_difference,{platform_type:e.name}),r(e)};return(0,o.jsxs)(o.Fragment,{children:[n&&c?(0,o.jsx)(l.u,{content:a.o.t("devops_publish_multibranch_viewdiff"),children:(0,o.jsx)(l._3,{onClick:()=>{d(t)},icon:(0,o.jsx)(ed.k8G,{color:"#4D53E8"})})}):null,s]})}},150500:function(e,t,n){"use strict";n.d(t,{OF:function(){return g},Tn:function(){return b},To:function(){return v},ci:function(){return y}});var r,o=n(825955),a=n(808549),s=n(788637),l=n(735114),c=n(947578),d=n(297158),u=n(336205),h=n(727914),p=n(382534),f=n(39663),m=n(659596),v=e=>{var{id:t,onRevokeSuccess:n,onRevokeFinally:r}=e,{loading:a,runAsync:s}=(0,l.Z)((0,o._)(function*(){return yield p.nA.CancelUserAuth({connector_id:t})}),{manual:!0,onSuccess:()=>{null==n||n(t)},onFinally:()=>{null==r||r()}});return{revokeLoading:a,runRevoke:s}};var g=(r=(0,o._)(function*(e){var t,n,{id:r,authInfo:o,origin:s}=e,l=yield p.nA.GetConnectorAuthState({connector_id:r}),c=null!==(n=null==l?void 0:null===(t=l.data)||void 0===t?void 0:t.state)&&void 0!==n?n:{};(0,f.HL)({navigatePath:location.pathname,type:"oauth",extra:(0,a._)({origin:s},c)},r,o)}),function(e){return r.apply(this,arguments)}),b=e=>!(0,s.Z)(e)&&!!(null==e?void 0:e.authorize_url),y=()=>{d.kg.error({message:"connection_missing_oauth_info",error:new h.sH("normal_error","Connection missing oauth information")}),m.FN.error({content:(0,c.u)(u.o.t("error"))})}},561641:function(e,t,n){"use strict";n.d(t,{EK:function(){return d},dj:function(){return h},pX:function(){return s},vh:function(){return u},zW:function(){return c},zs:function(){return l}});var r=n(808549),o=n(120454);n(336205),n(775699);var a=n(178385);n(298203),n(150500);var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return null==e||e.forEach(e=>{e.level=t,n.push(e),e.sub_nodes&&n.push(...s(e.sub_nodes,t+1))}),n},l=()=>{var e=document.body.style,t=document.getElementsByTagName("html")[0].style;e.minHeight="600px",t.minHeight="600px",e.minWidth="1680px",t.minWidth="1680px"},c="10000114",d="10000122",u=(e,t)=>(null==t?void 0:t.length)?t.map(t=>{var n,s,l,c,d,u,h,p=null!==(l=null==e?void 0:e[t.id])&&void 0!==l?l:{};return(0,o._)((0,r._)({},t),{publish_status:null!==(c=p.publish_result_status)&&void 0!==c?c:a.an.Failed,fail_text:null!==(d=p.msg)&&void 0!==d?d:"",share_link:null!==(u=null===(n=p.connector)||void 0===n?void 0:n.share_link)&&void 0!==u?u:"",bind_info:null!==(h=null===(s=p.connector)||void 0===s?void 0:s.bind_info)&&void 0!==h?h:t.bind_info})}):[],h=e=>{try{return JSON.parse(e)}catch(e){return""}}},486613:function(e,t,n){"use strict";n.d(t,{I0:function(){return d},Ll:function(){return m},Xb:function(){return p},_g:function(){return f},jY:function(){return h},sv:function(){return u}});var r,o,a,s,l,c,d=((r={})[r.Undefined=0]="Undefined",r[r.PersonalDraft=1]="PersonalDraft",r[r.Base=2]="Base",r[r.Publish=3]="Publish",r);var u=((o={})[o.Unknown=0]="Unknown",o[o.Add=1]="Add",o[o.Delete=2]="Delete",o[o.Modify=3]="Modify",o[o.Remove=4]="Remove",o[o.Remain=5]="Remain",o);var h=((a={})[a.Default=0]="Default",a[a.TextDetail=1]="TextDetail",a);var p=((s={})[s.Online=1]="Online",s[s.Submit=2]="Submit",s[s.Draft=3]="Draft",s);var f=((l={})[l.Bot=1]="Bot",l[l.Workflow=2]="Workflow",l);var m=((c={})[c.AgentFlow=1]="AgentFlow",c[c.Agent=2]="Agent",c[c.Workflow=3]="Workflow",c)},407694:function(e,t,n){"use strict";n.d(t,{Cg:()=>u,X9:()=>d,zu:()=>h});var r=n("151064"),o=n("455069"),a=n("716894"),s=n("992499"),l=e=>(0,a.F)(t=>({spaceId:e.spaceId,projectId:e.projectId,version:e.version,patch:e=>t(()=>e)}),s.X),c=(0,o.createContext)(null),d=e=>{var{spaceId:t,projectId:n,version:a,children:s}=e,d=(0,o.useMemo)(()=>l({spaceId:t,projectId:n,version:a}),[t,n,a]);return(0,r.jsx)(c.Provider,{value:d,children:s})},u=()=>(0,o.useContext)(c),h=e=>{var t=u();if(!t)throw Error("cant not found IDEGlobalContext");return t(e)}},66860:function(e,t,n){"use strict";let r;n.d(t,{dg:()=>ex,nU:()=>ec,S4:()=>eI,OC:()=>ef,Vx:()=>T,lW:()=>y,LC:()=>b,ai:()=>v.ai,Un:()=>x,j2:()=>eT,rA:()=>eE,X5:()=>ej});var o,a,s=n("808549"),l=n("473980"),c=n("151064"),d=n("455069"),u=n("149528"),h=n("825955"),p=n("120454"),f=n("479910"),m=n("598208"),v=n("909776"),g=n("382534");var b=((o={}).Workflow="workflow",o.Plugin="plugin",o.Knowledge="knowledge",o.Database="database",o.Variable="variables",o);var y=((a={}).CreateResource="resource-folder-create-resource",a.CreateFolder="resource-folder-create-folder",a.Rename="resource-folder-rename",a.Delete="resource-folder-delete",a.DuplicateResource="resource-folder-duplicate-resource",a.ImportLibraryResource="resource-folder-import-library-resource",a.MoveToLibrary="resource-folder-move-to-library",a.CopyToLibrary="resource-folder-copy-to-library",a.EnableKnowledge="resource-folder-enable-knowledge",a.DisableKnowledge="resource-folder-disable-knowledge",a.SwitchToChatflow="resource-folder-switch-to-chatflow",a.SwitchToWorkflow="resource-folder-switch-to-workflow",a.UpdateDesc="resource-folder-update-desc",a),_=e=>{if(!!e)switch(e){case v.b0.Imageflow:case v.b0.Workflow:return b.Workflow;case v.b0.Knowledge:return b.Knowledge;case v.b0.Plugin:return b.Plugin;case v.b0.Variable:return b.Variable;case v.b0.Database:return b.Database;default:return b.Workflow}},w={resourceTree:[],canClosePopover:!0,groupExpandMap:{[v.ai.Workflow]:!0,[v.ai.Plugin]:!0,[v.ai.Data]:!0}},x=(0,m.Ue)()((0,f.mW)((e,t)=>{var n,r;return(0,p._)((0,s._)({},w),{updateGroupExpand:(n,r)=>{e({groupExpandMap:(0,p._)((0,s._)({},t().groupExpandMap),{[n]:r})})},setSelectedResource:t=>{e({selectedResource:t})},fetchResource:(n=(0,h._)(function*(t,n,r,o){e({isFetching:!0,spaceId:t,projectId:n,version:r});var a,l=null===(a=(yield g.Js.ProjectResourceList({project_id:null!=n?n:"",space_id:t,project_version:r})).resource_groups)||void 0===a?void 0:a.map(e=>{var t;return{groupType:e.group_type,resourceList:(null===(t=e.resource_list)||void 0===t?void 0:t.map(e=>{var t,n;return(0,s._)({id:String(null!==(t=e.res_id)&&void 0!==t?t:""),type:_(e.res_type),name:null!==(n=e.name)&&void 0!==n?n:""},e)}))||[]}});null==o||o(l),e({resourceTree:l,isFetching:!1,initLoaded:!0})}),function(e,t,r,o){return n.apply(this,arguments)}),refetch:(r=(0,h._)(function*(e){var{spaceId:n,projectId:r,version:o}=t();if(!!n&&!!r)return yield new Promise(e=>setTimeout(()=>e(),700)),t().fetchResource(n,r,o,e)}),function(e){return r.apply(this,arguments)}),setCanClosePopover:t=>{e({canClosePopover:t})}})},{name:"projectIDE.primarySidebar",enabled:!1})),S=n("336205"),k=n("873183"),C=n("659596"),j=(0,c.jsx)("i",{style:{fontSize:14},className:"codicon codicon-folder"}),E=(0,c.jsx)("i",{style:{fontSize:14},className:"codicon codicon-folder-opened"}),T="variables",I={[b.Workflow]:(0,c.jsx)(k.eTH,{}),[b.Plugin]:(0,c.jsx)(k.QWX,{}),[b.Knowledge]:(0,c.jsx)(k.da8,{}),[b.Variable]:(0,c.jsx)(k.pFl,{})},P={[v.ai.Workflow]:S.o.t("library_resource_type_workflow"),[v.ai.Plugin]:S.o.t("library_resource_type_plugin"),[v.ai.Data]:S.o.t("dataide001")},M={[u.H0.Folder]:S.o.t("project_resource_sidebar_create_new_folder"),[v.ai.Workflow]:S.o.t("project_resource_sidebar_create_new_resource",{resource:S.o.t("library_resource_type_workflow")}),[v.ai.Plugin]:S.o.t("project_resource_sidebar_create_new_resource",{resource:S.o.t("library_resource_type_plugin")}),[v.ai.Data]:S.o.t("project_resource_sidebar_create_new_resource",{resource:S.o.t("project_resource_sidebar_data_section")})},R={[v.ai.Workflow]:(0,c.jsx)(k.eTH,{}),[v.ai.Plugin]:(0,c.jsx)(k.QWX,{}),[v.ai.Data]:(0,c.jsx)(k.da8,{})},D={[v.Lk.Rename]:y.Rename,[v.Lk.Copy]:y.DuplicateResource,[v.Lk.Delete]:y.Delete,[v.Lk.CopyToLibrary]:y.CopyToLibrary,[v.Lk.MoveToLibrary]:y.MoveToLibrary,[v.Lk.Enable]:y.EnableKnowledge,[v.Lk.Disable]:y.DisableKnowledge,[v.Lk.SwitchToChatflow]:y.SwitchToChatflow,[v.Lk.SwitchToFuncflow]:y.SwitchToWorkflow,[v.Lk.UpdateDesc]:y.UpdateDesc},A=n("407821"),N=n.n(A),L=n("472772"),z=n.n(L),O=n("395245"),B=n.n(O),W=n("297998"),F=n.n(W),H=n("646576"),U=n.n(H),V=n("606121"),K=n.n(V),q=n("802086"),Z={};Z.styleTagTransform=K(),Z.setAttributes=F(),Z.insert=B().bind(null,"head"),Z.domAPI=z(),Z.insertStyleElement=U(),N()(q.Z,Z);var Y=q.Z&&q.Z.locals?q.Z.locals:void 0,X={[v.ai.Workflow]:"workflow",[v.ai.Plugin]:"plugin",[v.ai.Data]:"data"},Q=e=>{var{groupType:t,onActionVisibleChange:n,onCreateResource:r,onImportResource:o,createResourceConfig:a}=e,s=(0,u.RX)(u.L),l=(0,d.useMemo)(()=>{var e=s.getShortcutByCommandId(y.CreateResource);return(null==e?void 0:e.map(e=>e.join(" ")).join(" / "))||""},[s]),h=Array.isArray(a)?a.map(e=>{var{icon:n,label:o,tooltip:a,subType:s}=e,l=(0,c.jsx)(C.v2.Item,{"data-testid":"project-ide.resource-group.actions.menu-item.".concat(s),onClick:(e,n)=>{n.stopPropagation(),null==r||r(t,s)},icon:n,children:o});return a?(0,c.jsx)(C.u,{trigger:"hover",position:"rightTop",showArrow:!1,content:a,style:{width:208,padding:4,borderRadius:"var(--coze-8)"},children:l},s):l}):(0,c.jsx)(C.v2.Item,{suffix:(0,c.jsx)("span",{className:Y.shortcut,children:l}),onClick:(e,n)=>{n.stopPropagation(),null==r||r(t)},icon:R[t],children:M[t]}),p=(0,d.useMemo)(()=>198,[]);return(0,c.jsx)(C.v2,{trigger:"hover",position:"bottomLeft",onVisibleChange:e=>null==n?void 0:n(e),render:(0,c.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,c.jsxs)(C.v2.SubMenu,{className:"w-[198px]",mode:"menu",style:{width:p},children:[null,h,(0,c.jsx)(C.v2.Item,{onClick:(e,n)=>{n.stopPropagation(),null==o||o(t)},icon:(0,c.jsx)(k.Zgk,{}),children:S.o.t("project_resource_sidebar_import_from_library")})]})}),children:(0,c.jsx)(C.hU,{"data-testid":"project-".concat(X[t],"-add-resource"),color:"secondary",size:"small",icon:(0,c.jsx)(k.PwN,{className:"coz-fg-primary"}),onClick:e=>e.stopPropagation()})})},G=n("252237"),J=n.n(G),$=e=>{var{expand:t}=e;return(0,c.jsx)(k.wMM,{className:"text-[10px] coz-fg-secondary transition-transform",style:t?{transform:"rotate(90deg)"}:void 0})},ee=n("864539"),et={};et.styleTagTransform=K(),et.setAttributes=F(),et.insert=B().bind(null,"head"),et.domAPI=z(),et.insertStyleElement=U(),N()(ee.Z,et);var en=ee.Z&&ee.Z.locals?ee.Z.locals:void 0,er=e=>{var{title:t,actions:n,content:r,expand:o,onExpandChange:a,className:s}=e;return(0,c.jsxs)("div",{className:J()(s,en["resource-group"]),children:[(0,c.jsxs)("div",{className:en["resource-group-header"],onClick:()=>null==a?void 0:a(!o),children:[(0,c.jsxs)("div",{className:en["header-left"],children:[(0,c.jsx)($,{expand:o}),(0,c.jsx)("span",{className:en["header-title"],children:t})]}),n?(0,c.jsx)("div",{className:en["action-group"],children:n}):null]}),(0,c.jsx)("div",{className:en["resource-group-content"],style:o?void 0:{display:"none"},children:r})]})},ei=n("130001"),eo=n("771531"),ea=n("435946"),es=n("450562"),el=e=>{var{label:t}=e;return t?t.length>es.hhB?S.o.t("project_resource_sidebar_warning_length_exceeds"):es.Pz_.test(t)?"":S.o.t("workflow_list_create_modal_name_rule_reg"):S.o.t("project_resource_sidebar_warning_empty_key")},ec=e=>{var{label:t,parentPath:n,id:r,resourceTree:o}=e,a=[],s=e=>{if(a.push(e.id),a.join("/")===n.join("/")){var o;return null===(o=e.children)||void 0===o?void 0:o.some(e=>!(r===e.id&&"-1"!==r)&&e.name===t)}for(var l of e.children||[])if(s(l))return!0;a.pop()};return s(o)?S.o.t("project_resource_sidebar_warning_label_exists",{label:t}):""},ed=(e,t)=>{var n;if(e.type===u.H0.Folder)n=t?E:j;else n=I[e.type]||"";return n},eu=(e,t)=>{var n,r;return(null===(r=e.actions)||void 0===r?void 0:null===(n=r.find(e=>e.key===t))||void 0===n?void 0:n.enable)||!1},eh=(e,t)=>{var n="";switch(null==t?void 0:t.type){case b.Workflow:n="library_resource_type_workflow";break;case b.Plugin:n="library_resource_type_plugin";break;case b.Knowledge:n="library_resource_type_knowledge";break;case b.Database:n="db_table_entry"}switch(e){case y.Rename:return S.o.t("workflow_detail_node_rename");case y.DuplicateResource:return S.o.t("workflow_add_list_copy");case y.Delete:return(null==t?void 0:t.type)===u.H0.Folder?S.o.t("filebox_0042"):S.o.t("project_resource_sidebar_delete");case y.CopyToLibrary:return S.o.t("project_resource_sidebar_copy_to_library");case y.MoveToLibrary:return S.o.t("project_resource_sidebar_move_to_library");case y.EnableKnowledge:return S.o.t("project_resource_sidebar_enable_resource",{resource:S.o.t(n)});case y.DisableKnowledge:return S.o.t("project_resource_sidebar_disable_resource",{resource:S.o.t(n)});case y.ImportLibraryResource:return S.o.t("project_resource_sidebar_import_from_library",{},"");case y.UpdateDesc:return S.o.t("project_241115",{},"修改描述");case y.SwitchToChatflow:return S.o.t("wf_chatflow_121",{flowMode:S.o.t("wf_chatflow_76")});case y.SwitchToWorkflow:return S.o.t("wf_chatflow_121",{flowMode:S.o.t("Workflow")});default:return""}},ep=e=>![y.CreateResource,y.CreateFolder,y.Rename,y.Delete,y.DuplicateResource].includes(e);class ef{isResourceActionEnabled(e){var t;return Object.values((null===(t=this.resourceFolderDispatch)||void 0===t?void 0:t.tempSelectedMap)||{}).every(t=>eu(t,e))}renameResource(e){if(e){this.onRenameResourceEmitter.fire({id:e});return}if(this.isResourceActionEnabled(v.Lk.Rename)){var t,n;null===(n=this.resourceFolderDispatch)||void 0===n||null===(t=n.onEnter)||void 0===t||t.call(n)}}deleteResource(){if(this.isResourceActionEnabled(v.Lk.Delete)){var e,t;null===(t=this.resourceFolderDispatch)||void 0===t||null===(e=t.onDelete)||void 0===e||e.call(t)}}duplicateResource(){this.isResourceActionEnabled(v.Lk.Copy)&&this.onDuplicateEmitter.fire({id:this.resourceFolderDispatch.id,tempSelectedMap:this.resourceFolderDispatch.tempSelectedMap})}get resourceFolderDispatch(){return this.contextKey.getContext(u.sJ)}createResource(){this.onCreateResourceEmitter.fire({id:this.resourceFolderDispatch.id})}constructor(){this.onDuplicateEmitter=new u.Q5,this.onCreateResourceEmitter=new u.Q5,this.onDuplicateEvent=this.onDuplicateEmitter.event,this.onCreateResourceEvent=this.onCreateResourceEmitter.event,this.onRenameResourceEmitter=new u.Q5,this.onRenameResource=this.onRenameResourceEmitter.event}}(0,ei.gn)([(0,eo.f)(u.aY),(0,ei.w6)("design:type",void 0===u.aY?Object:u.aY)],ef.prototype,"contextKey",void 0),ef=(0,ei.gn)([(0,ea.b)()],ef);var em=e=>{var{onDelete:t}=e,n=(0,u.XO)(),[r,o]=(0,d.useState)([]),[a,s]=(0,d.useState)(!1),l=()=>s(!0),p=()=>{o([]),s(!1)},f=(0,d.useMemo)(()=>{if(!r.length)return(0,c.jsx)(c.Fragment,{});var e="";return e=r.length>1?S.o.t("project_resource_sidebar_confirm_batch_delete",{count:r.length}):S.o.t("project_resource_sidebar_confirm_delete",{resourceName:r[0].name}),(0,c.jsxs)("div",{className:"break-all",children:[(0,c.jsx)("span",{className:"coz-fg-secondary",children:e}),r.length>1?(0,c.jsx)("div",{className:Y["file-list-wrapper"],children:(0,c.jsx)("div",{className:Y["file-list"],children:r.map(e=>(0,c.jsxs)("span",{className:Y["file-item"],children:[(0,c.jsx)("span",{className:J()(Y["file-icon"]),children:ed(e)}),(0,c.jsx)("span",{className:Y["file-name"],children:e.name})]}))})}):null]})},[r]),m=(0,c.jsx)(C.u_,{type:"dialog",okButtonColor:"red",title:(0,c.jsx)("span",{className:"text-[16px] font-medium coz-fg-plus",children:S.o.t("project_resource_sidebar_delete")}),visible:a,okText:S.o.t("Delete"),cancelText:S.o.t("Cancel"),autoLoading:!0,onOk:(0,h._)(function*(){yield null==t?void 0:t(r),r.map(e=>e.type?(0,u.Ym)(e.type,e.id):null).filter(e=>!!e).forEach(e=>n.view.closeWidgetByUri(e)),p()}),onCancel:()=>p(),children:f});return{node:m,handleDeleteResource:e=>{console.log("[ResourceFolder]on delete resource>>>",e);var t=e.filter(e=>e.id!==T);if(!!t.length)o(t),l()}}},ev=n("189284"),eg=e=>{var{type:t}=e,n=(0,d.useMemo)(()=>{switch(t){case v.ai.Workflow:return S.o.t("project_resource_sidebar_resource_not_added",{resource:S.o.t("library_resource_type_workflow")});case v.ai.Plugin:return S.o.t("project_resource_sidebar_resource_not_added",{resource:S.o.t("library_resource_type_plugin")});case v.ai.Data:return S.o.t("project_resource_sidebar_resource_not_added",{resource:S.o.t("project_resource_sidebar_data_section")});default:return""}},[t]);return(0,c.jsxs)("div",{className:Y.empty,children:[(0,c.jsxs)("div",{className:Y["empty-card"],children:[(0,c.jsx)("div",{className:Y["empty-icon"]}),(0,c.jsxs)("div",{className:Y["empty-skeleton"],children:[(0,c.jsx)("span",{}),(0,c.jsx)("span",{})]})]}),(0,c.jsx)("div",{className:Y["empty-title"],children:n})]})},eb=e=>{var{groupType:t,iconRender:n,onAction:r,onCreateSubTypeResource:o,createResourceConfig:a,validateConfig:l,hideMoreBtn:h}=e,p=(0,d.useCallback)(e=>{var{resource:t,isSelected:n}=e;return(0,c.jsx)("span",{className:J()("text-[14px]",n?"font-medium":""),children:t.name})},[]),[f]=(0,ev.V)(),m=(0,d.useCallback)(e=>{if(!e.length||h)return[];if(1===e.length){var n,s,l,c,d=e[0];if(d.id===T)return[];if(d.id===u.dz){var p=a?a.map(e=>{var{label:n,subType:r}=e;return{id:"".concat(y.CreateResource,"-").concat(r),execute:()=>null==o?void 0:o(t,r),label:n}}):[{id:y.CreateResource,label:M[t]}];return[null,...p,{id:y.ImportLibraryResource,label:eh(y.ImportLibraryResource),execute:()=>null==r?void 0:r(y.ImportLibraryResource)}].filter(Boolean)}var f=e=>{var{key:t,enable:n,hint:o}=e,a=D[t];return a?{id:a,disabled:!n,tooltip:S.o.t(o||"",{},o),label:eh(a,d),execute:ep(a)?()=>null==r?void 0:r(a,d):void 0}:null},m=null===(n=d.actions)||void 0===n?void 0:n.filter(e=>e.key!==v.Lk.Delete),g=null===(s=d.actions)||void 0===s?void 0:s.filter(e=>e.key===v.Lk.Delete),b=(null==m?void 0:null===(l=m.map(f))||void 0===l?void 0:l.filter(e=>!!e))||[],_=(null==g?void 0:null===(c=g.map(f))||void 0===c?void 0:c.filter(e=>!!e))||[];return(null==b?void 0:b.length)&&(null==_?void 0:_.length)?[...b,{type:"separator"},..._]:[...b,..._]}return e.every(e=>eu(e,v.Lk.Delete))?[{id:y.Delete,label:eh(y.Delete)}]:[]},[a,t,r,o,f,h]),g=x(e=>e.setCanClosePopover);return{textRender:p,iconRender:(0,d.useCallback)(e=>{var{resource:t,isExpand:r}=e,o=(null==n?void 0:n(e))||ed(t,r);return(0,c.jsx)("span",{className:"inline-flex coz-fg-secondary text-[14px]",children:o})},[n]),useOptimismUI:{loadingRender:()=>(0,c.jsx)(C.gb,{className:"relative mr-1 top-0.5",loading:!0,size:"mini"})},contextMenuHandler:m,validateConfig:(0,d.useMemo)(()=>(0,s._)({customValidator:e=>el(e)||ec(e),errorMsgRender:e=>(0,c.jsx)(C.u,{theme:"dark",position:"right",content:e,children:(0,c.jsx)(k.wR2,{className:"coz-fg-hglt-red absolute right-1 text-[13px]"})})},l),[l]),config:(0,d.useMemo)(()=>({itemHeight:28,maxDeep:6,tabSize:14,input:{placeholder:S.o.t("project_resource_sidebar_please_enter"),style:{borderRadius:"var(--coze-4)"}},resourceUriHandler:e=>e.type?(0,u.Ym)(e.type,e.id):null}),[]),renderMoreSuffix:(0,d.useMemo)(()=>!h&&{style:{borderRadius:"var(--coze-4)"},render:e=>{var{baseBtn:t,resource:n}=e;return n.type===b.Variable||0===(n.actions||[]).length?(0,c.jsx)(c.Fragment,{}):t}},[h]),empty:(0,c.jsx)(eg,{type:t}),powerBlackMap:{dragAndDrop:!1,folder:!0},onContextMenuVisibleChange:e=>g(!e)}},ey=n("157728"),e_=n("664319"),ew=()=>{var{selectedResource:e,setSelectedResource:t}=x((0,e_.N)(e=>({selectedResource:e.selectedResource,setSelectedResource:e.setSelectedResource}))),n=(0,ey.useLocation)(),r=(0,u.d0)();return(0,d.useEffect)(()=>{if(n){var{resourceType:e,resourceId:r}=(0,u.hU)(n.pathname);e===b.Variable?t(e):t(r)}},[n]),{selectedResource:e,handleOpenResource:(e,t)=>{if(t.type!==u.H0.Folder){if(t.type===b.Variable){r("/".concat(t.type));return}r("/".concat(t.type,"/").concat(e))}}}};var ex=(r=e=>{var{groupType:t,resourceTree:n,onDelete:r,onAction:o,onCreate:a,onCustomCreate:h,canCreate:p,iconRender:f,initLoaded:m,createResourceConfig:v,defaultResourceType:g,validateConfig:b,hideMoreBtn:_}=e,w=(0,l._)(e,["groupType","resourceTree","onDelete","onAction","onCreate","onCustomCreate","canCreate","iconRender","initLoaded","createResourceConfig","defaultResourceType","validateConfig","hideMoreBtn"]),S=(0,d.useMemo)(()=>(0,u.Ir)(n),[n]),k=(0,d.useRef)(),C=x(e=>e.groupExpandMap),j=x(e=>e.updateGroupExpand),E=e=>{var n;null===(n=k.current)||void 0===n||n.focus(),null==j||j(t,e)},T=(0,u.RX)(ef);(0,d.useEffect)(()=>{var e=T.onDuplicateEvent(e=>{if(e.id!==w.id)return;var t=Object.values(e.tempSelectedMap||{}).filter(e=>e.type!==u.H0.Folder);if(!!(null==t?void 0:t.length))1===t.length&&(null==o||o(y.DuplicateResource,t[0]))}),n=T.onCreateResourceEvent(e=>{if(!!p&&e.id===w.id&&!v)M(t)});return()=>{e.dispose(),n.dispose()}},[g,t,h,o,T,p,v]),(0,d.useEffect)(()=>{var e=T.onRenameResource(e=>{var t;null===(t=k.current)||void 0===t||t.renameResource(e.id)});return()=>{e.dispose()}},[T]);var I=(0,d.useRef)(),M=(e,t)=>{var n,r;if(!!p)E(!0),e===u.H0.Folder?null===(n=k.current)||void 0===n||n.createFolder():h?h(e,t):g?(I.current=t,null===(r=k.current)||void 0===r||r.createResource(g)):console.error("[ResourceFolderCoze]must specify defaultResourceType when use props onCreate creating resource")},{handleDeleteResource:R,node:D}=em({onDelete:r}),A=eb({groupType:t,iconRender:f,onAction:o,createResourceConfig:v,validateConfig:b,onCreateSubTypeResource:M,hideMoreBtn:_}),{selectedResource:N,handleOpenResource:L}=ew();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(er,{className:Y["resource-folder-coze"],title:P[t],content:m?(0,c.jsx)(u.El,(0,s._)({ref:k,resourceTree:n,resourceMap:S,onDelete:R,onCreate:e=>null==a?void 0:a(e,I.current),selected:N,onSelected:L,defaultResourceType:g},A,w)):null,expand:C[t],onExpandChange:E,actions:p?(0,c.jsx)(Q,{createResourceConfig:v,groupType:t,onCreateResource:M,onImportResource:e=>{if(!!p)E(!0),null==o||o(y.ImportLibraryResource)},onActionVisibleChange:e=>{if(e){var t,n;null===(t=k.current)||void 0===t||t.focus(),null===(n=k.current)||void 0===n||n.closeContextMenu()}}}):null}),D]})},e=>{var t,{onChangeName:n}=e,o=(0,l._)(e,["onChangeName"]),{view:a}=(0,u.XO)();var d=(t=(0,h._)(function*(e){var t,r;if(yield null==n?void 0:n(e),(null===(t=e.resource)||void 0===t?void 0:t.type)&&(null===(r=e.resource)||void 0===r?void 0:r.id)&&e.resource.type!==u.H0.Folder){var o,s=(0,u.Ym)(e.resource.type,e.resource.id),l=a.getWidgetContextFromURI(s);null==l||null===(o=l.widget)||void 0===o||o.setTitle(e.name)}}),function(e){return t.apply(this,arguments)});return(0,c.jsx)(r,(0,p._)((0,s._)({},o),{onChangeName:d}))}),eS=n("259674"),ek="resourceFolder";class eC{init(){this.contextKey.setContext(u.sJ,void 0)}registerShortcuts(e){e.registerHandlers({commandId:y.Rename,keybinding:"enter",preventDefault:!1,source:ek,when:u.sJ}),e.registerHandlers({commandId:y.Delete,keybinding:"meta backspace",preventDefault:!1,source:ek,when:u.sJ}),e.registerHandlers({commandId:y.CreateFolder,keybinding:"alt shift n",preventDefault:!1,source:ek,when:u.sJ}),e.registerHandlers({commandId:y.CreateResource,keybinding:"alt n",preventDefault:!1,source:ek,when:u.sJ}),e.registerHandlers({commandId:y.DuplicateResource,keybinding:"alt d",preventDefault:!1,source:ek,when:u.sJ})}registerCommands(e){e.registerCommand({id:y.Rename,label:S.o.t("project_resource_sidebar_rename")},{execute:()=>this.shortcutService.renameResource(),isEnabled:e=>!(null==e?void 0:e.disabled),isVisible:e=>!(null==e?void 0:e.isHidden)}),e.registerCommand({id:y.Delete},{execute:()=>this.shortcutService.deleteResource(),isEnabled:e=>!(null==e?void 0:e.disabled),isVisible:e=>!(null==e?void 0:e.isHidden)}),e.registerCommand({id:y.CreateFolder,label:S.o.t("project_resource_sidebar_create_new_folder")},{execute:()=>{var e,t=this.contextKey.getContext(u.sJ);null==t||null===(e=t.onCreateFolder)||void 0===e||e.call(t)},isEnabled:e=>!1,isVisible:e=>!(null==e?void 0:e.isHidden)}),e.registerCommand({id:y.CreateResource,label:"Create Resource",shortLabel:"Create Resource"},{execute:()=>this.shortcutService.createResource(),isEnabled:e=>!(null==e?void 0:e.disabled),isVisible:e=>!(null==e?void 0:e.isHidden)}),e.registerCommand({id:y.DuplicateResource,label:S.o.t("project_resource_sidebar_copy")},{execute:()=>this.shortcutService.duplicateResource(),isEnabled:e=>!(null==e?void 0:e.disabled),isVisible:e=>!(null==e?void 0:e.isHidden)})}}(0,ei.gn)([(0,eo.f)(ef),(0,ei.w6)("design:type",void 0===ef?Object:ef)],eC.prototype,"shortcutService",void 0),(0,ei.gn)([(0,eo.f)(u.aY),(0,ei.w6)("design:type",void 0===u.aY?Object:u.aY)],eC.prototype,"contextKey",void 0),(0,ei.gn)([(0,eS.z)(),(0,ei.w6)("design:type",Function),(0,ei.w6)("design:paramtypes",[]),(0,ei.w6)("design:returntype",void 0)],eC.prototype,"init",null),eC=(0,ei.gn)([(0,ea.b)()],eC);var ej=(0,u.M1)({onBind(e){var{bind:t}=e;t(ef).toSelf().inSingletonScope(),(0,u.KV)(t,eC,[u.pY,u.vY])}}),eE=()=>{var e=x(e=>e.resourceTree),t=x(e=>e.isFetching),n=x(e=>e.initLoaded),r=(0,d.useMemo)(()=>{var t;return(null===(t=e.find(e=>e.groupType===v.ai.Workflow))||void 0===t?void 0:t.resourceList)||[]},[e]),o=(0,d.useMemo)(()=>{var t;return(null===(t=e.find(e=>e.groupType===v.ai.Plugin))||void 0===t?void 0:t.resourceList)||[]},[e]);return{workflowResource:r,pluginResource:o,dataResource:(0,d.useMemo)(()=>{var t;return(null===(t=e.find(e=>e.groupType===v.ai.Data))||void 0===t?void 0:t.resourceList)||[]},[e]),initLoaded:n,isFetching:t}},eT=()=>{var e=(0,u.d0)();return t=>{var{resourceId:n,resourceType:r}=t;return e("/".concat(r,"/").concat(n))}},eI=()=>{var e,t=(0,u.RX)(u.Z7),n=x(e=>e.refetch),r=(0,u.XO)(),o=eT(),a=(0,u.aQ)(),s=e=>{var{scene:t,taskInfo:n}=e;if(!!(null==n?void 0:n.res_type)&&!!(null==n?void 0:n.res_id)&&!!t){var r=t&&[v.K2.CopyProjectResource,v.K2.CopyResourceFromLibrary].includes(t),s=_(n.res_type),l=n.res_id;r?o({resourceType:_(n.res_type),resourceId:n.res_id}):s===b.Workflow?window.open("/work_flow?space_id=".concat(a,"&workflow_id=").concat(l)):window.open("/space/".concat(a,"/").concat(s,"/").concat(l,"?from=project"),"_blank")}},l=e=>{var{scene:t,taskInfo:n,hideViewBtn:r}=e,o="";switch(t){case v.K2.CopyProjectResource:o=S.o.t("project_toast_copy_successful");break;case v.K2.CopyResourceToLibrary:o=S.o.t("resource_toast_copy_to_library_success");break;case v.K2.MoveResourceToLibrary:o=S.o.t("resource_toast_move_to_library_success");break;case v.K2.CopyResourceFromLibrary:o=S.o.t("project_toast_successfully_imported_from_library")}C.FN.success({content:(0,c.jsxs)(C.T,{spacing:6,children:[(0,c.jsx)(C.ZT.Text,{children:o}),r?null:(0,c.jsx)(C.zx,{color:"primary",size:"small",onClick:()=>s({scene:t,taskInfo:n}),children:S.o.t("resource_toast_view_resource")})]})})};return e=(0,h._)(function*(e){var o=new u.K4;try{var a=yield new Promise((r,a)=>{t.startPolling(e),o.pushAll([t.onSuccess(e=>{o.dispose(),n(),r(e)}),t.onError(e=>{o.dispose(),a(e)}),t.onCancel(()=>{o.dispose(),a(Error("cancelled"))})])}),c=e.scene===v.K2.CopyResourceFromLibrary;if(l({scene:e.scene,taskInfo:a,hideViewBtn:c}),c&&s({scene:e.scene,taskInfo:a}),e.scene===v.K2.MoveResourceToLibrary){var d,h,p=(0,u.Ym)(null!==(d=_(e.res_type))&&void 0!==d?d:"",null!==(h=e.res_id)&&void 0!==h?h:"");r.view.closeWidgetByUri(p)}return a}catch(e){console.error("error dispatch resource",e)}}),function(t){return e.apply(this,arguments)}}},562392:function(e,t,n){"use strict";n.d(t,{GR:()=>r.GR,qn:()=>R,Q4:()=>y,cS:()=>r.cS});var r=n("189400"),o=n("151064"),a=n("455069"),s=n("149528"),l=n("336205"),c=n("567282"),d=n("659596"),u=n.p+"static/image/workflow-light.aae45d5d.jpg",h=n.p+"static/image/workflow-dark.74638706.jpg",p=n.p+"static/image/chatflow-light.83371423.jpg",f={workflow:{dark:h,light:u},chatflow:{dark:n.p+"static/image/chatflow-dark.6996d32b.jpg",light:p}},m=e=>{var{flowMode:t}=e,{theme:n}=(0,d.Fg)(),r=(0,a.useMemo)(()=>{if(t===c.wz.ChatFlow)return f.chatflow[n]||f.chatflow.light;return f.workflow[n]||f.workflow.light},[n,t]);return(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,o.jsx)(d.Ee,{src:r,crossOrigin:"anonymous",imgStyle:{width:200,minHeight:120,borderRadius:"7.5px",border:"1px solid var(--coz-stroke-primary)"},preview:!1}),(0,o.jsxs)("div",{className:"px-2 pt-1 pb-2",children:[(0,o.jsx)("p",{className:"text-14 font-medium coz-fg-primary leading-5",children:t===c.wz.Workflow?"Workflow":"Chatflow"}),(0,o.jsx)("span",{className:"text-[12px] coz-fg-primary leading-4",children:t===c.wz.Workflow?l.o.t("wf_chatflow_02"):l.o.t("wf_chatflow_01")})]})]})},v=n("873183"),g={[c.wz.Workflow]:(0,o.jsx)(v.eTH,{}),[c.wz.ChatFlow]:(0,o.jsx)(v.TLD,{})},b=e=>{var{context:t}=e,{widget:n}=t,[r,o]=(0,a.useState)(n.getIconType()||String(c.wz.Workflow)),s=(0,a.useMemo)(()=>g[r],[r]);return(0,a.useEffect)(()=>{var e=n.onIconTypeChanged(e=>o(e));return()=>{var t;return null==e?void 0:null===(t=e.dispose)||void 0===t?void 0:t.call(e)}},[]),s},y={match:/\/workflow\/.*/,area:s.px.MAIN_PANEL,renderContent(){var e=(0,s.jL)(()=>n.e("7241").then(n.bind(n,815935)));return(0,o.jsx)(e,{})},renderIcon:e=>(0,o.jsx)(b,{context:e}),onFocus(e){e.widget.onFocusEmitter.fire()}};s.px.MAIN_PANEL,()=>(0,o.jsx)(v.OlX,{});var _=n("825955"),w=n("614904"),x=n("66860"),S=n("909776"),k=n("382534"),C=n("529223"),j=e=>{var t,{projectId:n}=e,r=(0,x.S4)();return t=(0,_._)(function*(e){var{scene:t,resource:o}=e;try{console.log("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t,">>>"),o),yield r({scene:t,res_id:null==o?void 0:o.id,res_type:C.ResType.Workflow,project_id:n,res_name:(null==o?void 0:o.name)||""})}catch(e){console.error("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t," error>>>"),e)}}),function(e){return t.apply(this,arguments)}},E=n("458620"),T=n("727914"),I=function(){var{currentResourceRef:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{workflowResource:t}=(0,x.rA)();return[{validator:(n,r)=>!((null==e?void 0:e.current)?t.filter(t=>{var n;return t.res_id!==(null==e?void 0:null===(n=e.current)||void 0===n?void 0:n.res_id)}):t).map(e=>e.name).includes(r)||new T.sH(E.b.formValidation,l.o.t("project_resource_sidebar_warning_label_exists",{label:r}))}]},P=e=>{var t,n,{projectId:r}=e,o=(0,x.Un)(e=>e.refetch),a=(0,x.j2)(),s=(0,x.S4)();var l=(t=(0,_._)(function*(e){try{p(),console.log("[ResourceFolder]import library workflow>>>",e),yield s({scene:C.ResourceCopyScene.CopyResourceFromLibrary,res_id:e.workflow_id,res_type:C.ResType.Workflow,project_id:r,res_name:e.name})}catch(e){console.error("[ResourceFolder]import library workflow error>>>",e)}}),function(e){return t.apply(this,arguments)}),d=I();var{node:u,open:h,close:p}=(0,w.Zv)({from:w.wL.ProjectImportLibrary,flowMode:c.wz.Workflow,hiddenExplore:!0,hiddenCreate:!0,hiddenWorkflowCategories:[w.BD.Example,w.BD.Project],projectId:r,onImport:l,nameValidators:d,onCreateSuccess:(n=(0,_._)(function*(e){var{workflowId:t}=e;p(),yield o(),a({resourceType:x.LC.Workflow,resourceId:t})}),function(e){return n.apply(this,arguments)})});return{modal:u,importLibrary:h}},M=()=>{var e,t=(0,x.Un)(e=>e.refetch),n=(0,s.d0)(),{view:r}=(0,s.XO)();return e=(0,_._)(function*(e,o,a){yield k.OH.UpdateWorkflowMeta({workflow_id:o,space_id:a,flow_mode:e}),d.FN.success(l.o.t("wf_chatflow_123",{Chatflow:l.o.t(e===c.wz.ChatFlow?"wf_chatflow_76":"Workflow")})),yield t();var u=(0,s.Ym)("workflow",o),h=r.getWidgetContextFromURI(u),p=!!(null==h?void 0:h.widget);n("/workflow/".concat(o).concat(p?"?refresh=true":""))}),function(t,n,r){return e.apply(this,arguments)}},R=()=>{var e,t,n,r,u=(0,x.Un)(e=>e.refetch),h=(0,s.aQ)(),p=(0,s.vp)(),f=(0,x.j2)(),v=(0,a.useRef)(),b=I({currentResourceRef:v});var{createWorkflowModal:y,workflowModal:C,openCreateModal:E,handleEditWorkflow:T}=(0,w.ub)({from:w.wL.ProjectAddWorkflowResource,spaceId:h,projectId:p,hiddenTemplateEntry:!0,nameValidators:b,refreshPage:()=>{v.current=void 0,null==u||u()},onCreateSuccess:(e=(0,_._)(function*(e){var{workflowId:t}=e;yield null==u?void 0:u(),f({resourceType:x.LC.Workflow,resourceId:t})}),function(t){return e.apply(this,arguments)})});var R=(0,a.useCallback)((t=(0,_._)(function*(e){try{console.log("[ResourceFolder]on change name>>>",e);var t=yield k.OH.UpdateWorkflowMeta({space_id:h,workflow_id:e.id,name:e.name});console.log("[ResourceFolder]rename workflow response>>>",t)}catch(e){console.log("[ResourceFolder]rename workflow error>>>",e)}finally{u()}}),function(e){return t.apply(this,arguments)}),[u,h]);var D=(0,a.useCallback)((n=(0,_._)(function*(e){if(!(null==e?void 0:e.res_id))return;v.current=e;var t,n=yield k.OH.GetWorkflowDetail({space_id:h,workflow_ids:[null==e?void 0:e.res_id]}),r=null==n?void 0:null===(t=n.data)||void 0===t?void 0:t[0];if(!!r)T({space_id:r.space_id,workflow_id:r.workflow_id,url:r.icon,icon_uri:r.icon_uri,name:r.name,desc:r.desc})}),function(e){return n.apply(this,arguments)}),[h,T]);var A=(0,a.useCallback)((r=(0,_._)(function*(e){try{console.log("[ResourceFolder]on delete>>>",e),console.log("delete start>>>",Date.now());var t=yield k.OH.BatchDeleteWorkflow({space_id:h,workflow_id_list:e.filter(e=>e.type===x.LC.Workflow).map(e=>e.id)});console.log("delete end>>>",Date.now()),d.FN.success(l.o.t("Delete_success")),u().then(()=>console.log("refetch end>>>",Date.now())),console.log("[ResourceFolder]delete workflow response>>>",t)}catch(e){console.log("[ResourceFolder]delete workflow error>>>",e),d.FN.error(l.o.t("Delete_failed"))}}),function(e){return r.apply(this,arguments)}),[u,h]),{modal:N,importLibrary:L}=P({projectId:p}),z=M(),O=j({projectId:p}),B=(0,a.useMemo)(()=>[{icon:g[c.wz.Workflow],label:l.o.t("project_resource_sidebar_create_new_resource",{resource:l.o.t("library_resource_type_workflow")}),subType:c.wz.Workflow,tooltip:(0,o.jsx)(m,{flowMode:c.wz.Workflow})},null].filter(Boolean),[]);return{onChangeName:R,onAction:(e,t)=>{var n,r;switch(e){case x.lW.ImportLibraryResource:return L();case x.lW.DuplicateResource:return O({scene:S.K2.CopyProjectResource,resource:t});case x.lW.MoveToLibrary:return O({scene:S.K2.MoveResourceToLibrary,resource:t});case x.lW.CopyToLibrary:return O({scene:S.K2.CopyResourceToLibrary,resource:t});case x.lW.UpdateDesc:return D(t);case x.lW.SwitchToChatflow:return z(c.wz.ChatFlow,null!==(n=null==t?void 0:t.res_id)&&void 0!==n?n:"",h);case x.lW.SwitchToWorkflow:return z(c.wz.Workflow,null!==(r=null==t?void 0:t.res_id)&&void 0!==r?r:"",h);default:console.warn("[WorkflowResource]unsupported action>>>",e)}},onDelete:A,onCustomCreate:(e,t)=>{console.log("[ResourceFolder]on custom create>>>",e,t),E(t)},createResourceConfig:B,iconRender:(0,a.useMemo)(()=>e=>{var{resource:t}=e;return(0,o.jsx)(o.Fragment,{children:g[t.res_sub_type||c.wz.Workflow]})},[]),modals:[N,y,C]}}},149528:function(e,t,n){"use strict";n.d(t,{M1:()=>e0,aQ:()=>oz,l0:()=>iY,AE:()=>oW,K4:()=>eX.K4,T_:()=>av,Ho:()=>eX.Ho,px:()=>r6,tN:()=>oF,cw:()=>iQ,dQ:()=>eG,Cg:()=>oD.Cg,d0:()=>ar,Qy:()=>al,vp:()=>an,El:()=>sX,Ew:()=>iq,X9:()=>oD.X9,aY:()=>e5,Xe:()=>aV,w8:()=>af,ov:()=>tD,un:()=>tp,XO:()=>oG,Lj:()=>ao,Ir:()=>a9,dz:()=>aX,fZ:()=>o7,sq:()=>oK,q9:()=>ab,L:()=>t3,B6:()=>oZ,KV:()=>eX.KV,Z7:()=>am,fH:()=>r9,KO:()=>oV,JT:()=>eX.JT,IC:()=>oA,jo:()=>oR,RX:()=>nF,ZQ:()=>aa,Fl:()=>o9,Q5:()=>eX.Q5,L8:()=>o5,mY:()=>eX.mY,k7:()=>oQ,BX:()=>oJ,eo:()=>iA,pY:()=>eX.pY,sJ:()=>aJ,hU:()=>o4,qj:()=>o6,CW:()=>aS,OG:()=>oO,Ym:()=>o3,yg:()=>ax,PF:()=>at,W9:()=>o8,XU:()=>ac,xO:()=>iu,yJ:()=>oY,vY:()=>t5,s1:()=>or,H0:()=>aq,VM:()=>o$,jL:()=>o2,zu:()=>oD.zu,tF:()=>aw});var r,o,a,s,l,c,d,u,h,p,f,m,v,g,b,y,_,w,x,S,k,C,j,E,T,I,P,M,R,D,A,N,L,z,O,B,W,F,H,U,V,K,q,Z,Y,X,Q,G,J,$,ee,et,en,er,ei,eo,ea,es,el,ec,ed,eu,eh,ep,ef,em,ev,eg,eb,ey,e_,ew,ex,eS,ek,eC,ej,eE,eT,eI,eP,eM,eR,eD,eA,eN,eL,ez,eO,eB,eW,eF,eH,eU,eV,eK,eq,eZ,eY={};n.r(eY),n.d(eY,{baseBg0:()=>nm,baseBg1:()=>nv,baseBg2:()=>ng,baseBorder:()=>nw,baseFill0:()=>nk,baseFill1:()=>nC,baseFill2:()=>nj,basePrimary:()=>nE,basePrimaryHover:()=>nT,baseText0:()=>nb,baseText1:()=>ny,baseText2:()=>n_,baseWhite:()=>nf,menuBorder:()=>nx,menuBoxShadow:()=>nS});var eX=n("816697"),eQ=n("702570"),eG=Symbol("LifecycleContribution"),eJ=Symbol("PluginContext");Symbol("Plugin");var e$=0;function e0(e){var{contributionKeys:t}=e;e$+=1;var n="IDE_".concat(e$);return r=>{var o=[],a=!1;return{pluginId:n,initPlugin:()=>{if(!a){if(a=!0,e.containerModules&&o.push(...e.containerModules),e.onBind&&o.push(new eQ.n((t,n,o,a)=>{e.onBind({bind:t,unbind:n,isBound:o,rebind:a},r)})),e.onInit||e.onLoading||e.onLayoutInit||e.onStart||e.onWillDispose||e.onDispose){var t,n;o.push((t=e,n=r,new eQ.n(e=>{e(eG).toDynamicValue(e=>{var r=e.container.get(eJ);return{onInit:()=>{var e;return null===(e=t.onInit)||void 0===e?void 0:e.call(t,r,n)},onLoading:()=>{var e;return null===(e=t.onLoading)||void 0===e?void 0:e.call(t,r,n)},onLayoutInit:()=>{var e;return null===(e=t.onLayoutInit)||void 0===e?void 0:e.call(t,r,n)},onStart:()=>{var e;return null===(e=t.onStart)||void 0===e?void 0:e.call(t,r,n)},onWillDispose:()=>{var e;return null===(e=t.onWillDispose)||void 0===e?void 0:e.call(t,r,n)},onDispose:()=>{var e;return null===(e=t.onDispose)||void 0===e?void 0:e.call(t,r,n)}}})})))}}},options:r,contributionKeys:t,containerModules:o}}}var e1=e=>e0(e)(void 0),e2=n("130001"),e4=n("435946"),e6=Symbol("ContextMatcher");class e5{setContext(e,t){this._contextKeys.set(e,t)}getContext(e){return this._contextKeys.get(e)}match(e){var t=Array.from(this._contextKeys.keys());return Function(...t,"return ".concat(e,";"))(...t.map(e=>this._contextKeys.get(e)))}constructor(){this._contextKeys=new Map,this._contextKeys.set("editorFocus",!0)}}e5=(0,e2.gn)([(0,e4.b)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[])],e5);var e3=n("825955"),e8=n("771531"),e9=n("734371");function e7(e){return e.priority>0}function te(e,t){return t.priority-e.priority}function tt(e,t){return tn.apply(this,arguments)}function tn(){return(tn=(0,e3._)(function*(e,t){if(e instanceof Array)return Promise.all(e.map(e=>tt(e,t)));var n=yield e;return{priority:yield t(n),value:n}})).apply(this,arguments)}function tr(e,t){var n,r;return(n=e,r=t,n.map(e=>({value:e,priority:r(e)}))).filter(e7).sort(te)}function ti(e,t){return to.apply(this,arguments)}function to(){return(to=(0,e3._)(function*(e,t){return(yield tt(e,t)).filter(e7).sort(te)})).apply(this,arguments)}var ta=Symbol("OpenHandler"),ts=Symbol("OpenerService");class tl{open(e,t){var n=this;return(0,e3._)(function*(){var r=yield n.getOpener(e,t),o=yield r.open(e,t);return n.onURIOpenEmitter.fire({uri:e,options:t}),o})()}addHandler(e){return this.customEditorOpenHandlers.push(e),this.onDidChangeOpenersEmitter.fire(),eX.JT.create(()=>{this.customEditorOpenHandlers.splice(this.customEditorOpenHandlers.indexOf(e),1),this.onDidChangeOpenersEmitter.fire()})}prioritize(e,t){var n=this;return(0,e3._)(function*(){var r;return(yield ti(n.getHandlers(),(r=(0,e3._)(function*(n){try{return yield n.canHandle(e,t)}catch(e){return 0}}),function(e){return r.apply(this,arguments)}))).map(e=>e.value)})()}getOpener(e,t){var n=this;return(0,e3._)(function*(){var r=yield n.prioritize(e,t);return r.length>=1?r[0]:Promise.reject(Error("There is no opener for ".concat(e,".")))})()}getOpeners(e,t){var n=this;return(0,e3._)(function*(){return e?n.prioritize(e,t):n.getHandlers()})()}getHandlers(){return[...this.handlersProvider.getContributions(),...this.customEditorOpenHandlers]}constructor(e){this.handlersProvider=e,this.customEditorOpenHandlers=[],this.onDidChangeOpenersEmitter=new eX.Q5,this.onURIOpenEmitter=new eX.Q5,this.onDidChangeOpeners=this.onDidChangeOpenersEmitter.event,this.onURIOpen=this.onURIOpenEmitter.event}}tl=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,(0,e8.f)(eX.Qc)),(0,e2.fM)(0,(0,e9.t)(ta)),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[void 0===eX.Qc?Object:eX.Qc])],tl);var tc=Symbol("ContainerFactory"),td=n("259674"),tu=Symbol("StorageService");class th{setData(e,t){this.storage[this.prefix(e)]=JSON.stringify(t)}getData(e,t){var n=this.storage[this.prefix(e)];return void 0===n?t:JSON.parse(n)}prefix(e){return"".concat(this._prefix).concat(e)}setPrefix(e){this._prefix=e}init(){"undefined"!=typeof window&&window.localStorage?this.storage=window.localStorage:this.storage={}}constructor(){this._prefix="flowide:"}}(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],th.prototype,"init",null),th=(0,e2.gn)([(0,e4.b)()],th);class tp{get onUnload(){return this.onUnloadEmitter.event}get onBeforeUnload(){return this.onBeforeUnloadEmitter.event}onStart(){this.registerUnloadListeners()}registerUnloadListeners(){window.addEventListener("unload",()=>this.onUnloadEmitter.fire()),window.addEventListener("beforeunload",e=>this.onBeforeUnloadEmitter.fire(e))}constructor(){this.onUnloadEmitter=new eX.Q5,this.onBeforeUnloadEmitter=new eX.Q5}}tp=(0,e2.gn)([(0,e4.b)()],tp);class tf{get dir(){return void 0===this._dir&&(this._dir=this.computeDir()),this._dir}get hasDir(){return!this.isRoot&&-1!==this.raw.lastIndexOf(tf.separator)}static isDrive(e){return e.endsWith(":")}static normalizeDrive(e){if(e.length>=3&&47===e.charCodeAt(0)&&58===e.charCodeAt(2)){var t=e.charCodeAt(1);t>=65&&t<=90&&(e="/".concat(String.fromCharCode(t+32),":").concat(e.substr(3)))}else if(e.length>=2&&58===e.charCodeAt(1)){var n=e.charCodeAt(0);n>=65&&n<=90&&(e="".concat(String.fromCharCode(n+32),":").concat(e.substr(2)))}return e}join(){for(var e=arguments.length,t=Array(e),n=0;n!!e).join(tf.separator);return r?this.raw.endsWith(tf.separator)?new tf(this.raw+r):new tf(this.raw+tf.separator+r):this}toString(){return this.raw}relative(e){if(this.raw===e.raw)return new tf("");if(!this.raw||!e.raw)return;var t=this.base?this.raw+tf.separator:this.raw;if(!!e.raw.startsWith(t))return new tf(e.raw.substr(t.length))}isEqualOrParent(e){return!!this.relative(e)}relativity(e){var t=this.relative(e);if(t){var n=t.toString();return""===n?0:n.split(tf.separator).length}return -1}normalize(){var e=this.raw.endsWith("/"),t=this.toString().split("/"),n=[];if(t.forEach((e,t)=>{if(!!e&&"."!==e)".."===e?n.length&&".."!==n[n.length-1]?n.pop():!this.isAbsolute&&n.push(".."):n.push(e)}),0===n.length)return this.isRoot?new tf("/"):new tf(".");return new tf((this.isAbsolute?"/":"")+n.join("/")+(e?"/":""))}computeRoot(){if(this.isRoot)return this;if(!!this.isAbsolute){var e=this.raw.indexOf(tf.separator,tf.separator.length);return -1===e?new tf(tf.separator):new tf(this.raw.substr(0,e)).root}}computeDir(){if(!this.hasDir)return this;var e=this.raw.lastIndexOf(tf.separator);if(this.isAbsolute){var t=this.raw.indexOf(tf.separator);if(t===e)return new tf(this.raw.substr(0,t+1))}return new tf(this.raw.substr(0,e))}constructor(e){this.raw=tf.normalizeDrive(e);var t=e.indexOf(tf.separator),n=e.lastIndexOf(tf.separator);this.isAbsolute=0===t,this.base=-1===n?e:e.substr(n+1),this.isRoot=this.isAbsolute&&t===n&&(!this.base||tf.isDrive(this.base)),this.root=this.computeRoot();var r=this.base.lastIndexOf(".");this.name=-1===r?this.base:this.base.substr(0,r),this.ext=-1===r?"":this.base.substr(r)}}tf.separator="/";var tm=n("808549"),tv=n("120454");var tg=(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});"object"==typeof process?ei="win32"===process.platform:"object"==typeof navigator&&(ei=navigator.userAgent.indexOf("Windows")>=0);var tb=/^\w[\w\d+.-]*$/,ty=/^\//,t_=/^\/\//,tw="/",tx=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,tS=function(){function e(e,t,n,r,o,a){if(void 0===a&&(a=!1),"object"==typeof e)this.scheme=e.scheme||"",this.authority=e.authority||"",this.path=e.path||"",this.query=e.query||"",this.fragment=e.fragment||"";else{var s,l;this.scheme=(s=e,l=a,s||l?s:"file"),this.authority=t||"",this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==tw&&(t=tw+t):t=tw}return t}(this.scheme,n||""),this.query=r||"",this.fragment=o||"",!function(e,t){if(!e.scheme&&t)throw Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!tb.test(e.scheme))throw Error("[UriError]: Scheme contains illegal characters.");if(e.path){if(e.authority){if(!ty.test(e.path))throw Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(t_.test(e.path))throw Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}(this,a)}}return e.isUri=function(t){return t instanceof e||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString},Object.defineProperty(e.prototype,"fsPath",{get:function(){return tI(this,!1)},enumerable:!0,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,o=e.query,a=e.fragment;return(void 0===t?t=this.scheme:null===t&&(t=""),void 0===n?n=this.authority:null===n&&(n=""),void 0===r?r=this.path:null===r&&(r=""),void 0===o?o=this.query:null===o&&(o=""),void 0===a?a=this.fragment:null===a&&(a=""),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&a===this.fragment)?this:new tC(t,n,r,o,a)},e.parse=function(e,t){void 0===t&&(t=!1);var n=tx.exec(e);return n?new tC(n[2]||"",tR(n[4]||""),tR(n[5]||""),tR(n[7]||""),tR(n[9]||""),t):new tC("","","","","")},e.file=function(e){var t="";if(ei&&(e=e.replace(/\\/g,tw)),e[0]===tw&&e[1]===tw){var n=e.indexOf(tw,2);-1===n?(t=e.substring(2),e=tw):(t=e.substring(2,n),e=e.substring(n)||tw)}return new tC("file",t,e,"","")},e.from=function(e){return new tC(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),tP(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(!t)return t;if(t instanceof e)return t;var n=new tC(t);return n._formatted=t.external,n._fsPath=t._sep===tk?t.fsPath:null,n},e}(),tk=ei?1:void 0,tC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return tg(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return!this._fsPath&&(this._fsPath=tI(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){return(void 0===e&&(e=!1),e)?tP(this,!0):(!this._formatted&&(this._formatted=tP(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=tk),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(tS),tj=((er={})[58]="%3A",er[47]="%2F",er[63]="%3F",er[35]="%23",er[91]="%5B",er[93]="%5D",er[64]="%40",er[33]="%21",er[36]="%24",er[38]="%26",er[39]="%27",er[40]="%28",er[41]="%29",er[42]="%2A",er[43]="%2B",er[44]="%2C",er[59]="%3B",er[61]="%3D",er[32]="%20",er);function tE(e,t){for(var n=void 0,r=-1,o=0;o=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57||45===a||46===a||95===a||126===a||t&&47===a)-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));var s=tj[a];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),n+=s):-1===r&&(r=o)}}return -1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function tT(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&90>=e.path.charCodeAt(1)||e.path.charCodeAt(1)>=97&&122>=e.path.charCodeAt(1))&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,ei&&(n=n.replace(/\//g,"\\")),n}function tP(e,t){var n=t?tT:tE,r="",o=e.scheme,a=e.authority,s=e.path,l=e.query,c=e.fragment;if(o&&(r+=o,r+=":"),(a||"file"===o)&&(r+=tw,r+=tw),a){var d=a.indexOf("@");if(-1!==d){var u=a.substr(0,d);a=a.substr(d+1),-1===(d=u.indexOf(":"))?r+=n(u,!1):(r+=n(u.substr(0,d),!1),r+=":",r+=n(u.substr(d+1),!1)),r+="@"}-1===(d=(a=a.toLowerCase()).indexOf(":"))?r+=n(a,!1):(r+=n(a.substr(0,d),!1),r+=a.substr(d))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){var h=s.charCodeAt(1);h>=65&&h<=90&&(s="/"+String.fromCharCode(h+32)+":"+s.substr(3))}else if(s.length>=2&&58===s.charCodeAt(1)){var h=s.charCodeAt(0);h>=65&&h<=90&&(s=String.fromCharCode(h+32)+":"+s.substr(2))}r+=n(s,!0)}return l&&(r+="?",r+=n(l,!1)),c&&(r+="#",r+=t?c:tE(c,!1)),r}var tM=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function tR(e){return e.match(tM)?e.replace(tM,function(e){return function e(t){try{return decodeURIComponent(t)}catch(n){if(t.length>3)return t.substr(0,3)+e(t.substr(3));return t}}(e)}):e}class tD{get path(){return void 0===this._path&&(this._path=new tf(this.codeUri.path)),this._path}get displayName(){var{base:e}=this.path;return e?e:this.path.isRoot?this.path.toString():""}get allLocations(){for(var e=[],t=this;!t.path.isRoot&&t.path.hasDir;)e.push(t),t=t.parent;return e.push(t),e}get parent(){return this.path.isRoot?this:this.withPath(this.path.dir)}get scheme(){return this.codeUri.scheme}get authority(){return this.codeUri.authority}get query(){return this.codeUri.query}get fragment(){return this.codeUri.fragment}get queryObject(){return tD.queryStringToObject(this.query)}static getDistinctParents(e){var t=[];return e.forEach((n,r)=>{!e.some((e,t)=>t!==r&&e.isEqualOrParent(n))&&t.push(n)}),t}relative(e){if(this.authority===e.authority&&this.scheme===e.scheme)return this.path.relative(e.path)}resolve(e){return this.withPath(this.path.join(e.toString()))}withScheme(e){var t=tS.from((0,tv._)((0,tm._)({},this.codeUri.toJSON()),{scheme:e}));return new tD(t)}withAuthority(e){var t=tS.from((0,tv._)((0,tm._)({},this.codeUri.toJSON()),{scheme:this.codeUri.scheme,authority:e}));return new tD(t)}withoutAuthority(){return this.withAuthority("")}withPath(e){var t=tS.from((0,tv._)((0,tm._)({},this.codeUri.toJSON()),{scheme:this.codeUri.scheme,path:e.toString()}));return new tD(t)}withoutPath(){return this.withPath("")}withQuery(e){var t=tS.from((0,tv._)((0,tm._)({},this.codeUri.toJSON()),{scheme:this.codeUri.scheme,query:e}));return new tD(t)}addQueryObject(e){return e=(0,tm._)({},this.queryObject,e),this.withQuery(tD.objectToQueryString(e))}removeQueryObject(e){var t=(0,tm._)({},this.queryObject);return e in t&&delete t[e],this.withQuery(tD.objectToQueryString(t))}withoutQuery(){return this.withQuery("")}withFragment(e){var t=tS.from((0,tv._)((0,tm._)({},this.codeUri.toJSON()),{scheme:this.codeUri.scheme,fragment:e}));return new tD(t)}withoutFragment(){return this.withFragment("")}normalizePath(){return this.withPath(this.path.normalize())}toString(){return"".concat(this.scheme,"://").concat(this.authority).concat(this.path.toString()).concat(this.query?"?".concat(this.query):"").concat(this.fragment?"#".concat(this.fragment):"")}isEqualOrParent(e){return e="string"==typeof e?new tD(e):e,this.authority===e.authority&&this.scheme===e.scheme&&this.path.isEqualOrParent(e.path)}match(e){var t="/".concat(e.authority).concat(e.path.toString()),n=[],r="/".concat(this.authority).concat(this.path.toString()),o=r.replace(/\/*\*?$/,"").replace(/[\\. *+ ^ ${} | () [\]]/g,"\\ $&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(n.push({paramName:t,optional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"));r.endsWith("*")?(n.push({paramName:"*"}),o+="/*"===r?"(.*)$":"(?:\\/(.+)|\\/*)$"):o+="\\/*$";var a=new RegExp(o);return!!t.match(a)}constructor(e=""){e instanceof tS?this.codeUri=e:this.codeUri=tS.parse(e)}}!function(e){e.MAX_PRIORITY=500,e.DEFAULT_PRIORITY=0;function t(){return(t=(0,e3._)(function*(t,n){var r,o;return null===(o=(yield ti(n,(r=(0,e3._)(function*(n){var r=n.canHandle(t);return"boolean"==typeof r?r?e.MAX_PRIORITY:e.DEFAULT_PRIORITY:r}),function(e){return r.apply(this,arguments)})))[0])||void 0===o?void 0:o.value})).apply(this,arguments)}e.findAsync=function(e,n){return t.apply(this,arguments)};e.findSync=function(t,n){var r;return null===(r=tr(n,n=>{var r=n.canHandle(t);return"boolean"==typeof r?r?e.MAX_PRIORITY:e.DEFAULT_PRIORITY:r})[0])||void 0===r?void 0:r.value}}(eo||(eo={})),!function(e){e.objectToQueryString=function(e){return e?Object.keys(e).map(t=>"".concat(t,"=").concat(e[t]||"")).join("&"):""};function t(t,n){var r=new e(t);return new e(n).path.isEqualOrParent(r.path)}function n(t,n){var r=new e(t);return new e(n).toString()===r.toString()}e.queryStringToObject=function(e){return e.split("&").reduce((e,t)=>{var[n,r]=t.split("=");return e[n]=r,e},{})},e.isSubPath=t,e.isURIStringEqual=n;e.isSubOrEqual=function(e,r){return t(e,r)||n(e,r)}}(tD||(tD={}));class tA{init(){var e;for(var t of this.contributionProvider.getContributions())null===(e=t.onInit)||void 0===e||e.call(t);this.onDidInitEmitter.fire()}start(){var e=this;return(0,e3._)(function*(){var t,n,r,o=e.contributionProvider.getContributions();for(var a of o)yield null===(t=a.onLoading)||void 0===t?void 0:t.call(a);for(var s of(e.onDidLoadingEmitter.fire(),o))yield null===(n=s.onLayoutInit)||void 0===n?void 0:n.call(s);for(var l of(e.onDidLayoutInitEmitter.fire(),o))yield null===(r=l.onStart)||void 0===r?void 0:r.call(l);e.onDidStartEmitter.fire()})()}dispose(){var e=this;return(0,e3._)(function*(){var t,n=e.contributionProvider.getContributions();for(var r of n)if(r.onWillDispose&&r.onWillDispose())return;for(var o of n)null===(t=o.onDispose)||void 0===t||t.call(o)})()}constructor(){this.onDidInitEmitter=new eX.Q5,this.onDidInit=this.onDidInitEmitter.event,this.onDidLoadingEmitter=new eX.Q5,this.onDidLoading=this.onDidLoadingEmitter.event,this.onDidLayoutInitEmitter=new eX.Q5,this.onDidLayout=this.onDidLayoutInitEmitter.event,this.onDidStartEmitter=new eX.Q5,this.onDidStart=this.onDidStartEmitter.event}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(eG),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],tA.prototype,"contributionProvider",void 0),tA=(0,e2.gn)([(0,e4.b)()],tA);var tN=new eQ.n(e=>{e(tA).toSelf().inSingletonScope(),(0,eX.yb)(e,ta),e(tl).toSelf().inSingletonScope(),e(tp).toSelf().inSingletonScope(),e(ts).toService(tl),e(e5).toSelf().inSingletonScope(),e(e6).toService(e5),e(eJ).toDynamicValue(e=>({get:t=>e.container.get(t),getAll:t=>e.container.getAll(t),container:e.container})).inSingletonScope(),e(tc).toDynamicValue(e=>e.container).inSingletonScope(),(0,eX.yb)(e,eG),e(tu).to(th).inSingletonScope()});class tL extends Error{static is(e,t){return e instanceof tL&&e.code===t}constructor(e,t,n){super(e),this.message=e,this.code=t,this.uri=n}}tL.NotFound=-4e4,tL.OutOfSync=-40001;var tz=Symbol("ResourceHandler");class tO{get(e){var t=e.withoutQuery().toString(),n=this.resourceCacheMap.get(t);if(n)return n;var r=eo.findSync(e,this.contributionProvider.getContributions());if(!r)throw Error("Unknown Resource handler: ".concat(e.toString()));var o=r.resolve(e);return o.onDispose(()=>{this.resourceCacheMap.delete(t),this.onResourceDisposeEmitter.fire(o)}),this.resourceCacheMap.set(t,o),this.onResourceCreateEmitter.fire(o),o}getResourceListFromCache(){return Array.from(this.resourceCacheMap.values())}clearCache(){for(var e of this.resourceCacheMap.values())e.dispose()}constructor(){this.resourceCacheMap=new Map,this.onResourceCreateEmitter=new eX.Q5,this.onResourceDisposeEmitter=new eX.Q5,this.onResourceCreate=this.onResourceCreateEmitter.event,this.onResourceDispose=this.onResourceDisposeEmitter.event}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(tz),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],tO.prototype,"contributionProvider",void 0),tO=(0,e2.gn)([(0,e4.b)()],tO);class tB{get(e){return this.resourceManager.get(e.withoutQuery())}get onResourceCreate(){return this.resourceManager.onResourceCreate}get onResourceDispose(){return this.resourceManager.onResourceDispose}getResourceListFromCache(){return this.resourceManager.getResourceListFromCache()}clearCache(){this.resourceManager.clearCache()}}(0,e2.gn)([(0,e8.f)(tO),(0,e2.w6)("design:type",void 0===tO?Object:tO)],tB.prototype,"resourceManager",void 0),tB=(0,e2.gn)([(0,e4.b)()],tB);var tW=e0({onBind:(e,t)=>{var{bind:n}=e;n(tO).toSelf().inSingletonScope(),n(tB).toSelf().inSingletonScope(),(0,eX.yb)(n,tz),t.handlers&&t.handlers.forEach(e=>{"function"==typeof e?(n(e).toSelf().inSingletonScope(),n(tz).toService(e)):n(tz).toConstantValue(e)})},onInit:e=>{}}),tF=n("195852"),tH=Symbol("AutoSaveResourceOptions");class tU{cancelSave(){return this.saveCancellationTokenSource.cancel(),this.saveCancellationTokenSource=new eX.AU,this.saveCancellationTokenSource.token}setDirty(e){if(e!==this._dirty)this._dirty=e,this.onDirtyChangeEmitter.fire(void 0)}markAsDirty(){this.setDirty(!0),this.doAutoSave()}cancelSync(){return this.syncCancellationTokenSource.cancel(),this.syncCancellationTokenSource=new eX.AU,this.syncCancellationTokenSource.token}sync(){var e=this;return(0,e3._)(function*(){var t=e.cancelSync();return e.run(()=>e.doSync(t))})()}doSync(e){var t=this;return(0,e3._)(function*(){if(!e.isCancellationRequested)yield t.readContent(!1)})()}doAutoSave(){if("on"===this.autoSave){var e=this.cancelSave();this.toDisposeOnAutoSave.dispose();var t=window.setTimeout(()=>{this.save(e)},this.autoSaveDelay);this.toDisposeOnAutoSave.push(eX.JT.create(()=>window.clearTimeout(t)))}}run(e){var t=this;return(0,e3._)(function*(){if(!t.toDispose.disposed)return t.pendingOperation=t.pendingOperation.then((0,e3._)(function*(){try{yield e()}catch(e){console.error(e)}}))})()}save(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.cancelSave();return this.run(()=>this._doSave(e))}_doSave(e){var t=this;return(0,e3._)(function*(){if(!e.isCancellationRequested&&!!t._valid&&!t._isSaving){t._isSaving=!0;try{var n=[...t.contentChanges];if(0===n.length)return Promise.resolve(void 0);var{version:r}=t.info,o=n[n.length-1];if(o===t.lastContent){t.contentChanges.length=0,t.setValid(!0),t.setDirty(!1);return}var a=yield t.doSave(o,r);t.lastContent=o,t.updateInfo(a),o===t.contentChanges[t.contentChanges.length-1]?(t.contentChanges.length=0,t.setValid(!0),t.setDirty(!1),t.onContentChangeEmitter.fire(o)):t.doAutoSave()}catch(e){if(tL.is(e,tL.OutOfSync)){t.sync();return}t.onErrorEmitter.fire(e)}finally{t._isSaving=!1}}})()}setValid(e){if(e!==this._valid)this._valid=e,this.onValidChangeEmitter.fire()}dispose(){this.toDispose.dispose()}get dirty(){return this._dirty}get valid(){return this._valid}get uri(){return this.options.uri}readContent(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=this;return(0,e3._)(function*(){try{if(void 0!==t.lastContent&&e)return Promise.resolve(t.lastContent);if(t._readContentPromise&&e)return t._readContentPromise.promise;var n=new eX.cO;t._readContentPromise=n;var r=yield t.doRead();return t.lastContent=r.content,t.setValid(!0),t.updateInfo(r.info),t.onContentChangeEmitter.fire(r.content),n.resolve(r.content),t._readContentPromise=void 0,r.content}catch(e){throw t.setValid(!1),t.onErrorEmitter.fire(e),t._readContentPromise=void 0,e}})()}getInfo(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=this;return(0,e3._)(function*(){if(e&&-1!==t.info.version)return t.info;var n=yield t.doGetInfo();return t.updateInfo(n),n})()}updateInfo(e){this.info=e,this.onInfoChangeEmitter.fire(e)}saveContent(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e,o=null!==(t=this.contentChanges[this.contentChanges.length-1])&&void 0!==t?t:this.lastContent;n&&o&&"object"==typeof o&&"object"==typeof e&&(r=(0,tm._)({},o,e)),this.contentChanges.push(r),this.onPreSaveContentEmitter.fire(r),this.markAsDirty()}getPreSaveContent(){var e;return null!==(e=this.contentChanges[this.contentChanges.length-1])&&void 0!==e?e:this.lastContent}constructor(e){var t,n,r,o,a,s;this.options=e,this.autoSave="on",this.autoSaveDelay=2e3,this.info={version:-1,lastModification:-1,displayName:""},this._dirty=!1,this.onPreSaveContentEmitter=new eX.Q5,this.toDispose=new eX.K4,this.onDirtyChangeEmitter=new eX.Q5,this.onValidChangeEmitter=new eX.Q5,this.onContentChangeEmitter=new eX.Q5,this.onInfoChangeEmitter=new eX.Q5,this.onDisplayNameChangeEmitter=(t=this.onInfoChangeEmitter,n=e=>e.displayName,a=(o=new eX.Q5).dispose.bind(o),s=t.event(e=>{var t=n(e);!(0,tF.isEqual)(r,t)&&(r=t,o.fire(t))}),o.dispose=()=>{a(),s.dispose()},o),this.onErrorEmitter=new eX.Q5,this.contentChanges=[],this.toDisposeOnAutoSave=new eX.K4,this.onDirtyChange=this.onDirtyChangeEmitter.event,this.onPreSaveContent=this.onPreSaveContentEmitter.event,this.onValidChange=this.onValidChangeEmitter.event,this.onInfoChange=this.onInfoChangeEmitter.event,this.onContentChange=this.onContentChangeEmitter.event,this.onDisplayNameChange=this.onDisplayNameChangeEmitter.event,this.onError=this.onErrorEmitter.event,this._valid=!1,this.saveCancellationTokenSource=new eX.AU,this.syncCancellationTokenSource=new eX.AU,this.pendingOperation=Promise.resolve(),this._isSaving=!1,this.onDispose=this.toDispose.onDispose,this.options=e,this.toDispose.push(this.toDisposeOnAutoSave),this.toDispose.push(this.onDirtyChangeEmitter),this.toDispose.push(this.onInfoChangeEmitter),this.toDispose.push(this.onValidChangeEmitter),this.toDispose.push(this.onPreSaveContentEmitter),this.toDispose.push(this.onContentChangeEmitter),this.toDispose.push(this.onDisplayNameChangeEmitter),this.toDispose.push(this.onErrorEmitter),this.toDispose.push(eX.JT.create(()=>this.cancelSave())),this.toDispose.push(eX.JT.create(()=>this.cancelSync()))}}tU=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,(0,e8.f)(tH)),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[void 0===tH?Object:tH])],tU);var tV=e0({onInit:(e,t)=>{var n=e.get(eX.Ho);n.init(),(t.commands||[]).forEach(e=>{n.registerCommand((0,eX.ei)(e,["id","label","icon","category"]),e.execute?(0,eX.ei)(e,["execute","isEnabled","isVisible","isToggled"]):void 0)})},containerModules:[eX.bc]}),tK=n("151064"),tq=n("455069"),tZ=n("523158"),tY=n("686346"),tX=/(mac|iphone|ipod|ipad)/i.test("undefined"!=typeof navigator?null===(ea=navigator)||void 0===ea?void 0:ea.platform:""),tQ={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:tX?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,"=":187,comma:188,dash:189,"-":189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},tG={ctrl:e=>!tX&&e.ctrlKey,control:e=>tX&&e.ctrlKey,shift:e=>e.shiftKey,alt:e=>e.altKey,meta:e=>"keyup"===e.type?tQ.meta.includes(e.keyCode):e.metaKey};function tJ(e,t){var n,r,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e.key||!t)return!1;var a=t.split(/\s+/),s=0;for(var l of a){var c=tG[l],d=tQ[l.toLowerCase()];(c&&c(e)||d&&d===e.keyCode)&&s++}if(o){;return s===a.length&&(n=e,r=Object.keys(tG).reduce((e,t)=>tG[t](n)?e+1:e,0),([16,17,18,91,92].includes(n.keyCode)?r:r+1)===a.length)}return s===a.length}var t$={RIGHTARROW:"→",LEFTARROW:"←",UPARROW:"↑",DOWNARROW:"↓",BACKSPACE:"Backspace",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab",SPACE:"Space",SHIFT:"⇧",PERIOD:".",SLASH:"/",BACKSLASH:"\\",EQUALS:"=",MINUS:"-",BRACKETLEFT:"[",BRACKETRIGHT:"]",QUOTE:"'",SEMICOLON:";",BACKQUOTE:"`",OPENBRACKET:"[",CLOSEBRACKET:"]",COMMA:","},t0=tX?(0,tv._)((0,tm._)({},t$),{META:"⌘",OPTION:"⌥",ALT:"⌥",CONTROL:"^"}):(0,tv._)((0,tm._)({},t$),{META:"Alt",CAPSLOCK:"⇪",CTRL:"Ctrl",ALT:"Alt"}),t1=e=>e.split(/\s+/).map(e=>{var t=e.toLocaleUpperCase();return t0[t]||t}),t2=e=>!!e.closest("div[contentEditable=true]")||"true"===e.contentEditable||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||!1;function t4(){var{shortcuts:e=[],label:t=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,tK.jsxs)("div",{className:"container",style:{display:"inline-flex",marginLeft:4,gap:4,cursor:"default",alignItems:"center",justifyContent:"center"},children:[(0,tK.jsx)("div",{children:t}),e.map((e,t)=>(0,tK.jsxs)(tK.Fragment,{children:[t>0&&(0,tK.jsx)("div",{children:"/"}),e.map(e=>(0,tK.jsx)("div",{className:"tag",style:{display:"inline-block",backgroundColor:"#6B6B75",padding:"0 8px",height:20,lineHeight:"20px",borderRadius:4},children:e},e))]}))]})}/(Macintosh|MacIntel|MacPPC|Mac68K|iPad)/.test(navigator.userAgent),(o=es||(es={})).isKeyEventMatch=tJ,o.getKeybindingLabel=t1,Symbol("KeybindingContribution");class t6{onInit(){}registerKeybinding(e){this.keybindings.push(e)}getMatchKeybinding(e){return this.keybindings.filter(t=>this.checkKeybindingMatchKeyEvent(e,t)&&this.checkKeybindingMatchContext(t))}checkKeybindingMatchKeyEvent(e,t){return es.isKeyEventMatch(e,t.keybinding)}checkKeybindingMatchContext(e){return!e.when||this.contextMatcher.match(e.when)}getKeybindingLabel(e){return es.getKeybindingLabel(e)}constructor(){this.keybindings=[]}}(0,e2.gn)([(0,e8.f)(e6),(0,e2.w6)("design:type",void 0===e6?Object:e6)],t6.prototype,"contextMatcher",void 0),t6=(0,e2.gn)([(0,e4.b)()],t6);var t5=Symbol("ShortcutsContribution");class t3{get enable(){return this._enable}set enable(e){this._enable=e}get shortcutsHandlers(){return Array.from(this.shortcutsHandlerMap.values())}init(){for(var e of this.contributions)e.registerShortcuts(this)}onInit(){document.addEventListener("keydown",this.listener)}onDispose(){document.removeEventListener("keydown",this.listener)}generateShortcutId(e){return[e.commandId,e.source,e.when].filter(Boolean).join()}registerHandlers(){for(var e=arguments.length,t=Array(e),n=0;n{var t=Array.isArray(e.keybinding)?e.keybinding:[e.keybinding],n=this.generateShortcutId(e);!this.shortcutsHandlerMap.has(n)&&this.shortcutsHandlerMap.set(n,(0,tv._)((0,tm._)({},e),{keybinding:[]}));var r=this.shortcutsHandlerMap.get(n),o=Array.isArray(r.keybinding)?r.keybinding:[r.keybinding],a=t.filter(e=>!o.includes(e));a.forEach(t=>{this.keybindingRegistry.registerKeybinding({keybinding:t,when:e.when,command:e.commandId,preventDefault:e.preventDefault})}),r.keybinding=[...new Set([...a,...o])],e.execute&&(this.commandRegistry.getCommand(e.commandId)?this.commandRegistry.updateCommand(e.commandId,{label:e.commandLabel}):this.commandRegistry.registerCommand({id:e.commandId,label:e.commandLabel},e))})}getShortcutHandlerByCommandId(e){return this.shortcutsHandlers.find(t=>t.commandId===e)}getLabelWithShortcutUI(e){var t=this.commandRegistry.getCommand(e),n=this.getShortcutHandlerByCommandId(e);if(t&&t.label){var r=t.shortLabel||t.label,o=this.getShortcutByCommandId(e);return n?(0,tK.jsx)(t4,{shortcuts:o,label:r}):r}return""}getLabelWithShortcutByCommandId(e){var{useShortLabel:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.commandRegistry.getCommand(e),r=this.getShortcutHandlerByCommandId(e);if(n&&n.label){var o=t&&n.shortLabel||n.label;if(r){var a=this.getShortcutByCommandId(e);return"".concat(o,"(").concat(a.map(e=>e.join("")).join("/"),")")}return o}return""}getShortcutByCommandId(e){var t=this.getShortcutHandlerByCommandId(e);return t?(Array.isArray(t.keybinding)?t.keybinding:[t.keybinding]).map(e=>this.getKeyDisplayLabel(e)):[]}getKeyDisplayLabel(e){return this.keybindingRegistry.getKeybindingLabel(e)}getShortcutsBySource(e){return this.shortcutsHandlers.filter(t=>t.source===e)}getKeybindingMatchKeyEvent(e,t){return e.filter(e=>this.keybindingRegistry.checkKeybindingMatchKeyEvent(t,e))}executeKeybinding(e,t){this.commandRegistry.executeCommand(e.command,e.args),e.preventDefault&&t.preventDefault()}constructor(){this.contributions=[],this.shortcutsHandlerMap=new Map,this._enable=!0,this.listener=e=>{if(!!this._enable){var t=this.keybindingRegistry.getMatchKeybinding(e);eX.kg.log("ShortcutsRegistry - listener",e,t),t.forEach(t=>{if(!t2(e.target)||!!t.when)this.executeKeybinding(t,e)})}}}}(0,e2.gn)([(0,e8.f)(t6),(0,e2.w6)("design:type",void 0===t6?Object:t6)],t3.prototype,"keybindingRegistry",void 0),(0,e2.gn)([(0,e8.f)(eX.Ho),(0,e2.w6)("design:type",void 0===eX.Ho?Object:eX.Ho)],t3.prototype,"commandRegistry",void 0),(0,e2.gn)([(0,tZ.n)(t5),(0,tY.j)(),(0,e2.w6)("design:type",Array)],t3.prototype,"contributions",void 0),(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],t3.prototype,"init",null),t3=(0,e2.gn)([(0,e4.b)()],t3);var t8=e0({onInit:(e,t)=>{e.get(t3).registerHandlers(...t.shortcuts||[])},containerModules:[new eQ.n(e=>{(0,eX.yb)(e,t5),e(t6).toSelf().inSingletonScope(),e(eG).toService(t6),e(t3).toSelf().inSingletonScope(),e(eG).toService(t3)})]}),t9=Symbol("PreferenceContribution");class t7{init(e){Object.assign(this.preferences,e),this.preferencesChange.fire()}setSchema(e){var{properties:t}=e;if(!!t&&!!(0,eX.Kn)(t))Object.entries(t).forEach(e=>{var[t,n]=e;if(this.schema.properties[t]){console.error("Preference name collision detected in the schema for property: ",t);return}this.schema.properties[t]=n})}getPreferenceData(e){return this.preferences[e]}constructor(){this.preferences={},this.schema={properties:{}},this.preferencesChange=new eX.Q5,this.onDidPreferencesChange=this.preferencesChange.event}}t7=(0,e2.gn)([(0,e4.b)()],t7);class ne{onInit(){this.preferenceContributions.getContributions().forEach(e=>{this.preferencesManager.setSchema(e.configuration)})}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(t9),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],ne.prototype,"preferenceContributions",void 0),(0,e2.gn)([(0,e8.f)(t7),(0,e2.w6)("design:type",void 0===t7?Object:t7)],ne.prototype,"preferencesManager",void 0),ne=(0,e2.gn)([(0,e4.b)()],ne);var nt=e0({onBind(e){var{bind:t}=e;t(t7).toSelf().inSingletonScope(),(0,eX.KV)(t,ne,[eG]),(0,eX.yb)(t,t9)},onInit(e,t){e.container.get(t7).init(null==t?void 0:t.defaultData)}}),nn="popstate",nr=e=>{var t=e.path.toString(),{query:n}=e;return n&&(t+="?".concat(n)),e.fragment&&(t+="#hash"),t};class ni{get state(){return this.history.state}get idx(){var e;return(null===(e=this.state)||void 0===e?void 0:e.fIdx)||null}init(){null===this.idx&&this.history.replaceState((0,tv._)((0,tm._)({},this.state),{fIdx:-1,uri:""}),""),this.window.addEventListener(nn,this.listener),this.disposable.push(eX.JT.create(()=>this.window.removeEventListener(nn,this.listener)))}push(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.idx+1,n={uri:e.toString(),fIdx:t},r=nr(e);try{this.history.pushState(n,"",r)}catch(e){this.window.location.assign(r)}}replace(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.idx,n={uri:toString(),fIdx:t},r=nr(e);this.history.replaceState(n,"",r)}go(e){return this.history.go(e)}dispose(){this.disposable.dispose()}constructor(){this.window=document.defaultView||window,this.history=this.window.history,this.onChangeEmitter=new eX.Q5,this.onChange=this.onChangeEmitter.event,this.disposable=new eX.K4(this.onChangeEmitter),this.listener=e=>{this.onChangeEmitter.fire(e.state||{})}}}class no{get location(){return this.stack[this.idx]}init(){this.history.init(),this.disposable.push(this.history.onChange(this.listener))}dispose(){this.disposable.dispose()}pushOrReplace(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.stack.length>this.idx+1&&(this.stack=this.stack.slice(0,this.idx+1)),t?this.replace(e):this.push(e)}push(e){if(eX.kg.log("navigation history push"),this.similar(e,this.location)){eX.kg.log("location is similar");return}this.stack.push(e),this.idx=this.stack.length-1,this.history.push(e.uri,this.idx),this.onChangeEmitter.fire(e)}replace(e){eX.kg.log("navigation history replace"),this.stack.splice(this.idx+1,0,e),this.idx=this.stack.length-1,this.history.replace(e.uri,this.idx),this.onChangeEmitter.fire(e)}go(e){var t=this.idx+e,n=this.stack[t];if(!(t>=this.stack.length)&&!(t<0)&&!!n)return this.idx=t,window.history.go(e),this.onChangeEmitter.fire(n),this.stack[this.idx]}back(){return this.go(-1)}canGoBack(){return this.idx>=1}forward(){return this.go(1)}canGoForward(){return this.idx>=0&&this.idx!==this.stack.length-1}similar(e,t){return void 0===e||void 0===t?e===t:e.uri.toString()===t.uri.toString()}constructor(){this.stack=[],this.idx=-1,this.history=new ni,this.onChangeEmitter=new eX.Q5,this.onPopstateEmitter=new eX.Q5,this.onDidHistoryChange=this.onChangeEmitter.event,this.onPopstate=this.onPopstateEmitter.event,this.disposable=new eX.K4(this.history,this.onChangeEmitter,this.onPopstateEmitter),this.listener=e=>{if(!e||!(0,eX.hj)(e.fIdx)||!e.uri)return;var{fIdx:t}=e;if(!(t>=this.stack.length)&&!(t<0))this.idx=t,this.onChangeEmitter.fire(this.location),this.onPopstateEmitter.fire(this.location)}}}no=(0,e2.gn)([(0,e4.b)()],no);class na{init(){this.history.init(),this.disposable.pushAll([this.history,this.history.onPopstate(e=>{this.openerService.open(e.uri)})])}goto(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this;return(0,e3._)(function*(){var o;o="string"==typeof e?new tD("".concat(r.scheme,"://").concat(e)):e,r.history.pushOrReplace({uri:o},t),yield r.openerService.open(o,n)})()}back(){var e=this;return(0,e3._)(function*(){var t=e.history.back();t&&(yield e.openerService.open(t.uri))})()}forward(){var e=this;return(0,e3._)(function*(){var t=e.history.forward();t&&(yield e.openerService.open(t.uri))})()}canGoBack(){return this.history.canGoBack()}canGoForward(){return this.history.canGoForward()}get uri(){var e;return null===(e=this.history.location)||void 0===e?void 0:e.uri}get onDidHistoryChange(){return this.history.onDidHistoryChange}setScheme(e){this.scheme=e}dispose(){this.disposable.dispose()}constructor(){this.disposable=new eX.K4,this.scheme="flowide"}}(0,e2.gn)([(0,e8.f)(ts),(0,e2.w6)("design:type",void 0===ts?Object:ts)],na.prototype,"openerService",void 0),(0,e2.gn)([(0,e8.f)(no),(0,e2.w6)("design:type",void 0===no?Object:no)],na.prototype,"history",void 0),na=(0,e2.gn)([(0,e4.b)()],na);class ns{onLayoutInit(){}onStart(){this.navigationService.init()}onDispose(){this.navigationService.dispose(),this._toDispose.dispose()}registerCommands(e){e.registerCommand({id:"navigation.forward",label:"Forward"},{execute:()=>{this.navigationService.forward()},isEnabled:()=>this.navigationService.canGoForward()}),e.registerCommand({id:"navigation.back",label:"Backward"},{execute:()=>{this.navigationService.back()},isEnabled:()=>this.navigationService.canGoBack()})}registerShortcuts(e){e.registerHandlers({keybinding:"control shift -",commandId:"navigation.forward",preventDefault:!0},{keybinding:"control -",commandId:"navigation.back",preventDefault:!0})}registerMouseNavigationListener(){this._toDispose.push((0,eX.Oo)(document.body,"mousedown",e=>{switch(e.button){case 3:this.navigationService.back();break;case 4:this.navigationService.forward()}}))}constructor(){this._toDispose=new eX.K4}}(0,e2.gn)([(0,e8.f)(na),(0,e2.w6)("design:type",void 0===na?Object:na)],ns.prototype,"navigationService",void 0),ns=(0,e2.gn)([(0,e4.b)()],ns);var nl=e0({onBind:e=>{var{bind:t}=e;t(no).toSelf().inSingletonScope(),t(na).toSelf().inSingletonScope(),(0,eX.KV)(t,ns,[eG,eX.pY,t5])},onInit(e,t){t.uriScheme&&e.container.get(na).setScheme(t.uriScheme)}}),nc={id:"flowide",type:"dark",label:"flow ide default theme"},nd={id:"flowide",type:"light",label:"flow ide default theme"};class nu{init(){this.changeWithPreferences(),this.preferencesManager.onDidPreferencesChange(()=>{this.changeWithPreferences()})}changeWithPreferences(){var e=this.preferencesManager.getPreferenceData("theme")||nc.type;this.themeChange.fire({next:(0,tv._)((0,tm._)({},nc),{type:e}),prev:this.current})}register(){for(var e=arguments.length,t=Array(e),n=0;nthis.themes.set(e.id,e)),eX.JT.create(()=>{t.forEach(e=>{e&&e===this.current&&this.setCurrent(nc.id),this.themes.delete(e.id)})})}setCurrent(e){var t=this.themes.get(e),n=this.current;t&&t!==n&&(this.current=t,this.themeChange.fire({next:t,prev:n}))}getCurrent(){return this.current}dispose(){this.themeChange.dispose()}constructor(){this.themes=new Map([[nc.type,nc],[nd.type,nd]]),this.current=nc,this.themeChange=new eX.Q5,this.onDidThemeChange=this.themeChange.event}}(0,e2.gn)([(0,e8.f)(t7),(0,e2.w6)("design:type",void 0===t7?Object:t7)],nu.prototype,"preferencesManager",void 0),nu=(0,e2.gn)([(0,e4.b)()],nu);var nh=Symbol("ColorContribution");class np{init(){this.colorContributions.getContributions().forEach(e=>{e.registerColors(this)})}register(){for(var e=arguments.length,t=Array(e),n=0;n{var{id:t}=e;return this.colors[t]=e,this.schema.properties[t]={type:"string",description:e.description},eX.JT.create(()=>this.deregisterColor(t))})}deregisterColor(e){delete this.colors[e],delete this.schema.properties[e]}getColors(){return Object.keys(this.colors).map(e=>this.colors[e])}getColor(e){return this.colors[e]}getThemeColor(e,t){var n=null===(r=this.getColor(e).defaults)||void 0===r?void 0:r[t];if(n&&"string"==typeof n&&!n.startsWith("#")&&!(null==n?void 0:n.startsWith("rgb"))){var r,o,a=this.colors[n];n=null==a?void 0:null===(o=a.defaults)||void 0===o?void 0:o[t]}return n}toCssColor(e,t){var n="--".concat(e.replace(/\./g,"-")),r=this.getThemeColor(e,t);return"".concat(n,": ").concat(r,";")}toCss(e){return"body {\n".concat(this.getColors().map(t=>this.toCssColor(t.id,e)).join("\n"),"\n}")}constructor(){this.colors={},this.schema={type:"object",properties:{}}}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(nh),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],np.prototype,"colorContributions",void 0),np=(0,e2.gn)([(0,e4.b)()],np);var nf={id:"flowide.color.base.white",defaults:{dark:"rgba(255, 255, 255)",light:"rgba(255, 255, 255)"}},nm={id:"flowide.color.base.bg.0",defaults:{dark:"rgba(22, 22, 26, 1)",light:"rgba(255, 255, 255)"}},nv={id:"flowide.color.base.bg.1",defaults:{dark:"rgba(35, 36, 41, 1)",light:"rgba(255, 255, 255)"}},ng={id:"flowide.color.base.bg.2",defaults:{dark:"rgba(53, 54, 60, 1)",light:"rgba(255, 255, 255)"}},nb={id:"flowide.color.base.text.0",defaults:{dark:"rgba(249,249,249)",light:"rgba(28,31,35)"}},ny={id:"flowide.color.base.text.1",defaults:{dark:"rgba(249,249,249, 0.8)",light:"rgba(28,31,35, 0.8)"}},n_={id:"flowide.color.base.text.2",defaults:{dark:"rgba(249,249,249, 0.6)",light:"rgba(28,31,35, 0.62)"}},nw={id:"flowide.color.base.border",defaults:{dark:"rgba(255, 255, 255, 0.08)",light:"rgba(28,31,35, 0.08)"}},nx={id:"flowide.color.menu.border",defaults:{dark:"#454545",light:"unset"}},nS={id:"flowide.color.menu.box.shadow",defaults:{dark:"rgba(0, 0, 0, 0.36)",light:"rgba(0, 0, 0, 0.16)"}},nk={id:"flowide.color.base.fill.0",defaults:{dark:"rgba(255,255,255, 0.12)",light:"rgba(46,50,56, 0.05)"}},nC={id:"flowide.color.base.fill.1",defaults:{dark:"rgba(255,255,255, 0.16)",light:"rgba(46,50,56, 0.09)"}},nj={id:"flowide.color.base.fill.2",defaults:{dark:"rgba(255,255,255, 0.2)",light:"rgba(46,50,56, 0.05)"}},nE={id:"flowide.color.base.primary",defaults:{dark:"rgb(84,169,255)",light:"rgb(0,100,250)"}},nT={id:"flowide.color.base.primary.hover",defaults:{dark:"rgb(127,193,255)",light:"rgb(0,98,214)"}},nI=[{id:"flowide.color.view.topBar.bg",defaults:{light:nm.id,dark:nm.id}}],nP=[...Object.values(eY),...nI],nM=Symbol("StylingContribution");class nR{apply(e){var t=[],n={type:e.type,label:e.label,getColor:t=>this.colorService.getThemeColor(t,e.type)},r={prefix:nR.PREFIX,add:e=>t.push(e)},o=eX.r4.createStyleElement("flowide-styles");this.stylingContributions.getContributions().forEach(e=>{e.registerStyle(r,n)});var a=t.join("\n");return o.innerHTML=a,this.clear(),this.cssElement=o,eX.JT.create(()=>{this.clear()})}register(e,t){var n=this.css.get(e)||eX.r4.createStyleElement(e);return n.innerHTML=t,this.css.set(e,n),eX.JT.create(()=>{document.head.removeChild(n),this.css.delete(e)})}clear(){this.cssElement&&(document.head.removeChild(this.cssElement),this.cssElement=void 0)}dispose(){this.clear()}constructor(){this.css=new Map}}nR.PREFIX="flowide",(0,e2.gn)([(0,e8.f)(nu),(0,e2.w6)("design:type",void 0===nu?Object:nu)],nR.prototype,"themeService",void 0),(0,e2.gn)([(0,e8.f)(np),(0,e2.w6)("design:type",void 0===np?Object:np)],nR.prototype,"colorService",void 0),(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(nM),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],nR.prototype,"stylingContributions",void 0),nR=(0,e2.gn)([(0,e4.b)()],nR);class nD{registerColors(e){e.register(...nP)}registerStyle(e,t){var{add:n}=e,{type:r}=t;n(this.colorService.toCss(r))}onLoading(){var e=this;return(0,e3._)(function*(){e.colorService.init(),e.themeService.onDidThemeChange(t=>{e.stylingService.apply(t.next),e.ready.resolve()}),e.themeService.init(),yield e.ready.promise,eX.kg.log("theme loaded")})()}onDispose(){this.themeService.dispose(),this.stylingService.dispose()}constructor(){this.ready=new eX.BH}}(0,e2.gn)([(0,e8.f)(np),(0,e2.w6)("design:type",void 0===np?Object:np)],nD.prototype,"colorService",void 0),(0,e2.gn)([(0,e8.f)(nu),(0,e2.w6)("design:type",void 0===nu?Object:nu)],nD.prototype,"themeService",void 0),(0,e2.gn)([(0,e8.f)(nR),(0,e2.w6)("design:type",void 0===nR?Object:nR)],nD.prototype,"stylingService",void 0),nD=(0,e2.gn)([(0,e4.b)()],nD);var nA=e0({onBind(e){var{bind:t}=e;t(nu).toSelf().inSingletonScope(),t(nR).toSelf().inSingletonScope(),t(np).toSelf().inSingletonScope(),(0,eX.yb)(t,nM),(0,eX.yb)(t,nh),(0,eX.KV)(t,nD,[eG,nM,nh])}}),nN=Symbol("LabelHandler"),nL=Symbol("LabelService");class nz{onInit(){for(var e of this.contributionProvider.getContributions())e.onChange&&e.onChange(e=>{this.onChangeEmitter.fire({affects:t=>this.affects(t,e)})})}getIcon(e){for(var t of this.findContribution(e)){var n=t.getIcon&&t.getIcon(e);if(void 0!==n)return n}return""}renderer(e,t){var n=this.findContribution(e).find(e=>e.renderer);return n&&n.renderer?n.renderer(e,t):null}getName(e){for(var t of this.findContribution(e)){var n=t.getName&&t.getName(e);if(void 0!==n)return n}return""}getDescription(e){for(var t of this.findContribution(e)){var n=t.getDescription&&t.getDescription(e);if(void 0!==n)return n}return""}affects(e,t){if(t.affects(e))return!0;for(var n of this.findContribution(e))if(n.affects&&n.affects(e,t))return!0;return!1}findContribution(e){return tr(this.contributionProvider.getContributions(),t=>t.canHandle(e)).map(e=>e.value)}get onChange(){return this.onChangeEmitter.event}constructor(){this.onChangeEmitter=new eX.Q5}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(nN),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],nz.prototype,"contributionProvider",void 0),nz=(0,e2.gn)([(0,e4.b)()],nz);var nO=e0({onBind:(e,t)=>{var{bind:n}=e;(0,eX.KV)(n,nz,[eG]),n(nL).toService(nz),(0,eX.yb)(n,nN),t.handlers&&t.handlers.forEach(e=>{"function"==typeof e?(n(e).toSelf().inSingletonScope(),n(nN).toService(e)):n(nN).toConstantValue(e)})}}),nB=tq.createContext({});function nW(){return tq.useContext(nB)}function nF(e){return nW().get(e)}var nH=Symbol("IDERendererProvider"),nU=e=>{var{className:t}=e,n=nW().get(nH);return(0,tK.jsx)(n,{className:t})},nV=n("630243"),nK=(0,tq.forwardRef)((e,t)=>{var{containerModules:n,customPluginContext:r,container:o,plugins:a}=e,s=(0,tq.useMemo)(()=>{var e,t,s,l=o||new nV.W;if(l.load(tN),n&&n.forEach(e=>l.load(e)),r&&l.rebind(eJ).toConstantValue(r(l)),a){;e=a(l.get(eJ)),t=l,s=new Set,e.reduce((e,t)=>{if(!s.has(t.pluginId)&&(t.initPlugin(),s.add(t.pluginId)),t.containerModules&&t.containerModules.length>0)for(var n of t.containerModules)!e.includes(n)&&e.push(n);return e},[]).forEach(e=>t.load(e)),e.forEach(e=>{if(e.contributionKeys)for(var n of e.contributionKeys)t.bind(n).toConstantValue(e.options)})}return l.get(tA).init(),l},[]);return(0,tq.useEffect)(()=>{var e=s.get(tA);return e.start(),()=>{e.dispose()}},[s]),(0,tq.useImperativeHandle)(t,()=>({getContainer:()=>s})),(0,tK.jsx)(nB.Provider,{value:s,children:e.children})}),nq=()=>{var e=nF(nu),[t,n]=(0,tq.useState)(e.getCurrent());return(0,tq.useEffect)(()=>{var t=e.onDidThemeChange(e=>{var{next:t}=e;n(t)});return()=>t.dispose()},[]),{theme:t}},nZ=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=nF(nR),o=nF(np),{theme:a}=nq();(0,tq.useEffect)(()=>{var n=t({prefix:"flowide"},{type:a.type,label:a.label,getColor:e=>o.getThemeColor(e,a.type)}),s=r.register(e,n);return()=>s.dispose()},[e,a,...n])},nY=Symbol("EventService"),nX=Symbol("EventContribution");class nQ{onDispose(){this.toDispose.dispose()}onInit(){for(var e of this.contributions)e.registerEvent(this)}listenGlobalEvent(e,t,n){return this._listenEvent(e,t,n)}_listenEvent(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.globalEvents,o=r[e];if(!o){var a={handleEvent:e=>{for(var t=o.handlers,n=0,r=t.length;n{window.removeEventListener(e,a),delete r[e]}}}var{handlers:s}=o,l={handle:t,priority:n};s.unshift(l),s.sort((e,t)=>t.priority-e.priority);var c=eX.JT.create(()=>{var e=o.handlers.indexOf(l);-1!==e&&o.handlers.splice(e,1),0===o.handlers.length&&o.dispose()});return this.toDispose.push(c),c}constructor(){this.toDispose=new eX.K4,this.globalEvents={}}}(0,e2.gn)([(0,tZ.n)(nX),(0,tY.j)(),(0,e2.w6)("design:type",Array)],nQ.prototype,"contributions",void 0),nQ=(0,e2.gn)([(0,e4.b)()],nQ);var nG=e0({containerModules:[new eQ.n(e=>{(0,eX.yb)(e,nX),e(nY).toService(nQ),(0,eX.KV)(e,nQ,[eG])})]});function nJ(e){return getComputedStyle(e)}function n$(e,t){for(var n in t){var r=t[n];"number"==typeof r&&(r="".concat(r,"px")),e.style[n]=r}return e}function n0(e){var t=document.createElement("div");return t.className=e,t}var n1="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function n2(e,t){if(!n1)throw Error("No element matching method supported");return n1.call(e,t)}function n4(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function n6(e,t){return Array.prototype.filter.call(e.children,e=>n2(e,t))}function n5(e){return parseInt(e,10)||0}var n3={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)},n8={main:"ide-ps",rtl:"ide-ps__rtl",element:{thumb:e=>"ide-ps__thumb-".concat(e),rail:e=>"ide-ps__rail-".concat(e),consuming:"ide-ps__child--consume"},state:{focus:"ide-ps--focus",clicking:"ide-ps--clicking",active:e=>"ide-ps--active-".concat(e),scrolling:e=>"ide-ps--scrolling-".concat(e)}},n9={x:null,y:null};function n7(e,t){var n=e.element.classList,r=n8.state.scrolling(t);n.contains(r)?clearTimeout(n9[t]):n.add(r)}function re(e,t){n9[t]=setTimeout(()=>e.isAlive&&e.element.classList.remove(n8.state.scrolling(t)),e.settings.scrollingThreshold)}function rt(e,t){var{element:n}=e,r=Math.floor(n.scrollTop),o=n.getBoundingClientRect();e.containerWidth=Math.round(o.width),e.containerHeight=Math.round(o.height),e.contentWidth=n.scrollWidth,e.contentHeight=n.scrollHeight,!n.contains(e.scrollbarXRail)&&(!t||"x"===t)&&(n6(n,n8.element.rail("x")).forEach(e=>n4(e)),n.appendChild(e.scrollbarXRail)),!n.contains(e.scrollbarYRail)&&(!t||"y"===t)&&(n6(n,n8.element.rail("y")).forEach(e=>n4(e)),n.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),function(e,t){var n={width:t.railXWidth},r=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-r:n.top=t.scrollbarXTop+r,n$(t.scrollbarXRail,n);var o={top:r,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?o.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:o.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?o.left=t.negativeScrollAdjustment+e.scrollLeft+2*t.containerWidth-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:o.left=t.scrollbarYLeft+e.scrollLeft,n$(t.scrollbarYRail,o),n$(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),n$(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}(n,e),e.scrollbarXActive?n.classList.add(n8.state.active("x")):(n.classList.remove(n8.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,n.scrollLeft=!0===e.isRtl?e.contentWidth:0),e.scrollbarYActive?n.classList.add(n8.state.active("y")):(n.classList.remove(n8.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,n.scrollTop=0)}function rn(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function rr(e){if("function"==typeof window.CustomEvent)return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function ri(e,t,n){var r,o=!(arguments.length>3)||void 0===arguments[3]||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if("top"===t)r=["contentHeight","containerHeight","scrollTop","y","up","down"];else if("left"===t)r=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw Error("A proper axis should be provided");(function(e,t,n){var r,o,[a,s,l,c,d,u]=n,h=!(arguments.length>3)||void 0===arguments[3]||arguments[3],p=arguments.length>4&&void 0!==arguments[4]&&arguments[4],{element:f}=e;if(e.reach[c]=null,f[l]<1&&(e.reach[c]="start"),f[l]>e[a]-e[s]-1&&(e.reach[c]="end"),t&&(f.dispatchEvent(rr("ide-ps-scroll-".concat(c))),t<0?f.dispatchEvent(rr("ide-ps-scroll-".concat(d))):t>0&&f.dispatchEvent(rr("ide-ps-scroll-".concat(u))),h)){;n7(r=e,o=c),re(r,o)}e.reach[c]&&(t||p)&&f.dispatchEvent(rr("ide-ps-".concat(c,"-reach-").concat(e.reach[c])))})(e,n,r,o,a)}class ro{bind(e,t){void 0===this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)}unbind(e,t){this.handlers[e]=this.handlers[e].filter(n=>!!t&&n!==t||(this.element.removeEventListener(e,n,!1),!1))}unbindAll(){for(var e in this.handlers)this.unbind(e)}get isEmpty(){return Object.keys(this.handlers).every(e=>0===this.handlers[e].length)}constructor(e){this.element=e,this.handlers={}}}class ra{eventElement(e){var t=this.eventElements.filter(t=>t.element===e)[0];return!t&&(t=new ro(e),this.eventElements.push(t)),t}bind(e,t,n){this.eventElement(e).bind(t,n)}unbind(e,t,n){var r=this.eventElement(e);r.unbind(t,n),r.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(r),1)}unbindAll(){this.eventElements.forEach(e=>e.unbindAll()),this.eventElements=[]}once(e,t,n){var r=this.eventElement(e),o=e=>{r.unbind(t,o),n(e)};r.bind(t,o)}constructor(){this.eventElements=[]}}function rs(e,t){var[n,r,o,a,s,l,c,d,u]=t,{element:h}=e,p=null,f=null,m=null;function v(t){t.touches&&t.touches[0]&&(t[o]=t.touches[0].pageY),h[c]=p+m*(t[o]-f),n7(e,d),rt(e),t.stopPropagation(),t.type.startsWith("touch")&&t.changedTouches.length>1&&t.preventDefault()}function g(){re(e,d),e[u].classList.remove(n8.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",v)}function b(t,s){p=h[c],s&&t.touches&&(t[o]=t.touches[0].pageY),f=t[o],m=(e[r]-e[n])/(e[a]-e[l]),s?e.event.bind(e.ownerDocument,"touchmove",v):(e.event.bind(e.ownerDocument,"mousemove",v),e.event.once(e.ownerDocument,"mouseup",g),t.preventDefault()),e[u].classList.add(n8.state.clicking),t.stopPropagation()}e.event.bind(e[s],"mousedown",e=>{b(e)}),e.event.bind(e[s],"touchstart",e=>{b(e,!0)})}var rl=()=>({handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}),rc={"click-rail":e=>{var{element:t}=e;e.event.bind(e.scrollbarYRail,"mousedown",e=>{var t=e.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top>e.scrollbarYTop?1:-1;e.element.scrollTop+=t*e.containerHeight,rt(i),e.stopPropagation()}),e.event.bind(e.scrollbarY,"mousedown",e=>e.stopPropagation()),e.event.bind(e.scrollbarX,"mousedown",e=>e.stopPropagation()),e.event.bind(e.scrollbarXRail,"mousedown",e=>{var t=e.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=t*e.containerWidth,rt(i),e.stopPropagation()})},"drag-thumb":function(e){rs(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),rs(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(e){var{element:t}=e;e.event.bind(e.ownerDocument,"keydown",n=>{if(n.isDefaultPrevented&&n.isDefaultPrevented()||n.defaultPrevented||!n2(t,":hover")&&!(n2(e.scrollbarX,":focus")||n2(e.scrollbarY,":focus")))return;var r,o=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(o){;if("IFRAME"===o.tagName)o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(n2(r=o,"input,[contenteditable]")||n2(r,"select,[contenteditable]")||n2(r,"textarea,[contenteditable]")||n2(r,"button,[contenteditable]"))return}var a=0,s=0;switch(n.which){case 37:a=n.metaKey?-e.contentWidth:n.altKey?-e.containerWidth:-30;break;case 38:s=n.metaKey?e.contentHeight:n.altKey?e.containerHeight:30;break;case 39:a=n.metaKey?e.contentWidth:n.altKey?e.containerWidth:30;break;case 40:s=n.metaKey?-e.contentHeight:n.altKey?-e.containerHeight:-30;break;case 32:s=n.shiftKey?e.containerHeight:-e.containerHeight;break;case 33:s=e.containerHeight;break;case 34:s=-e.containerHeight;break;case 36:s=e.contentHeight;break;case 35:s=-e.contentHeight;break;default:return}if((!e.settings.suppressScrollX||0===a)&&(!e.settings.suppressScrollY||0===s))t.scrollTop-=s,t.scrollLeft+=a,rt(e),function(n,r){var o=Math.floor(t.scrollTop);if(0===n){if(!e.scrollbarYActive)return!1;if(0===o&&r>0||o>=e.contentHeight-e.containerHeight&&r<0)return!e.settings.wheelPropagation}var{scrollLeft:a}=t;if(0===r){if(!e.scrollbarXActive)return!1;if(0===a&&n<0||a>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}(a,s)&&n.preventDefault()})},wheel:function(e){var{element:t}=e;function n(n){var r,o,a,s,l,c,d,u,[h,p]=function(e){var{deltaX:t}=e,n=-1*e.deltaY;return((void 0===t||void 0===n)&&(t=-1*e.wheelDeltaX/6,n=e.wheelDeltaY/6),e.deltaMode&&1===e.deltaMode&&(t*=10,n*=10),t!=t&&n!=n&&(t=0,n=e.wheelDelta),e.shiftKey)?[-n,-t]:(Math.abs(n)>Math.abs(t)&&(t=0),Math.abs(t)>Math.abs(n)&&(n=0),[t,n])}(n);if(!function(e,n,r){if(!n3.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(e))return!1;for(var o=e;o&&o!==t;){if(o.classList.contains(n8.element.consuming))return!0;var a=nJ(o);if(r&&a.overflowY.match(/(scroll|auto)/)){var s=o.scrollHeight-o.clientHeight;if(s>0&&(o.scrollTop>0&&r<0||o.scrollTop0))return!0}if(n&&a.overflowX.match(/(scroll|auto)/)){var l=o.scrollWidth-o.clientWidth;if(l>0&&(o.scrollLeft>0&&n<0||o.scrollLeft0))return!0}o=o.parentNode}return!1}(n.target,h,p)){var f=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(p?t.scrollTop-=p*e.settings.wheelSpeed:t.scrollTop+=h*e.settings.wheelSpeed,f=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(h?t.scrollLeft+=h*e.settings.wheelSpeed:t.scrollLeft-=p*e.settings.wheelSpeed,f=!0):(t.scrollTop-=p*e.settings.wheelSpeed,t.scrollLeft+=h*e.settings.wheelSpeed),rt(e),(f=f||(r=h,o=p,s=Math.floor(t.scrollTop),l=0===t.scrollTop,c=s+t.offsetHeight===t.scrollHeight,d=0===t.scrollLeft,u=t.scrollLeft+t.offsetWidth===t.scrollWidth,!(a=Math.abs(o)>Math.abs(r)?l||c:d||u)||!e.settings.wheelPropagation))&&!n.ctrlKey&&(n.stopPropagation(),n.preventDefault())}}void 0!==window.onwheel?e.event.bind(t,"wheel",n):void 0!==window.onmousewheel&&e.event.bind(t,"mousewheel",n)},touch:function(e){if(!!n3.supportsTouch||!!n3.supportsIePointer){var{element:t}=e;var n={},r=0,o={},a=null;n3.supportsTouch?(e.event.bind(t,"touchstart",d),e.event.bind(t,"touchmove",u),e.event.bind(t,"touchend",h)):n3.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",d),e.event.bind(t,"pointermove",u),e.event.bind(t,"pointerup",h)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",d),e.event.bind(t,"MSPointerMove",u),e.event.bind(t,"MSPointerUp",h)))}function s(n,r){t.scrollTop-=r,t.scrollLeft-=n,rt(e)}function l(e){return e.targetTouches?e.targetTouches[0]:e}function c(e){return(!e.pointerType||"pen"!==e.pointerType||0!==e.buttons)&&(!!e.targetTouches&&1===e.targetTouches.length||!!e.pointerType&&"mouse"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_MOUSE||!1)}function d(e){if(!!c(e)){var t=l(e);n.pageX=t.pageX,n.pageY=t.pageY,r=new Date().getTime(),null!==a&&clearInterval(a)}}function u(a){if(c(a)){var d=l(a),u={pageX:d.pageX,pageY:d.pageY},h=u.pageX-n.pageX,p=u.pageY-n.pageY;if(!function(e,n,r){if(!t.contains(e))return!1;for(var o=e;o&&o!==t;){if(o.classList.contains(n8.element.consuming))return!0;var a=nJ(o);if(r&&a.overflowY.match(/(scroll|auto)/)){var s=o.scrollHeight-o.clientHeight;if(s>0&&(o.scrollTop>0&&r<0||o.scrollTop0))return!0}if(n&&a.overflowX.match(/(scroll|auto)/)){var l=o.scrollWidth-o.clientWidth;if(l>0&&(o.scrollLeft>0&&n<0||o.scrollLeft0))return!0}o=o.parentNode}return!1}(a.target,h,p)){s(h,p),n=u;var f=new Date().getTime(),m=f-r;m>0&&(o.x=h/m,o.y=p/m,r=f),function(n,r){var o=Math.floor(t.scrollTop),{scrollLeft:a}=t,s=Math.abs(n),l=Math.abs(r);if(l>s){if(r<0&&o===e.contentHeight-e.containerHeight||r>0&&0===o)return 0===window.scrollY&&r>0&&n3.isChrome}else s>l&&(n<0&&a===e.contentWidth-e.containerWidth||n>0);return!0}(h,p)&&a.preventDefault()}}}function h(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){if(e.isInitialized||!o.x&&!o.y||.01>Math.abs(o.x)&&.01>Math.abs(o.y)||!e.element){clearInterval(a);return}s(30*o.x,30*o.y),o.x*=.8,o.y*=.8},10))}}};class rd{update(){if(!!this.isAlive)this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,n$(this.scrollbarXRail,{display:"block"}),n$(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=n5(nJ(this.scrollbarXRail).marginLeft)+n5(nJ(this.scrollbarXRail).marginRight),this.railYMarginHeight=n5(nJ(this.scrollbarYRail).marginTop)+n5(nJ(this.scrollbarYRail).marginBottom),n$(this.scrollbarXRail,{display:"none"}),n$(this.scrollbarYRail,{display:"none"}),rt(this),ri(this,"top",0,!1,!0),ri(this,"left",0,!1,!0),n$(this.scrollbarXRail,{display:""}),n$(this.scrollbarYRail,{display:""})}onScroll(e){if(!!this.isAlive)rt(this),ri(this,"top",this.element.scrollTop-this.lastScrollTop),ri(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft}destroy(){if(!!this.isAlive)this.event.unbindAll(),n4(this.scrollbarX),n4(this.scrollbarY),n4(this.scrollbarXRail),n4(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1}removePsClasses(){this.element.className=this.element.className.split(" ").filter(e=>!e.match(/^ps([-_].+|)$/)).join(" ")}constructor(e,t={}){if("string"==typeof e&&(e=document.querySelector(e)),!e||!e.nodeName)throw Error("no element is specified to initialize PerfectScrollbar");for(var n in this.element=e,e.classList.add(n8.main),this.settings=rl(),t)this.settings[n]=t[n];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var r,o,a,s=()=>e.classList.add(n8.state.focus),l=()=>e.classList.remove(n8.state.focus);this.isRtl="rtl"===nJ(e).direction,!0===this.isRtl&&e.classList.add(n8.rtl),this.isNegativeScroll=(r=e.scrollLeft,o=null,e.scrollLeft=-1,o=e.scrollLeft<0,e.scrollLeft=r,o),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new ra,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=n0(n8.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=n0(n8.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",l),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var c=nJ(this.scrollbarXRail);this.scrollbarXBottom=parseInt(c.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=n5(c.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=n5(c.borderLeftWidth)+n5(c.borderRightWidth),n$(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=n5(c.marginLeft)+n5(c.marginRight),n$(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=n0(n8.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=n0(n8.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",l),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var d=nJ(this.scrollbarYRail);this.scrollbarYRight=parseInt(d.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=n5(d.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?n5((a=nJ(this.scrollbarY)).width)+n5(a.paddingLeft)+n5(a.paddingRight)+n5(a.borderLeftWidth)+n5(a.borderRightWidth):null,this.railBorderYWidth=n5(d.borderTopWidth)+n5(d.borderBottomWidth),n$(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=n5(d.marginTop)+n5(d.marginBottom),n$(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(e=>rc[e](this)),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",e=>this.onScroll(e)),rt(this)}}var ru=n("784221"),rh=n("252497"),rp=n("30316");function rf(){return function(e,t,n){var r=new rh.S(ru.Mx,!0);(0,rp.D0)(e,t,n,r)}}class rm{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}(a=el||(el={})).calc=function(e,t){var n=e.length;if(0===n)return t;for(var r=0,o=0,a=0,s=0,l=0,c=0;c0&&(s+=d.stretch,l++)}if(t===a)return 0;if(t<=r){for(var f=0;f=o){for(var v=0;v0&&y>.01;){for(var _=y,w=s,x=0;x0&&y>.01;){for(var C=y/b,j=0;j0&&T>.01;){for(var I=T,P=s,M=0;M=R.maxSize?(T-=R.maxSize-R.size,s-=R.stretch,R.size=R.maxSize,R.done=!0,b--,l--):(T-=D,R.size+=D)}}}for(;b>0&&T>.01;){for(var A=T/b,N=0;N=L.maxSize?(T-=L.maxSize-L.size,L.size=L.maxSize,L.done=!0,b--):(T-=A,L.size+=A)}}}return 0},a.adjust=function(e,t,n){if(0!==e.length&&0!==n)n>0?function(e,t,n){for(var r=0,o=0;o<=t;++o){var a=e[o];r+=a.maxSize-a.size}for(var s=0,l=t+1,c=e.length;l=0&&u>0;--h){var p=e[h],f=p.maxSize-p.size;f>=u?(p.sizeHint=p.size+u,u=0):(p.sizeHint=p.size+f,u-=f)}for(var m=n,v=t+1,g=e.length;v0;++v){var b=e[v],y=b.size-b.minSize;y>=m?(b.sizeHint=b.size-m,m=0):(b.sizeHint=b.size-y,m-=y)}}(e,t,n):function(e,t,n){for(var r=0,o=t+1,a=e.length;o0;++h){var f=e[h],m=f.maxSize-f.size;m>=u?(f.sizeHint=f.size+u,u=0):(f.sizeHint=f.size+m,u-=m)}for(var v=n,g=t;g>=0&&v>0;--g){var b=e[g],y=b.size-b.minSize;y>=v?(b.sizeHint=b.size-v,v=0):(b.sizeHint=b.size-y,v-=y)}}(e,t,-n)};class rv{get(e){var t,n=ec.ensureMap(e);return t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e)}set(e,t){var n,r=ec.ensureMap(e);n=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(e);var o=this._coerceValue(e,t);this._maybeNotify(e,n,r[this._pid]=o)}coerce(e){var t,n=ec.ensureMap(e);t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e);var r=this._coerceValue(e,t);this._maybeNotify(e,t,n[this._pid]=r)}_createValue(e){return(0,this._create)(e)}_coerceValue(e,t){var n=this._coerce;return n?n(e,t):t}_compareValue(e,t){var n=this._compare;return n?n(e,t):e===t}_maybeNotify(e,t,n){var r=this._changed;r&&!this._compareValue(t,n)&&r(e,t,n)}constructor(e){this._pid=ec.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}}(rv||(rv={})).clearData=function(e){ec.ownerData.delete(e)},(s=ec||(ec={})).ownerData=new WeakMap,s.nextPID=(l=0,()=>{var e=Math.random(),t="".concat(e).slice(2);return"pid-".concat(t,"-").concat(l++)}),s.ensureMap=function(e){var t=s.ownerData.get(e);return t?t:(t=Object.create(null),s.ownerData.set(e,t),t)};class rg{get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){for(var e=this._first;e;)yield e.value,e=e.next}*retro(){for(var e=this._last;e;)yield e.value,e=e.prev}*nodes(){for(var e=this._first;e;)yield e,e=e.next}*retroNodes(){for(var e=this._last;e;)yield e,e=e.prev}assign(e){for(var t of(this.clear(),e))this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){var t=new ed.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){var t=new ed.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t):this._first=t,this._last=t,this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof ed.LinkedListNode)||t.list!==this)throw Error("Reference node is not owned by the list.");var n=new ed.LinkedListNode(this,e),r=t.prev;return n.next=t,n.prev=r,t.prev=n,r.next=n,this._size++,n}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof ed.LinkedListNode)||t.list!==this)throw Error("Reference node is not owned by the list.");var n=new ed.LinkedListNode(this,e),r=t.next;return n.next=r,n.prev=t,t.next=n,r.prev=n,this._size++,n}removeFirst(){var e=this._first;if(!!e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){var e=this._last;if(!!e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof ed.LinkedListNode)||e.list!==this)throw Error("Node is not owned by the list.");e===this._first&&e===this._last?(this._first=null,this._last=null):e===this._first?(this._first=e.next,this._first.prev=null):e===this._last?(this._last=e.prev,this._last.next=null):(e.next.prev=e.prev,e.prev.next=e.next),e.list=null,e.next=null,e.prev=null,this._size--}clear(){for(var e=this._first;e;){var{next:t}=e;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}constructor(){this._first=null,this._last=null,this._size=0}}function*rb(){}function ry(e,t){var n=0;for(var r of e)if(t(r,n++))return r}(c=rg||(rg={})).from=function(e){var t=new c;return t.assign(e),t},(ed||(ed={})).LinkedListNode=class e{constructor(e,t){this.list=null,this.next=null,this.prev=null,this.list=e,this.value=t}},!function(e){function t(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=e.length;if(0===a)return -1;r=r<0?Math.max(0,r+a):Math.min(r,a-1),n=(o=o<0?Math.max(0,o+a):Math.min(o,a-1))2&&void 0!==arguments[2]?arguments[2]:-1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=e.length;if(0===a)return -1;n=(r=r<0?Math.max(0,r+a):Math.min(r,a-1))<(o=o<0?Math.max(0,o+a):Math.min(o,a-1))?r+1+(a-o):r-o+1;for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=e.length;if(0===a)return -1;r=r<0?Math.max(0,r+a):Math.min(r,a-1),n=(o=o<0?Math.max(0,o+a):Math.min(o,a-1))2&&void 0!==arguments[2]?arguments[2]:-1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=e.length;if(0===a)return -1;n=(r=r<0?Math.max(0,r+a):Math.min(r,a-1))<(o=o<0?Math.max(0,o+a):Math.min(o,a-1))?r+1+(a-o):r-o+1;for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=r(e,t,n,o);return -1!==a?e[a]:void 0};e.findLastValue=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=o(e,t,n,r);return -1!==a?e[a]:void 0};e.lowerBound=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.length;if(0===a)return 0;for(var s=r=r<0?Math.max(0,r+a):Math.min(r,a-1),l=(o=o<0?Math.max(0,o+a):Math.min(o,a-1))-r+1;l>0;){var c=l>>1,d=s+c;0>n(e[d],t)?(s=d+1,l-=c+1):l=c}return s};e.upperBound=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.length;if(0===a)return 0;for(var s=r=r<0?Math.max(0,r+a):Math.min(r,a-1),l=(o=o<0?Math.max(0,o+a):Math.min(o,a-1))-r+1;l>0;){var c=l>>1,d=s+c;n(e[d],t)>0?l=c:(s=d+1,l-=c+1)}return s};e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(var r=0,o=e.length;r1&&void 0!==arguments[1]?arguments[1]:{},{start:r,stop:o,step:a}=n;if(void 0===a&&(a=1),0===a)throw Error("Slice `step` cannot be zero.");var s=e.length;void 0===r?r=a<0?s-1:0:r<0?r=Math.max(r+s,a<0?-1:0):r>=s&&(r=a<0?s-1:s),void 0===o?o=a<0?-1:s:o<0?o=Math.max(o+s,a<0?-1:0):o>=s&&(o=a<0?s-1:s),t=a<0&&o>=r||a>0&&r>=o?0:a<0?Math.floor((o-r+1)/a+1):Math.floor((o-r-1)/a+1);for(var l=[],c=0;c1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=e.length;if(!(r<=1))for(t=t<0?Math.max(0,t+r):Math.min(t,r-1),n=n<0?Math.max(0,n+r):Math.min(n,r-1);t2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=e.length;if(o<=1||(n=n<0?Math.max(0,n+o):Math.min(n,o-1))>=(r=r<0?Math.max(0,r+o):Math.min(r,o-1)))return;var s=r-n+1;if(t>0?t%=s:t<0&&(t=(t%s+s)%s),0!==t){var l=n+t;a(e,n,l-1),a(e,l,r),a(e,n,r)}};e.fill=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=e.length;if(0!==a){r=r<0?Math.max(0,r+a):Math.min(r,a-1),n=(o=o<0?Math.max(0,o+a):Math.min(o,a-1))=n)){for(var r=e[t],o=t+1;ot;--o)e[o]=e[o-1];e[t]=n},e.removeAt=s;e.removeFirstOf=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=t(e,n,r,o);return -1!==a&&s(e,a),a};e.removeLastOf=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=n(e,t,r,o);return -1!==a&&s(e,a),a};e.removeAllOf=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=e.length;if(0===o)return 0;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=r<0?Math.max(0,r+o):Math.min(r,o-1);for(var a=0,s=0;s=n&&s<=r&&e[s]===t?a++:r=n)&&e[s]===t?a++:a>0&&(e[s-a]=e[s]);return a>0&&(e.length=o-a),a};e.removeFirstWhere=function(e,t){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,l=r(e,t,o,a);return -1!==l&&(n=s(e,l)),{index:l,value:n}};e.removeLastWhere=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,l=o(e,t,r,a);return -1!==l&&(n=s(e,l)),{index:l,value:n}};e.removeAllWhere=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=e.length;if(0===o)return 0;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=r<0?Math.max(0,r+o):Math.min(r,o-1);for(var a=0,s=0;s=n&&s<=r&&t(e[s],s)?a++:r=n)&&t(e[s],s)?a++:a>0&&(e[s-a]=e[s]);return a>0&&(e.length=o-a),a}}(eu||(eu={}));(eh||(eh={})).rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||e2&&void 0!==arguments[2]?arguments[2]:0,r=Array(t.length),o=0,a=n,s=t.length;o2&&void 0!==arguments[2]?arguments[2]:0,o=t(e,n,r);if(!o)return null;for(var a=0,s=0,l=o.length;s2&&void 0!==arguments[2]?arguments[2]:0,o=t(e,n,r);if(!o)return null;for(var a=0,s=r-1,l=0,c=o.length;lt?1:0}}(ep||(ep={}));class r_{get isConflatable(){return!1}conflate(e){return!1}constructor(e){this.type=e}}class rw extends r_{get isConflatable(){return!0}conflate(e){return!0}}function rx(e,t){this.v=e,this.k=t}!function(e){let t;var n=null;var r=(t=Promise.resolve(),e=>{var n=!1;return t.then(()=>!n&&e()),()=>{n=!0}});function o(e,t){var n=s.get(e);if(!n||0===n.length){u(e,t);return}(function(e,t){var n=0;for(var r of e)if(!1===t(r,n++))return!1;return!0})(function*(e){if("function"==typeof e.retro)yield*e.retro();else for(var t=e.length-1;t>-1;t--)yield e[t]}(n),n=>!n||function(e,t,n){var r=!0;try{r="function"==typeof e?e(t,n):e.messageHook(t,n)}catch(e){c(e)}return r}(n,e,t))&&u(e,t)}e.sendMessage=o;e.postMessage=function(e,t){if(!t.isConflatable){h(e,t);return}!function(e,t){var n=0;for(var r of e)if(t(r,n++))return!0;return!1}(a,n=>n.handler===e&&!!n.msg&&n.msg.type===t.type&&!!n.msg.isConflatable&&n.msg.conflate(t))&&h(e,t)};e.installMessageHook=function(e,t){var n=s.get(e);if(!n||-1===n.indexOf(t))n?n.push(t):s.set(e,[t])};e.removeMessageHook=function(e,t){var n=s.get(e);if(!n)return;var r=n.indexOf(t);if(-1!==r)n[r]=null,f(n)};e.clearData=function(e){var t=s.get(e);for(var n of(t&&t.length>0&&(eu.fill(t,null),f(t)),a))n.handler===e&&(n.handler=null,n.msg=null)};e.flush=function(){if(!d&&null!==n)n(),n=null,d=!0,p(),d=!1};e.getExceptionHandler=function(){return c};e.setExceptionHandler=function(e){var t=c;return c=e,t};var a=new rg,s=new WeakMap,l=new Set,c=e=>{console.error(e)},d=!1;function u(e,t){try{e.processMessage(t)}catch(e){c(e)}}function h(e,t){if(a.addLast({handler:e,msg:t}),null===n)n=r(p)}function p(){if(n=null,!a.isEmpty){var e={handler:null,msg:null};for(a.addLast(e);;){var t=a.removeFirst();if(t===e)return;t.handler&&t.msg&&o(t.handler,t.msg)}}}function f(e){0===l.size&&r(m),l.add(e)}function m(){l.forEach(v),l.clear()}function v(e){eu.removeAllWhere(e,g)}function g(e){return null===e}}(ef||(ef={})),(em||(em={})).copyText=function(e){var{body:t}=document,n=r=>{r.preventDefault(),r.stopPropagation(),r.clipboardData.setData("text",e),t.removeEventListener("copy",n,!0)};t.addEventListener("copy",n,!0),document.execCommand("copy")},(d=ev||(ev={})).boxSizing=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.borderTopWidth)||0,r=parseFloat(t.borderLeftWidth)||0,o=parseFloat(t.borderRightWidth)||0,a=parseFloat(t.borderBottomWidth)||0,s=parseFloat(t.paddingTop)||0,l=parseFloat(t.paddingLeft)||0,c=parseFloat(t.paddingRight)||0,d=parseFloat(t.paddingBottom)||0;return{borderTop:n,borderLeft:r,borderRight:o,borderBottom:a,paddingTop:s,paddingLeft:l,paddingRight:c,paddingBottom:d,horizontalSum:r+l+c+o,verticalSum:n+s+d+a}},d.sizeLimits=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.minWidth)||0,r=parseFloat(t.minHeight)||0,o=parseFloat(t.maxWidth)||1/0,a=parseFloat(t.maxHeight)||1/0;return o=Math.max(n,o),a=Math.max(r,a),{minWidth:n,minHeight:r,maxWidth:o,maxHeight:a}},d.hitTest=function(e,t,n){var r=e.getBoundingClientRect();return t>=r.left&&t=r.top&&n=n.bottom)){if(r.topn.bottom&&r.height>=n.height){e.scrollTop-=n.top-r.top;return}if(r.topn.height||r.bottom>n.bottom&&r.height0;){if(o(m)){t++;continue}if(o(v)||o(g)){n++;continue}if(o(y)){r++;continue}if(o(_)){n++;continue}if(o(b)){r++;continue}if(!o(w))return 0}return(t=Math.min(t,255))<<16|(n=Math.min(n,255))<<8|(r=Math.min(r,255))},m=/^#[^\s\+>~#\.\[:]+/,v=/^\.[^\s\+>~#\.\[:]+/,g=/^\[[^\]]+\]/,b=/^[^\s\+>~#\.\[:]+/,y=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,_=/^:[^\s\+>~#\.\[:]+/,w=/^[\s\+>~\*]+/,x=/:not\(([^\)]+)\)/g;function rS(e){var t,n;function r(t,n){try{var a=e[t](n),s=a.value,l=s instanceof rx;Promise.resolve(l?s.v:s).then(function(n){if(l){var c="return"===t?"return":"next";if(!s.k||n.done)return r(c,n);n=e[c](n).value}o(a.done?"return":"normal",n)},function(e){r("throw",e)})}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(a,s){var l={key:e,arg:o,resolve:a,reject:s,next:null};n?n=n.next=l:(t=n=l,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}rS.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},rS.prototype.next=function(e){return this._invoke("next",e)},rS.prototype.throw=function(e){return this._invoke("throw",e)},rS.prototype.return=function(e){return this._invoke("return",e)};!function(e){function t(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e}function n(e){return Array.isArray(e)}e.emptyObject=Object.freeze({}),e.emptyArray=Object.freeze([]),e.isPrimitive=t,e.isArray=n;function r(e,o){if(e===o)return!0;if(t(e)||t(o))return!1;var a=n(e),s=n(o);return a===s&&(a&&s?function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0,o=e.length;n{this._resolve=e,this._reject=t})}}function rj(e){for(var t=0,n=0,r=e.length;n>>0),e[n]=255&t,t>>>=8}(ew||(ew={})).getRandomValues=(S="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null)&&"function"==typeof S.getRandomValues?function(e){return S.getRandomValues(e)}:rj;(ex||(ex={})).uuid4=function(e){for(var t=new Uint8Array(16),n=Array(256),r=0;r<16;++r)n[r]="0".concat(r.toString(16));for(var o=16;o<256;++o)n[o]=o.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],"".concat(n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]],"-").concat(n[t[4]]).concat(n[t[5]],"-").concat(n[t[6]]).concat(n[t[7]],"-").concat(n[t[8]]).concat(n[t[9]],"-").concat(n[t[10]]).concat(n[t[11]]).concat(n[t[12]]).concat(n[t[13]]).concat(n[t[14]]).concat(n[t[15]])}}(ew.getRandomValues);class rE{connect(e,t){return eS.connect(this,e,t)}disconnect(e,t){return eS.disconnect(this,e,t)}emit(e){eS.emit(this,e)}constructor(e){this.sender=e}}(k=rE||(rE={})).disconnectBetween=function(e,t){eS.disconnectBetween(e,t)},k.disconnectSender=function(e){eS.disconnectSender(e)},k.disconnectReceiver=function(e){eS.disconnectReceiver(e)},k.disconnectAll=function(e){eS.disconnectAll(e)},k.clearData=function(e){eS.disconnectAll(e)},k.getExceptionHandler=function(){return eS.exceptionHandler},k.setExceptionHandler=function(e){var t=eS.exceptionHandler;return eS.exceptionHandler=e,t},Symbol.asyncIterator,!function(e){e.exceptionHandler=e=>{console.error(e)};e.connect=function(e,t,n){n=n||void 0;var a=r.get(e.sender);if(!a&&(a=[],r.set(e.sender,a)),l(a,e,t,n))return!1;var s=n||t,c=o.get(s);!c&&(c=[],o.set(s,c));var d={signal:e,slot:t,thisArg:n};return a.push(d),c.push(d),!0};e.disconnect=function(e,t,n){n=n||void 0;var a=r.get(e.sender);if(!a||0===a.length)return!1;var s=l(a,e,t,n);if(!s)return!1;var d=n||t,u=o.get(d);return s.signal=null,c(a),c(u),!0};function t(e){var t=r.get(e);if(!!t&&0!==t.length){for(var n of t){if(!!n.signal){var a=n.thisArg||n.slot;n.signal=null,c(o.get(a))}}c(t)}}function n(e){var t=o.get(e);if(!!t&&0!==t.length){for(var n of t){if(!!n.signal){var{sender:a}=n.signal;n.signal=null,c(r.get(a))}}c(t)}}e.disconnectBetween=function(e,t){var n=r.get(e);if(!n||0===n.length)return;var a=o.get(t);if(!!a&&0!==a.length){for(var s of a){if(!!s.signal)s.signal.sender===e&&(s.signal=null)}c(n),c(a)}},e.disconnectSender=t,e.disconnectReceiver=n;e.disconnectAll=function(e){t(e),n(e)};e.emit=function(t,n){var o=r.get(t.sender);if(!!o&&0!==o.length)for(var a=0,s=o.length;ae.signal===t&&e.slot===n&&e.thisArg===r)}function c(e){0===a.size&&s(d),a.add(e)}function d(){a.forEach(u),a.clear()}function u(e){eu.removeAllWhere(e,h)}function h(e){return null===e.signal}}(eS||(eS={}));class rT{get changed(){return this._changed}get label(){return this._label}set label(e){if(this._label!==e)this._label=e,this._changed.emit(void 0)}get mnemonic(){return this._mnemonic}set mnemonic(e){if(this._mnemonic!==e)this._mnemonic=e,this._changed.emit(void 0)}get icon(){return this._icon}set icon(e){if(this._icon!==e)this._icon=e,this._changed.emit(void 0)}get iconClass(){return this._iconClass}set iconClass(e){if(this._iconClass!==e)this._iconClass=e,this._changed.emit(void 0)}get iconLabel(){return this._iconLabel}set iconLabel(e){if(this._iconLabel!==e)this._iconLabel=e,this._changed.emit(void 0)}get caption(){return this._caption}set caption(e){if(this._caption!==e)this._caption=e,this._changed.emit(void 0)}get className(){return this._className}set className(e){if(this._className!==e)this._className=e,this._changed.emit(void 0)}get closable(){return this._closable}set closable(e){if(this._closable!==e)this._closable=e,this._changed.emit(void 0)}get dataset(){return this._dataset}set dataset(e){if(this._dataset!==e)this._dataset=e,this._changed.emit(void 0)}get isDisposed(){return this._isDisposed}dispose(){if(!this.isDisposed)this._isDisposed=!0,rE.clearData(this)}constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new rE(this),this._isDisposed=!1,this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon&&(this._icon=e.icon),void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}}class rI{dispose(){if(!this.isDisposed)this.setFlag(rI.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&rI.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),rE.clearData(this),ef.clearData(this),rv.clearData(this)}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(rI.Flag.IsDisposed)}get isAttached(){return this.testFlag(rI.Flag.IsAttached)}get isHidden(){return this.testFlag(rI.Flag.IsHidden)}get isVisible(){return this.testFlag(rI.Flag.IsVisible)}get title(){return ek.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e)this.isHidden&&this._toggleHidden(!1),e==rI.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0)}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var t=new rI.ChildMessage("child-removed",this);ef.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){var n=new rI.ChildMessage("child-added",this);ef.sendMessage(this._parent,n)}!this.isDisposed&&ef.sendMessage(this,rI.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(rI.Flag.DisallowLayout))throw Error("Cannot set widget layout.");if(this._layout)throw Error("Cannot change widget layout.");if(e.parent)throw Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(var t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){ef.postMessage(this,rI.Msg.UpdateRequest)}fit(){ef.postMessage(this,rI.Msg.FitRequest)}activate(){ef.postMessage(this,rI.Msg.ActivateRequest)}close(){ef.sendMessage(this,rI.Msg.CloseRequest)}show(){if(!!this.testFlag(rI.Flag.IsHidden)){if(this.isAttached&&(!this.parent||this.parent.isVisible)&&ef.sendMessage(this,rI.Msg.BeforeShow),this.clearFlag(rI.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&ef.sendMessage(this,rI.Msg.AfterShow),this.parent){var e=new rI.ChildMessage("child-shown",this);ef.sendMessage(this.parent,e)}}}hide(){if(!this.testFlag(rI.Flag.IsHidden)){if(this.isAttached&&(!this.parent||this.parent.isVisible)&&ef.sendMessage(this,rI.Msg.BeforeHide),this.setFlag(rI.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&ef.sendMessage(this,rI.Msg.AfterHide),this.parent){var e=new rI.ChildMessage("child-hidden",this);ef.sendMessage(this.parent,e)}}}setHidden(e){e?this.hide():this.show()}testFlag(e){return(this._flags&e)!=0}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(rI.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(rI.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(rI.Flag.IsVisible),this.setFlag(rI.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(rI.Flag.IsVisible),this.clearFlag(rI.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&rI.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case rI.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case rI.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case rI.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1"}else switch(this._hiddenMode){case rI.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case rI.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case rI.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex=""}}constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new rE(this),this._hiddenMode=rI.HiddenMode.Display,this.node=ek.createNode(e),this.addClass("lm-Widget")}}(j=(C=rI||(rI={})).HiddenMode||(C.HiddenMode={}))[j.Display=0]="Display",j[j.Scale=1]="Scale",j[j.ContentVisibility=2]="ContentVisibility",(E=C.Flag||(C.Flag={}))[E.IsDisposed=1]="IsDisposed",E[E.IsAttached=2]="IsAttached",E[E.IsHidden=4]="IsHidden",E[E.IsVisible=8]="IsVisible",E[E.DisallowLayout=16]="DisallowLayout",(T=C.Msg||(C.Msg={})).BeforeShow=new r_("before-show"),T.AfterShow=new r_("after-show"),T.BeforeHide=new r_("before-hide"),T.AfterHide=new r_("after-hide"),T.BeforeAttach=new r_("before-attach"),T.AfterAttach=new r_("after-attach"),T.BeforeDetach=new r_("before-detach"),T.AfterDetach=new r_("after-detach"),T.ParentChanged=new r_("parent-changed"),T.UpdateRequest=new rw("update-request"),T.FitRequest=new rw("fit-request"),T.ActivateRequest=new rw("activate-request"),T.CloseRequest=new rw("close-request"),C.ChildMessage=class e extends r_{constructor(e,t){super(e),this.child=t}},C.ResizeMessage=class e extends r_{constructor(e,t){super("resize"),this.width=e,this.height=t}},(C.ResizeMessage||(C.ResizeMessage={})).UnknownSize=new C.ResizeMessage(-1,-1),C.attach=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e.parent)throw Error("Cannot attach a child widget.");if(e.isAttached||e.node.isConnected)throw Error("Widget is already attached.");if(!t.isConnected)throw Error("Host is not attached.");ef.sendMessage(e,C.Msg.BeforeAttach),t.insertBefore(e.node,n),ef.sendMessage(e,C.Msg.AfterAttach)},C.detach=function(e){if(e.parent)throw Error("Cannot detach a child widget.");if(!e.isAttached||!e.node.isConnected)throw Error("Widget is not attached.");ef.sendMessage(e,C.Msg.BeforeDetach),e.node.parentNode.removeChild(e.node),ef.sendMessage(e,C.Msg.AfterDetach)},(I=ek||(ek={})).titleProperty=new rv({name:"title",create:e=>new rT({owner:e})}),I.createNode=function(e){return e.node||document.createElement(e.tag||"div")},(eC||(eC={})).clampDimension=function(e){return Math.max(0,Math.floor(e))};var rP=eC;class rM{dispose(){this._parent=null,this._disposed=!0,rE.clearData(this),rv.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw Error("Cannot change parent widget.");if(e.layout!==this)throw Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e){if(this._fitPolicy=e,this._parent){var{style:t}=this._parent.node;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}}init(){for(var e of this)e.parent=this.parent}onResize(e){for(var t of this)ef.sendMessage(t,rI.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(var t of this)ef.sendMessage(t,rI.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(var t of this)ef.sendMessage(t,e)}onAfterAttach(e){for(var t of this)ef.sendMessage(t,e)}onBeforeDetach(e){for(var t of this)ef.sendMessage(t,e)}onAfterDetach(e){for(var t of this)ef.sendMessage(t,e)}onBeforeShow(e){for(var t of this)!t.isHidden&&ef.sendMessage(t,e)}onAfterShow(e){for(var t of this)!t.isHidden&&ef.sendMessage(t,e)}onBeforeHide(e){for(var t of this)!t.isHidden&&ef.sendMessage(t,e)}onAfterHide(e){for(var t of this)!t.isHidden&&ef.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}}(P=rM||(rM={})).getHorizontalAlignment=function(e){return ej.horizontalAlignmentProperty.get(e)},P.setHorizontalAlignment=function(e,t){ej.horizontalAlignmentProperty.set(e,t)},P.getVerticalAlignment=function(e){return ej.verticalAlignmentProperty.get(e)},P.setVerticalAlignment=function(e,t){ej.verticalAlignmentProperty.set(e,t)};class rR{dispose(){if(!this._disposed){this._disposed=!0;var{style:e}=this.widget.node;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){var e=ev.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,n,r){var o=Math.max(this._minWidth,Math.min(n,this._maxWidth)),a=Math.max(this._minHeight,Math.min(r,this._maxHeight));if(o"center",changed:t}),e.verticalAlignmentProperty=new rv({name:"verticalAlignment",create:()=>"top",changed:t})}(ej||(ej={}));class rD extends rM{dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;var n=this._widgets.indexOf(t),r=Math.max(0,Math.min(e,this._widgets.length));if(-1===n){eu.insert(this._widgets,r,t),this.parent&&this.attachWidget(r,t);return}if(r===this._widgets.length&&r--,n!==r)eu.move(this._widgets,n,r),this.parent&&this.moveWidget(n,r,t)}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){var t=eu.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();var e=0;for(var t of this)this.attachWidget(e++,t)}attachWidget(e,t){var n=this.parent.node.children[e];this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,n),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterAttach)}moveWidget(e,t,n){this.parent.isAttached&&ef.sendMessage(n,rI.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&ef.sendMessage(n,rI.Msg.AfterDetach);var r=this.parent.node.children[t];this.parent.isAttached&&ef.sendMessage(n,rI.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,r),this.parent.isAttached&&ef.sendMessage(n,rI.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterDetach)}constructor(...e){super(...e),this._widgets=[]}}class rA extends rD{dispose(){for(var e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){if(this._direction===e)return;if(this._direction=e,!!this.parent)this.parent.dataset.direction=e,this.parent.fit()}get alignment(){return this._alignment}set alignment(e){if(this._alignment===e)return;if(this._alignment=e,!!this.parent)this.parent.dataset.alignment=e,this.parent.update()}get spacing(){return this._spacing}set spacing(e){if(e=rP.clampDimension(e),this._spacing===e)return;if(this._spacing=e,!!this.parent)this.parent.fit()}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){eu.insert(this._items,e,new rR(t)),eu.insert(this._sizers,e,new rm),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){eu.move(this._items,e,t),eu.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){var n=eu.removeAt(this._items,e);eu.removeAt(this._sizers,e),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(var e=0,t=0,n=this._items.length;t0)switch(this._alignment){case"start":break;case"center":u=0,h=n/2;break;case"end":u=0,h=n;break;case"justify":u=n/r,h=0;break;default:throw"unreachable"}for(var p=0,f=this._items.length;p0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t}),e.sizeBasisProperty=new rv({name:"sizeBasis",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t});e.isHorizontal=function(e){return"left-to-right"===e||"right-to-left"===e};function t(e){e.parent&&e.parent.layout instanceof rA&&e.parent.fit()}e.clampSpacing=function(e){return Math.max(0,Math.floor(e))}}(eE||(eE={}));class rN extends rI{get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=eT.createLayout(e)}}(eT||(eT={})).createLayout=function(e){return e.layout||new rD};class rL extends rN{get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}constructor(e={}){super({layout:eI.createLayout(e)}),this.addClass("lm-BoxPanel")}}(R=rL||(rL={})).getStretch=function(e){return rA.getStretch(e)},R.setStretch=function(e,t){rA.setStretch(e,t)},R.getSizeBasis=function(e){return rA.getSizeBasis(e)},R.setSizeBasis=function(e,t){rA.setSizeBasis(e,t)},(eI||(eI={})).createLayout=function(e){return e.layout||new rA(e)};class rz{constructor(e){this.type="text",this.content=e}}class rO{constructor(e,t,n,r){this.type="element",this.tag=e,this.attrs=t,this.children=n,this.renderer=r}}class rB extends rO{constructor(e,t,n){super(e,t,[],n||void 0)}}function rW(e){for(var t,n={},r=[],o=1,a=arguments.length;o3)throw Error("hpass() should be called with 1, 2, or 3 arguments");return new rB(e,t,n)}(D=rW||(rW={})).a=D.bind(void 0,"a"),D.abbr=D.bind(void 0,"abbr"),D.address=D.bind(void 0,"address"),D.area=D.bind(void 0,"area"),D.article=D.bind(void 0,"article"),D.aside=D.bind(void 0,"aside"),D.audio=D.bind(void 0,"audio"),D.b=D.bind(void 0,"b"),D.bdi=D.bind(void 0,"bdi"),D.bdo=D.bind(void 0,"bdo"),D.blockquote=D.bind(void 0,"blockquote"),D.br=D.bind(void 0,"br"),D.button=D.bind(void 0,"button"),D.canvas=D.bind(void 0,"canvas"),D.caption=D.bind(void 0,"caption"),D.cite=D.bind(void 0,"cite"),D.code=D.bind(void 0,"code"),D.col=D.bind(void 0,"col"),D.colgroup=D.bind(void 0,"colgroup"),D.data=D.bind(void 0,"data"),D.datalist=D.bind(void 0,"datalist"),D.dd=D.bind(void 0,"dd"),D.del=D.bind(void 0,"del"),D.dfn=D.bind(void 0,"dfn"),D.div=D.bind(void 0,"div"),D.dl=D.bind(void 0,"dl"),D.dt=D.bind(void 0,"dt"),D.em=D.bind(void 0,"em"),D.embed=D.bind(void 0,"embed"),D.fieldset=D.bind(void 0,"fieldset"),D.figcaption=D.bind(void 0,"figcaption"),D.figure=D.bind(void 0,"figure"),D.footer=D.bind(void 0,"footer"),D.form=D.bind(void 0,"form"),D.h1=D.bind(void 0,"h1"),D.h2=D.bind(void 0,"h2"),D.h3=D.bind(void 0,"h3"),D.h4=D.bind(void 0,"h4"),D.h5=D.bind(void 0,"h5"),D.h6=D.bind(void 0,"h6"),D.header=D.bind(void 0,"header"),D.hr=D.bind(void 0,"hr"),D.i=D.bind(void 0,"i"),D.iframe=D.bind(void 0,"iframe"),D.img=D.bind(void 0,"img"),D.input=D.bind(void 0,"input"),D.ins=D.bind(void 0,"ins"),D.kbd=D.bind(void 0,"kbd"),D.label=D.bind(void 0,"label"),D.legend=D.bind(void 0,"legend"),D.li=D.bind(void 0,"li"),D.main=D.bind(void 0,"main"),D.map=D.bind(void 0,"map"),D.mark=D.bind(void 0,"mark"),D.meter=D.bind(void 0,"meter"),D.nav=D.bind(void 0,"nav"),D.noscript=D.bind(void 0,"noscript"),D.object=D.bind(void 0,"object"),D.ol=D.bind(void 0,"ol"),D.optgroup=D.bind(void 0,"optgroup"),D.option=D.bind(void 0,"option"),D.output=D.bind(void 0,"output"),D.p=D.bind(void 0,"p"),D.param=D.bind(void 0,"param"),D.pre=D.bind(void 0,"pre"),D.progress=D.bind(void 0,"progress"),D.q=D.bind(void 0,"q"),D.rp=D.bind(void 0,"rp"),D.rt=D.bind(void 0,"rt"),D.ruby=D.bind(void 0,"ruby"),D.s=D.bind(void 0,"s"),D.samp=D.bind(void 0,"samp"),D.section=D.bind(void 0,"section"),D.select=D.bind(void 0,"select"),D.small=D.bind(void 0,"small"),D.source=D.bind(void 0,"source"),D.span=D.bind(void 0,"span"),D.strong=D.bind(void 0,"strong"),D.sub=D.bind(void 0,"sub"),D.summary=D.bind(void 0,"summary"),D.sup=D.bind(void 0,"sup"),D.table=D.bind(void 0,"table"),D.tbody=D.bind(void 0,"tbody"),D.td=D.bind(void 0,"td"),D.textarea=D.bind(void 0,"textarea"),D.tfoot=D.bind(void 0,"tfoot"),D.th=D.bind(void 0,"th"),D.thead=D.bind(void 0,"thead"),D.time=D.bind(void 0,"time"),D.title=D.bind(void 0,"title"),D.tr=D.bind(void 0,"tr"),D.track=D.bind(void 0,"track"),D.u=D.bind(void 0,"u"),D.ul=D.bind(void 0,"ul"),D.var_=D.bind(void 0,"var"),D.video=D.bind(void 0,"video"),D.wbr=D.bind(void 0,"wbr"),(A=eM||(eM={})).realize=function(e){return eP.createDOMNode(e)},A.render=function(e,t){var n=eP.hostMap.get(t)||[],r=eP.asContentArray(e);eP.hostMap.set(t,r),eP.updateContent(t,n,r)},!function(e){e.hostMap=new WeakMap;function t(e){var r=arguments[1]||null,o=arguments[2]||null;if(r)r.insertBefore(t(e),o);else{if("text"===e.type)return document.createTextNode(e.content);if(function(e,t){for(var r in t){if(!(r in n))"on"===r.substr(0,2)?e[r]=t[r]:e.setAttribute(r,t[r])}void 0!==t.className&&e.setAttribute("class",t.className),void 0!==t.htmlFor&&e.setAttribute("for",t.htmlFor),t.dataset&&function(e,t){for(var n in t)e.setAttribute("data-".concat(n),t[n])}(e,t.dataset),t.style&&function(e,t){var n,r=e.style;for(n in t)r[n]=t[n]}(e,t.style)}(r=document.createElement(e.tag),e.attrs),e.renderer)return e.renderer.render(r,{attrs:e.attrs,children:e.children}),r;for(var a=0,s=e.children.length;a=l.length){t(a[u],r);continue}var h=l[u],p=a[u];if(h===p){c=c.nextSibling;continue}if("text"===h.type&&"text"===p.type){c.textContent!==p.content&&(c.textContent=p.content),c=c.nextSibling;continue}if("text"===h.type||"text"===p.type||!h.renderer!=!p.renderer){eu.insert(l,u,p),t(p,r,c);continue}var f=p.attrs.key;if(f&&f in s){var m=s[f];m.vNode!==h&&(eu.move(l,l.indexOf(m.vNode,u+1),u),r.insertBefore(m.element,c),h=m.vNode,c=m.element)}if(h===p){c=c.nextSibling;continue}var v=h.attrs.key;if(v&&v!==f||h.tag!==p.tag){eu.insert(l,u,p),t(p,r,c);continue}(function(e,t,r){var o;if(t!==r){for(o in t){if(!(o in n)&&!(o in r))"on"===o.substr(0,2)?e[o]=null:e.removeAttribute(o)}for(o in r){if(!(o in n)&&t[o]!==r[o])"on"===o.substr(0,2)?e[o]=r[o]:e.setAttribute(o,r[o])}t.className!==r.className&&(void 0!==r.className?e.setAttribute("class",r.className):e.removeAttribute("class")),t.htmlFor!==r.htmlFor&&(void 0!==r.htmlFor?e.setAttribute("for",r.htmlFor):e.removeAttribute("for")),t.dataset!==r.dataset&&function(e,t,n){for(var r in t)!(r in n)&&e.removeAttribute("data-".concat(r));for(var o in n)t[o]!==n[o]&&e.setAttribute("data-".concat(o),n[o])}(e,t.dataset||{},r.dataset||{}),t.style!==r.style&&function(e,t,n){var r,o=e.style;for(r in t)!(r in n)&&(o[r]="");for(r in n)t[r]!==n[r]&&(o[r]=n[r])}(e,t.style||{},r.style||{})}})(c,h.attrs,p.attrs),p.renderer?p.renderer.render(c,{attrs:p.attrs,children:p.children}):e(c,h.children,p.children),c=c.nextSibling}(function e(t,n,r,o){for(var a=n.length-1;a>=r;--a){var s=n[a],l=o?t.lastChild:t.childNodes[a];"text"===s.type||(s.renderer&&s.renderer.unrender?s.renderer.unrender(l,{attrs:s.attrs,children:s.children}):e(l,s.children,0,!1)),o&&t.removeChild(l)}})(r,l,d,!0)}};var n={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0}}(eP||(eP={}));class rH{get isDisposed(){return!this._fn}dispose(){if(!!this._fn){var e=this._fn;this._fn=null,e()}}constructor(e){this._fn=e}}class rU{get isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed)this._isDisposed=!0,this._items.forEach(e=>{e.dispose()}),this._items.clear()}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}constructor(){this._isDisposed=!1,this._items=new Set}}(N=rU||(rU={})).from=function(e){var t=new N;for(var n of e)t.add(n);return t};class rV extends rU{get disposed(){return this._disposed}dispose(){if(!this.isDisposed)super.dispose(),this._disposed.emit(void 0),rE.clearData(this)}constructor(...e){super(...e),this._disposed=new rE(this)}}(L=rV||(rV={})).from=function(e){var t=new L;for(var n of e)t.add(n);return t};class rK{dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});eR.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise(e=>{this._resolve=e});var n=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(n),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation()}}moveDragImage(e,t){if(!!this.dragImage){var{style:n}=this.dragImage;n.transform="translate(".concat(e,"px, ").concat(t,"px)")}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),0===e.button){if(this._updateCurrentTarget(e),!this._currentTarget){this._finalize("none");return}if("none"===this._dropAction){eR.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}var t=eR.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){var t=eR.findScrollTarget(e);if(!!this._scrollTarget||!!t)!this._scrollTarget&&setTimeout(this._onScrollFrame,500),this._scrollTarget=t}_updateCurrentTarget(e){var t=this._currentTarget,n=this._currentTarget,r=this._currentElement,o=eR.findElementBehindBackdrop(e,this.document);this._currentElement=o,o!==r&&o!==n&&eR.dispatchDragExit(this,n,o,e),o!==r&&o!==n&&(n=eR.dispatchDragEnter(this,o,n,e)),n!==t&&(this._currentTarget=n,eR.dispatchDragLeave(this,t,n,e));var a=eR.dispatchDragOver(this,n,e);this._setDropAction(a)}_attachDragImage(e,t){if(!!this.dragImage){this.dragImage.classList.add("lm-mod-drag-image");var{style:n}=this.dragImage;n.pointerEvents="none",n.position="fixed",n.transform="translate(".concat(e,"px, ").concat(t,"px)"),(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}}_detachDragImage(){if(!this.dragImage)return;var e=this.dragImage.parentNode;if(!!e)e.removeChild(this.dragImage)}_setDropAction(e){if(e=eR.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=rK.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=rK.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=rK.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=rK.overrideCursor("move",this.document)}}_finalize(e){var t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}constructor(e){this._onScrollFrame=()=>{if(!!this._scrollTarget){var{element:e,edge:t,distance:n}=this._scrollTarget,r=Math.max(1,Math.round(Math.pow((eR.SCROLL_EDGE_SIZE-n)/eR.SCROLL_EDGE_SIZE,2)*eR.SCROLL_EDGE_SIZE));switch(t){case"top":e.scrollTop-=r;break;case"left":e.scrollLeft-=r;break;case"right":e.scrollLeft+=r;break;case"bottom":e.scrollTop+=r}requestAnimationFrame(this._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null,eR.backdropTransform=e.backdropTransform}}!function(e){class t extends DragEvent{constructor(e,t){super(t.type,{bubbles:!0,cancelable:!0,altKey:e.altKey,button:e.button,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,detail:0,metaKey:e.metaKey,relatedTarget:t.related,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey,view:window});var{drag:n}=t;this.dropAction="none",this.mimeData=n.mimeData,this.proposedAction=n.proposedAction,this.supportedActions=n.supportedActions,this.source=n.source}}e.Event=t;e.overrideCursor=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return eR.overrideCursor(e,t)}}(rK||(rK={})),!function(e){e.SCROLL_EDGE_SIZE=20;function t(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(t){if(r&&t==r.event)return r.element;e.cursorBackdrop.style.zIndex="-1000";var a=n.elementFromPoint(t.clientX,t.clientY);return e.cursorBackdrop.style.zIndex="",r={event:t,element:a},a}var{transform:s}=e.cursorBackdrop.style;if(o&&s===o.transform)return o.element;var l=e.cursorBackdrop.getBoundingClientRect();e.cursorBackdrop.style.zIndex="-1000";var c=n.elementFromPoint(l.left+l.width/2,l.top+l.height/2);return e.cursorBackdrop.style.zIndex="",o={transform:s,element:c},c}e.validateAction=function(e,t){return a[e]&s[t]?e:"none"},e.findElementBehindBackdrop=t;var n,r=null,o=null;e.findScrollTarget=function(n){for(var r=n.clientX,o=n.clientY,a=t(n);a;a=a.parentElement){if(!a.hasAttribute("data-lm-dragscroll"))continue;var s=0,l=0;a===document.body&&(s=window.pageXOffset,l=window.pageYOffset);var c=a.getBoundingClientRect(),d=c.top+l,u=c.left+s,h=u+c.width,p=d+c.height;if(r=h||o=p)continue;var f=r-u+1,m=o-d+1,v=h-r,g=p-o,b=Math.min(f,m,v,g);if(b>e.SCROLL_EDGE_SIZE)continue;var y=void 0;switch(b){case g:y="bottom";break;case m:y="top";break;case v:y="right";break;case f:y="left";break;default:throw"unreachable"}var _=a.scrollWidth-a.clientWidth,w=a.scrollHeight-a.clientHeight,x=void 0;switch(y){case"top":x=w>0&&a.scrollTop>0;break;case"left":x=_>0&&a.scrollLeft>0;break;case"right":x=_>0&&a.scrollLeft<_;break;case"bottom":x=w>0&&a.scrollTop1&&void 0!==arguments[1]?arguments[1]:document,r=++h,o=n instanceof Document?n.body:n.firstElementChild;return!e.cursorBackdrop.isConnected&&(e.cursorBackdrop.style.transform="scale(0)",o.appendChild(e.cursorBackdrop),d(),document.addEventListener("pointermove",l,{capture:!0,passive:!0}),e.cursorBackdrop.addEventListener("scroll",c,{capture:!0,passive:!0})),e.cursorBackdrop.style.cursor=t,new rH(()=>{r===h&&e.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",l,!0),e.cursorBackdrop.removeEventListener("scroll",c,!0),o.removeChild(e.cursorBackdrop))})};var u=500,h=0;e.cursorBackdrop=((n=document.createElement("div")).classList.add("lm-cursor-backdrop"),n)}(eR||(eR={}));var rq=["ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End"];class rZ extends rI{dispose(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,super.dispose()}get currentChanged(){return this._currentChanged}get tabMoved(){return this._tabMoved}get tabActivateRequested(){return this._tabActivateRequested}get addRequested(){return this._addRequested}get tabCloseRequested(){return this._tabCloseRequested}get tabDetachRequested(){return this._tabDetachRequested}get document(){return this._document}get titlesEditable(){return this._titlesEditable}set titlesEditable(e){this._titlesEditable=e}get currentTitle(){return this._titles[this._currentIndex]||null}set currentTitle(e){this.currentIndex=e?this._titles.indexOf(e):-1}get currentIndex(){return this._currentIndex}set currentIndex(e){if((e<0||e>=this._titles.length)&&(e=-1),this._currentIndex!==e){var t=this._currentIndex,n=this._titles[t]||null,r=e,o=this._titles[r]||null;this._currentIndex=r,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:n,currentIndex:r,currentTitle:o})}}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){if(this._orientation!==e)this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e)}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){if(this._addButtonEnabled!==e)this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden")}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();var n=eD.asTitle(t),r=this._titles.indexOf(n),o=Math.max(0,Math.min(e,this._titles.length));return -1===r?(eu.insert(this._titles,o,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(o,n),n):(o===this._titles.length&&o--,r===o)?n:(eu.move(this._titles,r,o),this.update(),this._adjustCurrentForMove(r,o),n)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();var t=eu.removeAt(this._titles,e);if(!!t)t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t)}clearTabs(){if(0===this._titles.length)return;for(var e of(this._releaseMouse(),this._titles))e.changed.disconnect(this._onTitleChanged,this);var t=this.currentIndex,n=this.currentTitle;if(this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==t)this._currentChanged.emit({previousIndex:t,previousTitle:n,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){for(var t,n=this._titles,{renderer:r}=this,{currentTitle:o}=this,a=Array(n.length),s=null!==(t=this._getCurrentTabindex())&&void 0!==t?t:this._currentIndex>-1?this._currentIndex:0,l=0,c=n.length;lev.hitTest(t,e.clientX,e.clientY));if(-1!==n){var r=this.titles[n],o=t[n].querySelector(".lm-TabBar-tabLabel");if(o&&o.contains(e.target)){var a=r.label||"",s=o.innerHTML;o.innerHTML="";var l=document.createElement("input");l.classList.add("lm-TabBar-tabInput"),l.value=a,o.appendChild(l);var c=()=>{l.removeEventListener("blur",c),o.innerHTML=s,this.node.addEventListener("keydown",this)};l.addEventListener("dblclick",e=>e.stopPropagation()),l.addEventListener("blur",c),l.addEventListener("keydown",e=>{"Enter"===e.key?(""!==l.value&&(r.label=r.caption=l.value),c()):"Escape"===e.key&&c()}),this.node.removeEventListener("keydown",this),l.select(),l.focus(),o.children.length>0&&o.children[0].focus()}}}_evtKeyDownCapturing(e){if(e.eventPhase===Event.CAPTURING_PHASE)e.preventDefault(),e.stopPropagation(),"Escape"===e.key&&this._releaseMouse()}_evtKeyDown(e){if("Tab"!==e.key&&e.eventPhase!==Event.CAPTURING_PHASE){if("Enter"===e.key||"Spacebar"===e.key||" "===e.key){var t=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(t))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{var n=eu.findFirstIndex(this.contentNode.children,e=>e.contains(t));n>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=n)}}else if(rq.includes(e.key)){var r,o,a,s,l=[...this.contentNode.children];if(this.addButtonEnabled&&l.push(this.addButtonNode),l.length<=1)return;e.preventDefault(),e.stopPropagation();var c=l.indexOf(document.activeElement);-1===c&&(c=this._currentIndex),"ArrowRight"===e.key&&"horizontal"===this._orientation||"ArrowDown"===e.key&&"vertical"===this._orientation?r=null!==(o=l[c+1])&&void 0!==o?o:l[0]:"ArrowLeft"===e.key&&"horizontal"===this._orientation||"ArrowUp"===e.key&&"vertical"===this._orientation?r=null!==(a=l[c-1])&&void 0!==a?a:l[l.length-1]:"Home"===e.key?r=l[0]:"End"===e.key&&(r=l[l.length-1]),r&&(null===(s=l[c])||void 0===s||s.setAttribute("tabindex","-1"),null==r||r.setAttribute("tabindex","0"),r.focus())}}}_evtPointerDown(e){if(0!==e.button&&1!==e.button||this._dragData||e.target.classList.contains("lm-TabBar-tabInput"))return;var t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),n=this.contentNode.children,r=eu.findFirstIndex(n,t=>ev.hitTest(t,e.clientX,e.clientY));if(-1===r&&!t)return;if(this._dragData={tab:n[r],index:r,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),1===e.button||t)return;var o=n[r].querySelector(this.renderer.closeIconSelector);if(o&&o.contains(e.target))return;if(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===r?this.currentIndex=-1:this.currentIndex=r,-1!==this.currentIndex)this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle})}_evtPointerMove(e){var t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();var n=this.contentNode.children;if(!!t.dragActive||!!eD.dragExceeded(t,e)){if(!t.dragActive){var r=t.tab.getBoundingClientRect();"horizontal"===this._orientation?(t.tabPos=t.tab.offsetLeft,t.tabSize=r.width,t.tabPressPos=t.pressX-r.left):(t.tabPos=t.tab.offsetTop,t.tabSize=r.height,t.tabPressPos=t.pressY-r.top),t.tabPressOffset={x:t.pressX-r.left,y:t.pressY-r.top},t.tabLayout=eD.snapTabLayout(n,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=rK.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&eD.detachExceeded(t,e)){t.detachRequested=!0;var{index:o}=t,{clientX:a}=e,{clientY:s}=e,l=n[o],c=this._titles[o];if(this._tabDetachRequested.emit({index:o,title:c,tab:l,clientX:a,clientY:s,offset:t.tabPressOffset}),t.dragAborted)return}eD.layoutTabs(n,t,e,this._orientation)}}_evtPointerUp(e){if(0!==e.button&&1!==e.button)return;var t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target)){this._addRequested.emit(void 0);return}var n=this.contentNode.children,r=eu.findFirstIndex(n,t=>ev.hitTest(t,e.clientX,e.clientY));if(r!==t.index)return;var o=this._titles[r];if(!o.closable)return;if(1===e.button){this._tabCloseRequested.emit({index:r,title:o});return}var a=n[r].querySelector(this.renderer.closeIconSelector);a&&a.contains(e.target)&&this._tabCloseRequested.emit({index:r,title:o});return}if(0===e.button)eD.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging"),setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,eD.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");var e=t.index,n=t.targetIndex;if(-1!==n&&e!==n)eu.move(this._titles,e,n),this._adjustCurrentForMove(e,n),this._tabMoved.emit({fromIndex:e,toIndex:n,title:this._titles[n]}),ef.sendMessage(this,rI.Msg.UpdateRequest)},eD.parseTransitionDuration(t.tab))}_releaseMouse(){var e=this._dragData;if(!e)return;if(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,!!e.dragActive)eD.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")}_adjustCurrentForInsert(e,t){var n=this.currentTitle,r=this._currentIndex,o=this.insertBehavior;if("select-tab"===o||"select-tab-if-needed"===o&&-1===r){this._currentIndex=e,this._previousTitle=n,this._currentChanged.emit({previousIndex:r,previousTitle:n,currentIndex:e,currentTitle:t});return}r>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){var n=this._currentIndex,r=this.removeBehavior;if(n!==e){n>e&&this._currentIndex--;return}if(0===this._titles.length){this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});return}if("select-tab-after"===r){this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if("select-tab-before"===r){this._currentIndex=Math.max(0,e-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if("select-previous-tab"===r){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}_onTitleChanged(e){this.update()}constructor(e={}){super({node:eD.createNode()}),this._currentIndex=-1,this._titles=[],this._titlesEditable=!1,this._previousTitle=null,this._dragData=null,this._addButtonEnabled=!1,this._tabMoved=new rE(this),this._currentChanged=new rE(this),this._addRequested=new rE(this),this._tabCloseRequested=new rE(this),this._tabDetachRequested=new rE(this),this._tabActivateRequested=new rE(this),this.addClass("lm-TabBar"),this.contentNode.setAttribute("role","tablist"),this.setFlag(rI.Flag.DisallowLayout),this._document=e.document||document,this.tabsMovable=e.tabsMovable||!1,this.titlesEditable=e.titlesEditable||!1,this.allowDeselect=e.allowDeselect||!1,this.addButtonEnabled=e.addButtonEnabled||!1,this.insertBehavior=e.insertBehavior||"select-tab-if-needed",this.name=e.name||"",this.orientation=e.orientation||"horizontal",this.removeBehavior=e.removeBehavior||"select-tab-after",this.renderer=e.renderer||rZ.defaultRenderer}}!function(e){class t{renderTab(e){var t=e.title.caption,n=this.createTabKey(e),r=this.createTabStyle(e),o=this.createTabClass(e),a=this.createTabDataset(e),s=this.createTabARIA(e);return e.title.closable?rW.li((0,tm._)({id:n,key:n,className:o,title:t,style:r,dataset:a},s),this.renderIcon(e),this.renderLabel(e),this.renderCloseIcon(e)):rW.li((0,tm._)({id:n,key:n,className:o,title:t,style:r,dataset:a},s),this.renderIcon(e),this.renderLabel(e))}renderIcon(e){var{title:t}=e,n=this.createIconClass(e);return rW.div({className:n},t.icon,t.iconLabel)}renderLabel(e){return rW.div({className:"lm-TabBar-tabLabel"},e.title.label)}renderCloseIcon(e){return rW.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(e){var t=this._tabKeys.get(e.title);return void 0===t&&(t="tab-key-".concat(this._uuid,"-").concat(this._tabID++),this._tabKeys.set(e.title,t)),t}createTabStyle(e){return{zIndex:"".concat(e.zIndex)}}createTabClass(e){var t="lm-TabBar-tab";return e.title.className&&(t+=" ".concat(e.title.className)),e.title.closable&&(t+=" lm-mod-closable"),e.current&&(t+=" lm-mod-current"),t}createTabDataset(e){return e.title.dataset}createTabARIA(e){var t;return{role:"tab","aria-selected":e.current.toString(),tabindex:"".concat(null!==(t=e.tabIndex)&&void 0!==t?t:"-1")}}createIconClass(e){var t="lm-TabBar-tabIcon",n=e.title.iconClass;return n?"".concat(t," ").concat(n):t}constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++t._nInstance}}t._nInstance=0,e.Renderer=t,e.defaultRenderer=new t,e.addButtonSelector=".lm-TabBar-addButton"}(rZ||(rZ={})),(z=eD||(eD={})).DRAG_THRESHOLD=5,z.DETACH_THRESHOLD=20,z.createNode=function(){var e=document.createElement("div"),t=document.createElement("ul");t.setAttribute("role","tablist"),t.className="lm-TabBar-content",e.appendChild(t);var n=document.createElement("div");return n.className="lm-TabBar-addButton lm-mod-hidden",n.setAttribute("tabindex","-1"),n.setAttribute("role","button"),e.appendChild(n),e},z.asTitle=function(e){return e instanceof rT?e:new rT(e)},z.parseTransitionDuration=function(e){return 1e3*(parseFloat(window.getComputedStyle(e).transitionDuration)||0)},z.snapTabLayout=function(e,t){for(var n=Array(e.length),r=0,o=e.length;r=z.DRAG_THRESHOLD||r>=z.DRAG_THRESHOLD},z.detachExceeded=function(e,t){var n=e.contentRect;return t.clientX=n.right+z.DETACH_THRESHOLD||t.clientY=n.bottom+z.DETACH_THRESHOLD},z.layoutTabs=function(e,t,n,r){"horizontal"===r?(o=t.pressX,a=n.clientX-t.contentRect.left,s=n.clientX,l=t.contentRect.width):(o=t.pressY,a=n.clientY-t.contentRect.top,s=n.clientY,l=t.contentRect.height);for(var o,a,s,l,c=t.index,d=a-t.tabPressPos,u=d+t.tabSize,h=0,p=e.length;h>1);if(ht.index&&u>v)f="".concat(-t.tabSize-m.margin,"px"),c=Math.max(c,h);else if(h===t.index){var g=s-o,b=l-(t.tabPos+t.tabSize);f="".concat(Math.max(-t.tabPos,Math.min(g,b)),"px")}else f="";"horizontal"===r?e[h].style.left=f:e[h].style.top=f}t.targetIndex=c},z.finalizeTabPosition=function(e,t){if(n="horizontal"===t?e.contentRect.width:e.contentRect.height,e.targetIndex===e.index)r=0;else if(e.targetIndex>e.index){var n,r,o=e.tabLayout[e.targetIndex];r=o.pos+o.size-e.tabSize-e.tabPos}else r=e.tabLayout[e.targetIndex].pos-e.tabPos;var a=n-(e.tabPos+e.tabSize),s=Math.max(-e.tabPos,Math.min(r,a));"horizontal"===t?e.tab.style.left="".concat(s,"px"):e.tab.style.top="".concat(s,"px")},z.resetTabPositions=function(e,t){for(var n of e)"horizontal"===t?n.style.left="":n.style.top=""};class rY extends rM{dispose(){var e=this[Symbol.iterator]();for(var t of(this._items.forEach(e=>{e.dispose()}),this._box=null,this._root=null,this._items.clear(),e))t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){for(var t of(this._hiddenMode=e,this.tabBars()))if(t.titles.length>1)for(var n of t.titles)n.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){if(e=rP.clampDimension(e),this._spacing===e)return;if(this._spacing=e,!!this.parent)this.parent.fit()}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():rb()}widgets(){return this._root?this._root.iterUserWidgets():rb()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():rb()}tabBars(){return this._root?this._root.iterTabBars():rb()}handles(){return this._root?this._root.iterHandles():rb()}moveHandle(e,t,n){var r,o=e.classList.contains("lm-mod-hidden");if(!this._root||o)return;var a=this._root.findSplitNode(e);if(!!a&&0!=(r="horizontal"===a.node.orientation?t-e.offsetLeft:n-e.offsetTop))a.node.holdSizes(),el.adjust(a.node.sizers,a.index,r),this.parent&&this.parent.update()}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){var t,n=new Set;t=e.main?eA.normalizeAreaConfig(e.main,n):null;var r=this.widgets(),o=this.tabBars(),a=this.handles();for(var s of(this._root=null,r))!n.has(s)&&(s.parent=null);for(var l of o)l.dispose();for(var c of a)c.parentNode&&c.parentNode.removeChild(c);for(var d of n)d.parent=this.parent;if(t?this._root=eA.realizeAreaConfig(t,{createTabBar:e=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,!!this.parent)n.forEach(e=>{this.attachWidget(e)}),this.parent.fit()}addWidget(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.ref||null,r=t.mode||"tab-after",o=null;if(this._root&&n&&(o=this._root.findTabNode(n)),n&&!o)throw Error("Reference widget is not in the layout.");switch(e.parent=this.parent,r){case"tab-after":this._insertTab(e,n,o,!0);break;case"tab-before":this._insertTab(e,n,o,!1);break;case"split-top":this._insertSplit(e,n,o,"vertical",!1);break;case"split-left":this._insertSplit(e,n,o,"horizontal",!1);break;case"split-right":this._insertSplit(e,n,o,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,n,o,"vertical",!0);break;case"merge-top":this._insertSplit(e,n,o,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,n,o,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,n,o,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,n,o,"vertical",!0,!0)}if(!!this.parent)this.attachWidget(e),this.parent.fit()}removeWidget(e){if(this._removeWidget(e),!!this.parent)this.detachWidget(e),this.parent.fit()}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;!this._box&&(this._box=ev.boxSizing(this.parent.node));var n=this.parent.node.getBoundingClientRect(),r=e-n.left-this._box.borderLeft,o=t-n.top-this._box.borderTop,a=this._root.hitTestTabNodes(r,o);if(!a)return null;var{tabBar:s,top:l,left:c,width:d,height:u}=a,h=this._box.borderLeft+this._box.borderRight,p=this._box.borderTop+this._box.borderBottom,f=n.width-h-(c+d),m=n.height-p-(l+u);return{tabBar:s,x:r,y:o,top:l,left:c,right:f,bottom:m,width:d,height:u}}init(){for(var e of(super.init(),this))this.attachWidget(e);for(var t of this.handles())this.parent.node.appendChild(t);this.parent.fit()}attachWidget(e){if(this.parent.node!==e.node.parentNode)this._items.set(e,new rR(e)),this.parent.isAttached&&ef.sendMessage(e,rI.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&ef.sendMessage(e,rI.Msg.AfterAttach)}detachWidget(e){if(this.parent.node===e.node.parentNode){this.parent.isAttached&&ef.sendMessage(e,rI.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&ef.sendMessage(e,rI.Msg.AfterDetach);var t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;var t=this._root.findTabNode(e);if(!!t){if(eA.removeAria(e),t.tabBar.titles.length>1){t.tabBar.removeTab(e.title),this._hiddenMode===rI.HiddenMode.Scale&&1==t.tabBar.titles.length&&(t.tabBar.titles[0].owner.hiddenMode=rI.HiddenMode.Display);return}if(t.tabBar.dispose(),this._root===t){this._root=null;return}this._root.holdAllSizes();var n=t.parent;t.parent=null;var r=eu.removeFirstOf(n.children,t),o=eu.removeAt(n.handles,r);if(eu.removeAt(n.sizers,r),o.parentNode&&o.parentNode.removeChild(o),n.children.length>1){n.syncHandles();return}var a=n.parent;n.parent=null;var s=n.children[0],l=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,l.parentNode&&l.parentNode.removeChild(l),this._root===n){s.parent=null,this._root=s;return}var c=a.children.indexOf(n);if(s instanceof eA.TabLayoutNode){s.parent=a,a.children[c]=s;return}var d=eu.removeAt(a.handles,c);eu.removeAt(a.children,c),eu.removeAt(a.sizers,c),d.parentNode&&d.parentNode.removeChild(d);for(var u=0,h=s.children.length;u5&&void 0!==arguments[5]&&arguments[5];if(e!==t||!n||1!==n.tabBar.titles.length){if(this._removeWidget(e),!this._root){this._root=this._createTabNode(e);return}if(!n||!n.parent){var s=this._splitRoot(r),l=o?s.children.length:0;s.normalizeSizes();var c=eA.createSizer(n?1:eA.GOLDEN_RATIO),d=this._createTabNode(e);eu.insert(s.children,l,d),eu.insert(s.sizers,l,c),eu.insert(s.handles,l,this._createHandle()),d.parent=s,s.normalizeSizes(),s.syncHandles();return}var u=n.parent;if(u.orientation===r){var h=u.children.indexOf(n);if(a){var p=u.children[h+(o?1:-1)];if(p instanceof eA.TabLayoutNode){this._insertTab(e,null,p,!0),++p.tabBar.currentIndex;return}}u.normalizeSizes();var f=u.sizers[h].sizeHint/=2,m=h+(o?1:0),v=this._createTabNode(e);eu.insert(u.children,m,v),eu.insert(u.sizers,m,eA.createSizer(f)),eu.insert(u.handles,m,this._createHandle()),v.parent=u,u.syncHandles();return}var g=eu.removeFirstOf(u.children,n),b=new eA.SplitLayoutNode(r);b.normalized=!0,b.children.push(n),b.sizers.push(eA.createSizer(.5)),b.handles.push(this._createHandle()),n.parent=b;var y=o?1:0,_=this._createTabNode(e);eu.insert(b.children,y,_),eu.insert(b.sizers,y,eA.createSizer(.5)),eu.insert(b.handles,y,this._createHandle()),_.parent=b,b.syncHandles(),eu.insert(u.children,g,b),b.parent=u}}_splitRoot(e){var t=this._root;if(t instanceof eA.SplitLayoutNode&&t.orientation===e)return t;var n=this._root=new eA.SplitLayoutNode(e);return t&&(n.children.push(t),n.sizers.push(eA.createSizer(0)),n.handles.push(this._createHandle()),t.parent=n),n}_fit(){var e=0,t=0;if(this._root){var n=this._root.fit(this._spacing,this._items);e=n.minWidth,t=n.minHeight}var r=this._box=ev.boxSizing(this.parent.node);e+=r.horizontalSum,t+=r.verticalSum;var{style:o}=this.parent.node;o.minWidth="".concat(e,"px"),o.minHeight="".concat(t,"px"),this._dirty=!0,this.parent.parent&&ef.sendMessage(this.parent.parent,rI.Msg.FitRequest),this._dirty&&ef.sendMessage(this.parent,rI.Msg.UpdateRequest)}_update(e,t){if(this._dirty=!1,!!this._root){e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),!this._box&&(this._box=ev.boxSizing(this.parent.node));var n=this._box.paddingTop,r=this._box.paddingLeft,o=e-this._box.horizontalSum,a=t-this._box.verticalSum;this._root.update(n,r,o,a,this._spacing,this._items)}}_createTabBar(){var e=this.renderer.createTabBar(this._document);return e.orientation="horizontal",this.parent&&this.attachWidget(e),e}_createHandle(){var e=this.renderer.createHandle(),{style:t}=e;return t.position="absolute",t.contain="strict",t.top="0",t.left="0",t.width="0",t.height="0",this.parent&&this.parent.node.appendChild(e),e}constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,void 0!==e.spacing&&(this._spacing=rP.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:rI.HiddenMode.Display}}!function(e){function t(e){var t=new rm;return t.sizeHint=e,t.size=e,t}function n(e,t){var r;return r="tab-area"===e.type?function(e,t){if(0===e.widgets.length)return null;var n=[];for(var r of e.widgets)!t.has(r)&&(t.add(r),n.push(r));if(0===n.length)return null;var o=e.currentIndex;return -1!==o&&(o<0||o>=n.length)&&(o=0),{type:"tab-area",widgets:n,currentIndex:o}}(e,t):function(e,t){for(var{orientation:r}=e,o=[],a=[],s=0,l=e.children.length;s{var c=r(a,n,o),d=t(e.sizes[l]),u=n.createHandle();s.children.push(c),s.handles.push(u),s.sizers.push(d),c.parent=s}),s.syncHandles(),s.normalizeSizes(),s}(n,s,l)}e.GOLDEN_RATIO=.618,e.createSizer=t,e.normalizeAreaConfig=n,e.realizeAreaConfig=r;class o{get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(var e of this.tabBar.titles)yield e.owner}*iterSelectedWidgets(){var e=this.tabBar.currentTitle;e&&(yield e.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(e){return -1!==this.tabBar.titles.indexOf(e.title)?this:null}findSplitNode(e){return null}findFirstTabNode(){return this}hitTestTabNodes(e,t){return e=this._left+this._width||t=this._top+this._height?null:this}createConfig(){var e=this.tabBar.titles.map(e=>e.owner),{currentIndex:t}=this.tabBar;return{type:"tab-area",widgets:e,currentIndex:t}}holdAllSizes(){}fit(e,t){var n=0,r=0,o=t.get(this.tabBar),a=this.tabBar.currentTitle,s=a?t.get(a.owner):void 0,[l,c]=this.sizers;return o&&o.fit(),s&&s.fit(),o&&!o.isHidden?(n=Math.max(n,o.minWidth),r+=o.minHeight,l.minSize=o.minHeight,l.maxSize=o.maxHeight):(l.minSize=0,l.maxSize=0),s&&!s.isHidden?(n=Math.max(n,s.minWidth),r+=s.minHeight,c.minSize=s.minHeight):c.minSize=0,c.maxSize=1/0,{minWidth:n,minHeight:r,maxWidth:1/0,maxHeight:1/0}}update(e,t,n,r,o,a){this._top=t,this._left=e,this._width=n,this._height=r;var s=a.get(this.tabBar),l=this.tabBar.currentTitle,c=l?a.get(l.owner):void 0;if(el.calc(this.sizers,r),s&&!s.isHidden){var{size:d}=this.sizers[0];s.update(e,t,n,d),t+=d}if(c&&!c.isHidden){var{size:u}=this.sizers[1];c.update(e,t,n,u)}}constructor(e){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var t=new rm,n=new rm;t.stretch=0,n.stretch=1,this.tabBar=e,this.sizers=[t,n]}}e.TabLayoutNode=o;class a{*iterAllWidgets(){for(var e of this.children)yield*e.iterAllWidgets()}*iterUserWidgets(){for(var e of this.children)yield*e.iterUserWidgets()}*iterSelectedWidgets(){for(var e of this.children)yield*e.iterSelectedWidgets()}*iterTabBars(){for(var e of this.children)yield*e.iterTabBars()}*iterHandles(){for(var e of(yield*this.handles,this.children))yield*e.iterHandles()}findTabNode(e){for(var t=0,n=this.children.length;te.createConfig()),sizes:t}}syncHandles(){this.handles.forEach((e,t)=>{e.setAttribute("data-orientation",this.orientation),t===this.handles.length-1?e.classList.add("lm-mod-hidden"):e.classList.remove("lm-mod-hidden")})}holdSizes(){for(var e of this.sizers)e.sizeHint=e.size}holdAllSizes(){for(var e of this.children)e.holdAllSizes();this.holdSizes()}normalizeSizes(){var e=this.sizers.length;if(0!==e){this.holdSizes();var t=this.sizers.reduce((e,t)=>e+t.sizeHint,0);if(0===t)for(var n of this.sizers)n.size=n.sizeHint=1/e;else for(var r of this.sizers)r.size=r.sizeHint/=t;this.normalized=!0}}createNormalizedSizes(){var e=this.sizers.length;if(0===e)return[];var t=this.sizers.map(e=>e.size),n=t.reduce((e,t)=>e+t,0);if(0===n)for(var r=t.length-1;r>-1;r--)t[r]=1/e;else for(var o=t.length-1;o>-1;o--)t[o]/=n;return t}fit(e,t){for(var n="horizontal"===this.orientation,r=Math.max(0,this.children.length-1)*e,o=n?r:0,a=n?0:r,s=0,l=this.children.length;s-1!==t.titles.indexOf(e.title));if(!t)throw Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(eg.IS_EDGE||eg.IS_IE)&&ef.flush(),ef.postMessage(this,eN.LayoutModified)}addWidget(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"single-document"===this._mode?this.layout.addWidget(e):this.layout.addWidget(e,t),ef.postMessage(this,eN.LayoutModified)}processMessage(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){if(!eN.isGeneratedTabBarProperty.get(e.child))e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){if(!eN.isGeneratedTabBarProperty.get(e.child))e.child.removeClass("lm-DockPanel-widget"),ef.postMessage(this,eN.LayoutModified)}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){if(e.preventDefault(),!this._tabsConstrained||e.source===this)e.stopPropagation(),this.overlay.hide(1)}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||"invalid"===this._showOverlay(e.clientX,e.clientY)?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){var t=this;return(0,e3._)(function*(){if(e.preventDefault(),t.overlay.hide(0),"none"===e.proposedAction){e.dropAction="none";return}var n,{clientX:r,clientY:o}=e,{zone:a,target:s}=eN.findDropTarget(t,r,o,t._edges,t._splitOptions);if(t._tabsConstrained&&e.source!==t||"invalid"===a){e.dropAction="none";return}var{mimeData:l}=e,c=l.getData("application/vnd.lumino.widget-factory");if("function"!=typeof c){e.dropAction="none";return}(yield c()).forEach((r,o)=>{0===o?(t.bindWidget(e,r,a,s),n=r):t.bindWidget(e,r,"widget-all",s,n)})})()}bindWidget(e,t,n,r,o){if(!(t instanceof rI)||t.contains(this)){e.dropAction="none";return}var a=r?eN.getDropRef(r.tabBar):null;switch(o&&(a=o),n){case"root-all":this.addWidget(t);break;case"root-top":this.addWidget(t,{mode:"split-top"});break;case"root-left":this.addWidget(t,{mode:"split-left"});break;case"root-right":this.addWidget(t,{mode:"split-right"});break;case"root-bottom":this.addWidget(t,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(t,{mode:"tab-after",ref:a});break;case"widget-top":this.addWidget(t,{mode:"split-top",ref:a});break;case"widget-left":this.addWidget(t,{mode:"split-left",ref:a});break;case"widget-right":this.addWidget(t,{mode:"split-right",ref:a});break;case"widget-bottom":this.addWidget(t,{mode:"split-bottom",ref:a});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&(this._releaseMouse(),ef.postMessage(this,eN.LayoutModified))}_evtPointerDown(e){if(0!==e.button)return;var t=this.layout,n=e.target,r=ry(t.handles(),e=>e.contains(n));if(!!r){e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);var o=r.getBoundingClientRect(),a=e.clientX-o.left,s=e.clientY-o.top,l=window.getComputedStyle(r),c=rK.overrideCursor(l.cursor,this._document);this._pressData={handle:r,deltaX:a,deltaY:s,override:c}}}_evtPointerMove(e){if(!!this._pressData){e.preventDefault(),e.stopPropagation();var t=this.node.getBoundingClientRect(),n=e.clientX-t.left-this._pressData.deltaX,r=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,n,r)}}_evtPointerUp(e){if(0===e.button)e.preventDefault(),e.stopPropagation(),this._releaseMouse(),ef.postMessage(this,eN.LayoutModified)}_releaseMouse(){if(!!this._pressData)this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0)}_showOverlay(e,t){var n,r,o,a,{zone:s,target:l}=eN.findDropTarget(this,e,t,this._edges,this._splitOptions);if("invalid"===s)return this.overlay.hide(100),s;var c=ev.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(s){case"root-all":n=c.paddingTop,r=c.paddingLeft,o=c.paddingRight,a=c.paddingBottom;break;case"root-top":n=c.paddingTop,r=c.paddingLeft,o=c.paddingRight,a=d.height*eN.GOLDEN_RATIO;break;case"root-left":n=c.paddingTop,r=c.paddingLeft,o=d.width*eN.GOLDEN_RATIO,a=c.paddingBottom;break;case"root-right":n=c.paddingTop,r=d.width*eN.GOLDEN_RATIO,o=c.paddingRight,a=c.paddingBottom;break;case"root-bottom":n=d.height*eN.GOLDEN_RATIO,r=c.paddingLeft,o=c.paddingRight,a=c.paddingBottom;break;case"widget-all":n=l.top,r=l.left,o=l.right,a=l.bottom;break;case"widget-top":n=l.top,r=l.left,o=l.right,a=l.bottom+l.height/2;break;case"widget-left":n=l.top,r=l.left,o=l.right+l.width/2,a=l.bottom;break;case"widget-right":n=l.top,r=l.left+l.width/2,o=l.right,a=l.bottom;break;case"widget-bottom":n=l.top+l.height/2,r=l.left,o=l.right,a=l.bottom;break;case"widget-tab":var u=l.tabBar.node.getBoundingClientRect().height;n=l.top,r=l.left,o=l.right,a=l.bottom+l.height-u;break;default:throw"unreachable"}return this.overlay.show({top:n,left:r,right:o,bottom:a}),s}_createTabBar(){var e=this._renderer.createTabBar(this._document);return eN.isGeneratedTabBarProperty.set(e,!0),"single-document"===this._mode&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){ef.postMessage(this,eN.LayoutModified)}_onCurrentChanged(e,t){var{previousTitle:n,currentTitle:r}=t;n&&n.owner.hide(),r&&r.owner.show(),(eg.IS_EDGE||eg.IS_IE)&&ef.flush(),ef.postMessage(this,eN.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(!this._drag){e.releaseMouse();var{title:n,tab:r,clientX:o,clientY:a,offset:s}=t,l=new rk;l.setData("application/vnd.lumino.widget-factory",()=>[n.owner]);var c=r.cloneNode(!0);s&&(c.style.top="-".concat(s.y,"px"),c.style.left="-".concat(s.x,"px")),this._drag=new rK({document:this._document,mimeData:l,dragImage:c,proposedAction:"move",supportedActions:"move",source:this}),r.classList.add("lm-mod-hidden");this._drag.start(o,a).then(()=>{this._drag=null,r.classList.remove("lm-mod-hidden")})}}constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new rE(this),this._addRequested=new rE(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._splitOptions=e.splitOptions,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||rX.defaultRenderer,this._edges=e.edges||eN.DEFAULT_EDGES,void 0!==e.tabsMovable&&(this._tabsMovable=e.tabsMovable),void 0!==e.tabsConstrained&&(this._tabsConstrained=e.tabsConstrained),void 0!==e.addButtonEnabled&&(this._addButtonEnabled=e.addButtonEnabled),this.dataset.mode=this._mode;this.layout=new rY({document:this._document,renderer:{createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()},spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new rX.Overlay,this.node.appendChild(this.overlay.node)}}!function(e){e.Overlay=class e{show(e){var{style:t}=this.node;if(t.top="".concat(e.top,"px"),t.left="".concat(e.left,"px"),t.right="".concat(e.right,"px"),t.bottom="".concat(e.bottom,"px"),clearTimeout(this._timer),this._timer=-1,!!this._hidden)this._hidden=!1,this.node.classList.remove("lm-mod-hidden")}hide(e){if(this._hidden)return;if(e<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}if(-1===this._timer)this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},e)}constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}};class t{createTabBar(e){var t=new rZ({document:e});return t.addClass("lm-DockPanel-tabBar"),t}createHandle(){var e=document.createElement("div");return e.className="lm-DockPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t}(rX||(rX={})),(O=eN||(eN={})).GOLDEN_RATIO=.618,O.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},O.LayoutModified=new rw("layout-modified"),O.isGeneratedTabBarProperty=new rv({name:"isGeneratedTabBar",create:()=>!1}),O.createSingleDocumentConfig=function(e){if(e.isEmpty)return{main:null};var t=Array.from(e.widgets()),n=e.selectedWidgets().next().value,r=n?t.indexOf(n):-1;return{main:{type:"tab-area",widgets:t,currentIndex:r}}},O.findDropTarget=function(e,t,n,r,o){if(!ev.hitTest(e.node,t,n))return{zone:"invalid",target:null};var a=e.layout;if(a.isEmpty)return{zone:"root-all",target:null};var s=a.hitTestTabAreas(t,n);if(null==o?void 0:o.maxSplitCount){var l=function e(t){return(null==t?void 0:t.type)==="tab-area"?1:(null==t?void 0:t.type)==="split-area"?t.children.reduce((t,n)=>t+e(n),0):0}(a.saveLayout().main);if(!s)return{zone:"invalid",target:null};if(l>=o.maxSplitCount)return{zone:"widget-all",target:s};if((null==o?void 0:o.splitOrientation)==="horizontal")return s&&s.xs.width/4*3?{zone:"widget-right",target:s}:{zone:"widget-all",target:s};if((null==o?void 0:o.splitOrientation)==="vertical")return s&&s.ys.height/4*3?{zone:"widget-bottom",target:s}:{zone:"widget-all",target:s}}if("multiple-document"===e.mode){var c=e.node.getBoundingClientRect(),d=t-c.left+1,u=n-c.top+1,h=c.right-t,p=c.bottom-n;switch(Math.min(u,h,p,d)){case u:if(ub&&v>b&&m>y&&g>y?{zone:"widget-all",target:s}:{zone:function(e,t,n,r){var o;switch(Math.min(e,t,n,r)){case e:o="widget-left";break;case t:o="widget-top";break;case n:o="widget-right";break;case r:o="widget-bottom";break;default:throw"unreachable"}return o}(f/=b,m/=y,v/=b,g/=y),target:s}},O.getDropRef=function(e){return 0===e.titles.length?null:e.currentTitle?e.currentTitle.owner:e.titles[e.titles.length-1].owner};class rQ extends rM{dispose(){for(var e of this._items){var{widget:t}=e;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){if(e!==this.rowCount)eL.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit()}get columnCount(){return this._columnSizers.length}set columnCount(e){if(e!==this.columnCount)eL.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit()}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){if(e=eL.clampValue(e),this._rowSpacing!==e)this._rowSpacing=e,this.parent&&this.parent.fit()}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){if(e=eL.clampValue(e),this._columnSpacing!==e)this._columnSpacing=e,this.parent&&this.parent.fit()}rowStretch(e){var t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){var n=this._rowSizers[e];if(!n)return;if(t=eL.clampValue(t),n.stretch!==t)n.stretch=t,this.parent&&this.parent.update()}columnStretch(e){var t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){var n=this._columnSizers[e];if(!n)return;if(t=eL.clampValue(t),n.stretch!==t)n.stretch=t,this.parent&&this.parent.update()}*[Symbol.iterator](){for(var e of this._items)yield e.widget}addWidget(e){if(-1===eu.findFirstIndex(this._items,t=>t.widget===e))this._items.push(new rR(e)),this.parent&&this.attachWidget(e)}removeWidget(e){var t=eu.findFirstIndex(this._items,t=>t.widget===e);if(-1!==t){var n=eu.removeAt(this._items,t);this.parent&&this.detachWidget(e),n.dispose()}}init(){for(var e of(super.init(),this))this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&ef.sendMessage(e,rI.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&ef.sendMessage(e,rI.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&ef.sendMessage(e,rI.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&ef.sendMessage(e,rI.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(var e=0,t=this.rowCount;e!e.isHidden),a=0,s=o.length;a({row:0,column:0,rowSpan:1,columnSpan:1}),changed:function(e){e.parent&&e.parent.layout instanceof rQ&&e.parent.fit()}}),W.normalizeConfig=function(e){var t=Math.max(0,Math.floor(e.row||0)),n=Math.max(0,Math.floor(e.column||0)),r=Math.max(1,Math.floor(e.rowSpan||0));return{row:t,column:n,rowSpan:r,columnSpan:Math.max(1,Math.floor(e.columnSpan||0))}},W.clampValue=function(e){return Math.max(0,Math.floor(e))},W.rowSpanCmp=function(e,t){var n=W.cellConfigProperty.get(e.widget),r=W.cellConfigProperty.get(t.widget);return n.rowSpan-r.rowSpan},W.columnSpanCmp=function(e,t){var n=W.cellConfigProperty.get(e.widget),r=W.cellConfigProperty.get(t.widget);return n.columnSpan-r.columnSpan},W.reallocSizers=function(e,t){for(t=Math.max(1,Math.floor(t));e.lengtht&&(e.length=t)},W.distributeMin=function(e,t,n,r){if(n=r))for(var l=(r-a)/(n-t+1),c=t;c<=n;++c)e[c].minSize+=l},(F=ez||(ez={})).createNode=function(){var e=document.createElement("div"),t=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div"),o=document.createElement("div");return t.className="lm-ScrollBar-button",n.className="lm-ScrollBar-button",t.dataset.action="decrement",n.dataset.action="increment",r.className="lm-ScrollBar-track",o.className="lm-ScrollBar-thumb",r.appendChild(o),e.appendChild(t),e.appendChild(r),e.appendChild(n),e},F.findPart=function(e,t){return e.thumbNode.contains(t)?"thumb":e.trackNode.contains(t)?"track":e.decrementNode.contains(t)?"decrement":e.incrementNode.contains(t)?"increment":null},Symbol.iterator;class rG extends rD{dispose(){for(var e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){if(this._orientation===e)return;if(this._orientation=e,!!this.parent)this.parent.dataset.orientation=e,this.parent.fit()}get alignment(){return this._alignment}set alignment(e){if(this._alignment===e)return;if(this._alignment=e,!!this.parent)this.parent.dataset.alignment=e,this.parent.update()}get spacing(){return this._spacing}set spacing(e){if(e=eC.clampDimension(e),this._spacing===e)return;if(this._spacing=e,!!this.parent)this.parent.fit()}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(e=>e.size)}relativeSizes(){return eO.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e){for(var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this._sizers.length,r=e.slice(0,n);r.length0&&(o.sizeHint=o.size);el.adjust(this._sizers,e,n),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){var n=new rR(t),r=eO.createHandle(this.renderer),o=eO.averageSize(this._sizers),a=eO.createSizer(o);eu.insert(this._items,e,n),eu.insert(this._sizers,e,a),eu.insert(this._handles,e,r),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(r),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){eu.move(this._items,e,t),eu.move(this._sizers,e,t),eu.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){var n=eu.removeAt(this._items,e),r=eu.removeAt(this._handles,e);eu.removeAt(this._sizers,e),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(r),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,n,r,o,a,s){var l=this._items[e];if(!l.isHidden){var c=this._handles[e].style;t?(n+=this.widgetOffset,l.update(n,r,s,o),n+=s,c.top="".concat(r,"px"),c.left="".concat(n,"px"),c.width="".concat(this._spacing,"px"),c.height="".concat(o,"px")):(r+=this.widgetOffset,l.update(n,r,a,s),r+=s,c.top="".concat(r,"px"),c.left="".concat(n,"px"),c.width="".concat(a,"px"),c.height="".concat(this._spacing,"px"))}}_fit(){for(var e=0,t=-1,n=0,r=this._items.length;n0&&(u.sizeHint=u.size),d.isHidden){u.minSize=0,u.maxSize=0;continue}d.fit(),u.stretch=rG.getStretch(d.widget),o?(u.minSize=d.minWidth,u.maxSize=d.maxWidth,a+=d.minWidth,s=Math.max(s,d.minHeight)):(u.minSize=d.minHeight,u.maxSize=d.maxHeight,s+=d.minHeight,a=Math.max(a,d.minWidth))}var h=this._box=ev.boxSizing(this.parent.node);a+=h.horizontalSum,s+=h.verticalSum;var{style:p}=this.parent.node;p.minWidth="".concat(a,"px"),p.minHeight="".concat(s,"px"),this._dirty=!0,this.parent.parent&&ef.sendMessage(this.parent.parent,rI.Msg.FitRequest),this._dirty&&ef.sendMessage(this.parent,rI.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;for(var n=0,r=0,o=this._items.length;r0){if(f=h?Math.max(0,l-this._fixed):Math.max(0,c-this._fixed),this._hasNormedSizes){for(var p of this._sizers)p.sizeHint*=f;this._hasNormedSizes=!1}var f,m=el.calc(this._sizers,f);if(m>0)switch(this._alignment){case"start":break;case"center":d=0,u=m/2;break;case"end":d=0,u=m;break;case"justify":d=m/n,u=0;break;default:throw"unreachable"}}for(var v=0,g=this._items.length;v0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:function(e){e.parent&&e.parent.layout instanceof rG&&e.parent.fit()}}),U.createSizer=function(e){var t=new rm;return t.sizeHint=Math.floor(e),t},U.createHandle=function(e){var t=e.createHandle();return t.style.position="absolute",t.style.contain="style",t},U.averageSize=function(e){return e.reduce((e,t)=>e+t.size,0)/e.length||0},U.normalize=function(e){var t=e.length;if(0===t)return[];var n=e.reduce((e,t)=>e+Math.abs(t),0);return 0===n?e.map(e=>1/t):e.map(e=>e/n)};class rJ extends rN{dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),27===e.keyCode&&this._releaseMouse()}_evtPointerDown(e){if(0!==e.button)return;var t,n=this.layout,r=eu.findFirstIndex(n.handles,t=>t.contains(e.target));if(-1!==r){e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var o=n.handles[r],a=o.getBoundingClientRect();t="horizontal"===n.orientation?e.clientX-a.left:e.clientY-a.top;var s=window.getComputedStyle(o),l=rK.overrideCursor(s.cursor);this._pressData={index:r,delta:t,override:l}}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();var t,n=this.layout,r=this.node.getBoundingClientRect();t="horizontal"===n.orientation?e.clientX-r.left-this._pressData.delta:e.clientY-r.top-this._pressData.delta,n.moveHandle(this._pressData.index,t)}_evtPointerUp(e){if(0===e.button)e.preventDefault(),e.stopPropagation(),this._releaseMouse()}_releaseMouse(){if(!!this._pressData)this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0)}constructor(e={}){super({layout:eB.createLayout(e)}),this._handleMoved=new rE(this),this._pressData=null,this.addClass("lm-SplitPanel")}}!function(e){class t{createHandle(){var e=document.createElement("div");return e.className="lm-SplitPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t;e.getStretch=function(e){return rG.getStretch(e)};e.setStretch=function(e,t){rG.setStretch(e,t)}}(rJ||(rJ={})),(eB||(eB={})).createLayout=function(e){return e.layout||new rG({renderer:e.renderer||rJ.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing})};class r$ extends rD{get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e)this._hiddenMode=e,this.widgets.length>1&&this.widgets.forEach(e=>{e.hiddenMode=this._hiddenMode})}dispose(){for(var e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===rI.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=rI.HiddenMode.Scale),t.hiddenMode=rI.HiddenMode.Scale):t.hiddenMode=rI.HiddenMode.Display,eu.insert(this._items,e,new rR(t)),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){eu.move(this._items,e,t),this.parent.update()}detachWidget(e,t){var n=eu.removeAt(this._items,e);this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterDetach),n.widget.node.style.zIndex="",this._hiddenMode===rI.HiddenMode.Scale&&(t.hiddenMode=rI.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=rI.HiddenMode.Display)),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(var e=0,t=0,n=0,r=this._items.length;n{e.scrollBar&&(e.scrollBar.destroy(),e.scrollBar=void 0),t.style.overflow="initial"}))})()}onAfterAttach(e){super.onAfterAttach(e),this.scrollOptions&&this.createScrollbar()}getScrollContainer(){return this.node}disableScrollBarFocus(e){for(var t of[e.getElementsByClassName("ide-ps__thumb-x"),e.getElementsByClassName("ide-ps__thumb-y")])for(var n=0;nthis.widgets.delete(e))}doGetWidget(e){var t,n=null!==(t=this.widgets.get(e))&&void 0!==t?t:this.pendingWidgetPromises.get(e);if(n)return n}createSubWidget(e,t){var n=this;return(0,e3._)(function*(){var r=n.uriToWidgetID(e),o=n.getWidget(r);if(o)return o;var a=n.containerFactory.createChild();a.bind(t).toSelf().inSingletonScope();var s=a.get(t);return s.id=r,s.init(e,a),n.setWidget(r,s),s})()}getOrCreateWidgetFromURI(e,t){var n=this;return(0,e3._)(function*(){if(!(t=t||n.getFactoryFromURI(e)))throw Error("No widget factory '".concat(e.toString(),"' has been registered."));var r=n.uriToWidgetID(e,t),o=n.doGetWidget(r);if(o)return o;try{var a,s,l=null===(a=t.createWidget)||void 0===a?void 0:a.call(t,e);if(!l&&t.widget&&((s=n.containerFactory.createChild()).bind(t.widget).toSelf().inSingletonScope(),l=s.get(t.widget)),!l&&t.render&&(s=n.containerFactory.createChild(),l=n.customRenderWidgetFactory(s)),!l)throw Error("No widget createWidget");n.pendingWidgetPromises.set(r,l);var c=yield l;return t.render&&(c.render=t.render),c.id=r,c.init(e,s),n.setWidget(r,c),c}finally{n.pendingWidgetPromises.delete(r)}})()}constructor(){this.widgets=new Map,this.widgetFactories=[],this.pendingWidgetPromises=new Map}}(0,e2.gn)([(0,e8.f)(r3),(0,e2.w6)("design:type",void 0===r3?Object:r3)],r9.prototype,"customRenderWidgetFactory",void 0),(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(r5),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],r9.prototype,"factoryProvider",void 0),(0,e2.gn)([(0,e8.f)(tc),(0,e2.w6)("design:type",void 0===tc?Object:tc)],r9.prototype,"containerFactory",void 0),r9=(0,e2.gn)([(0,e4.b)()],r9);var r7=Symbol("ViewOptions"),ie="flowide-main-panel",it="flowide-bottom-panel",ir={[r6.TOP_BAR]:new tD("flowide:///panel/flowide-top-bar"),[r6.ACTIVITY_BAR]:new tD("flowide:///panel/flowide-activity-bar"),[r6.PRIMARY_SIDEBAR]:new tD("flowide:///panel/flowide-primary-sidebar"),[r6.MAIN_PANEL]:new tD("flowide:///panel/".concat(ie)),[r6.SECONDARY_SIDEBAR]:new tD("flowide:///panel/flowide-secondary-sidebar"),[r6.BOTTOM_PANEL]:new tD("flowide:///panel/".concat(it)),[r6.STATUS_BAR]:new tD("flowide:///panel/flowide-status-bar"),[r6.RIGHT_BAR]:new tD("flowide:///panel/flowide-right-bar")},ii=[r6.TOP_BAR,r6.ACTIVITY_BAR,r6.PRIMARY_SIDEBAR,r6.MAIN_PANEL,r6.SECONDARY_SIDEBAR,r6.BOTTOM_PANEL,r6.STATUS_BAR,r6.RIGHT_BAR],io="flow-split-widget-panel",ia="custom-tabBar-container",is="flow-tabBar-action-container",il="flow-tabBar-scroll-container",ic="flow-toolbar-container",id="flow-toolbar-item",iu="disable-handle-event",ih=new tD("flowide:///hover/tooltip-label"),ip="single-document";new tD("flowide://panel/debug-bar-content");var im="debug-bar-pos";class iv extends r2{init(){var e,t;(null===(t=this.options)||void 0===t?void 0:null===(e=t.defaultLayoutData)||void 0===e?void 0:e.debugBar)&&(this.eventService.listenGlobalEvent("mousedown",this._evtPointerDown.bind(this)),this.eventService.listenGlobalEvent("mousemove",this._evtPointerMove.bind(this)),this.eventService.listenGlobalEvent("mouseup",this._evtPointerUp.bind(this)),this.node.classList.remove("lm-Widget"),this.node.classList.add("global-Widget"))}initContent(e){this.content=null==e?void 0:e.render();var t,n,r,o=(null==e?void 0:e.memoPosition)?JSON.parse(null===(t=this.storageService)||void 0===t?void 0:t.getData(im,"{}")):{};this.ref.current&&(this.ref.current.style.left=(null==o?void 0:o.left)||(null==e?void 0:null===(n=e.defaultPosition)||void 0===n?void 0:n.left),this.ref.current.style.top=(null==o?void 0:o.top)||(null==e?void 0:null===(r=e.defaultPosition)||void 0===r?void 0:r.top))}_evtPointerDown(e){if(0!==e.button&&1!==e.button)return;var t,n,r=null===(t=this.ref.current)||void 0===t?void 0:t.querySelector(".".concat("flow-debug-bar-draggable"));if((!e.target||!!(null==r?void 0:r.contains(e.target))||r===e.target)&&!this._dragPos){e.stopPropagation(),this._dragPos={x:e.clientX,y:e.clientY};var o=null===(n=this.ref.current)||void 0===n?void 0:n.getBoundingClientRect();this.initialPos={x:(null==o?void 0:o.left)||0,y:(null==o?void 0:o.top)||0,width:(null==o?void 0:o.width)||0,height:(null==o?void 0:o.height)||0}}}_evtPointerMove(e){if(!!this._dragPos&&!!this.initialPos){if(e.preventDefault(),e.stopPropagation(),this.initialPos&&this._dragPos&&this.ref.current){var t=0,n=0,r=document.documentElement.clientWidth,o=document.documentElement.clientHeight,a=this.initialPos.x+e.clientX-this._dragPos.x,s=this.initialPos.y+e.clientY-this._dragPos.y;t=a<0?0:a>r-this.initialPos.width?r-this.initialPos.width:a,n=s<0?0:s>o-this.initialPos.height?o-this.initialPos.height:s,this.ref.current.style.left="".concat(t,"px"),this.ref.current.style.top="".concat(n,"px")}}}_evtPointerUp(e){e.stopPropagation();var t,n,r={left:null===(t=this.ref.current)||void 0===t?void 0:t.style.left,top:null===(n=this.ref.current)||void 0===n?void 0:n.style.top};this.storageService.setData(im,JSON.stringify(r)),this._dragPos=null,this.initialPos=null}render(){return(0,tK.jsx)("div",{className:"debug-bar-widget-container",ref:this.ref,style:this.isHidden?{display:"none"}:{},children:this.content})}constructor(...e){super(...e),this.content=null,this.ref=tq.createRef(),this._dragPos=null,this.initialPos=null}}function ig(e,t){return!!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.indexOf(e)>=0)||"undefined"!=typeof process&&process.platform===t}(0,e2.gn)([(0,e8.f)(nY),(0,e2.w6)("design:type",void 0===nY?Object:nY)],iv.prototype,"eventService",void 0),(0,e2.gn)([(0,e8.f)(r7),(0,e2.w6)("design:type",void 0===r7?Object:r7)],iv.prototype,"options",void 0),(0,e2.gn)([(0,e8.f)(tu),(0,e2.w6)("design:type",void 0===tu?Object:tu)],iv.prototype,"storageService",void 0),(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],iv.prototype,"init",null),iv=(0,e2.gn)([(0,e4.b)()],iv),ig("Windows","win32"),ig("Mac","darwin");function ib(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"codicon codicon-".concat(e).concat(t?" ".concat("action-label"):"")}var iy=n("9430"),i_=n("921463"),iw=n("801815"),ix=(e,t,n)=>{var r,o;return{key:(null===(o=e.getResourceURI())||void 0===o?void 0:null===(r=o.toString)||void 0===r?void 0:r.call(o))||(0,iw.x0)(),comp:tq.memo(function(){var r=(0,eX.JA)();(0,tq.useEffect)(()=>{var t=e.onUpdate(()=>r());return()=>t.dispose()},[]);var o=(0,tK.jsx)(iy.SV,{fallbackRender:t=>(0,tK.jsx)(n,(0,tv._)((0,tm._)({},t),{widget:e})),children:(0,tK.jsx)(r1.Provider,{value:e,children:(0,tK.jsx)(t,{})})});return i_.createPortal(o,e.node)})}},iS=(e,t)=>e.withoutQuery().toString()===t.withoutQuery().toString(),ik=(e,t,n)=>{for(var r=new rA(n),o=0;o{var r={renderer:rJ.defaultRenderer};n&&(r=(0,tm._)({},r,n));for(var o=new rG(r),a=0;a{var{item:t}=e,n=nF(nL),r=(0,tq.useMemo)(()=>n.renderer(t.uri),[t.uri]);return r?(0,tK.jsx)("div",{className:"flowide-status-bar-item",children:r}):null},iT=e=>{var{items:t}=e;return nZ("flowide-status-bar-widget",(e,t)=>{var{getColor:n}=t;return"\n .flowide-status-bar-widget-container {\n display: flex;\n height: 100%;\n justify-content: space-between;\n padding: 0 8px;\n }\n .flowide-status-bar-side {\n display: flex;\n }\n .flowide-status-bar-item {\n height: 100%;\n cursor: pointer;\n padding: 0 4px;\n margin: 0 2px;\n font-size: 12px;\n color: ".concat(n("flowide.color.base.text.0"),";\n display: flex;\n align-items: center;\n }\n .flowide-status-bar-item:hover {\n background: ").concat(n("flowide.color.base.fill.0"),"\n }\n ")}),(0,tK.jsxs)("div",{className:"flowide-status-bar-widget-container",children:[(0,tK.jsx)("div",{className:"flowide-status-bar-side",children:t.filter(e=>"left"===e.position).map(e=>(0,tK.jsx)(iE,{item:e},e.uri.toString()))}),(0,tK.jsx)("div",{className:"flowide-status-bar-side",children:t.filter(e=>"right"===e.position).map(e=>(0,tK.jsx)(iE,{item:e},e.uri.toString()))})]})},iI=new tD("flowide://panel/status-bar-content");class iP extends r2{initView(e){var t=this;return(0,e3._)(function*(){t.list=e,t.id="flowide-status-bar-container",t.scrollbar=new rd(t.node),t.update()})()}render(){return(0,tK.jsx)(iT,{items:this.list})}constructor(...e){super(...e),this.list=[]}}iP=(0,e2.gn)([(0,e4.b)()],iP);var iM=n("171505"),iR=n("131325");(eH||(eH={})).invertIfNecessary=function(e,t,n,r,o,a){if("left"===e){if(a){if(t.left-t.width<0)return"right"}else if(t.left-n.width<0)return"right"}else if("right"===e){if(a){if(t.right+t.width>r)return"left"}else if(t.right+n.width>r)return"left"}else if("top"===e){if(a){if(t.top-t.height<0)return"bottom"}else if(t.top-n.height<0)return"bottom"}else if("bottom"===e){if(a){if(t.bottom+t.height>o)return"top"}else if(t.bottom+n.height>o)return"top"}return e};class iD{get hoverHost(){return!this._hoverHost&&(this._hoverHost=document.createElement("div"),this._hoverHost.classList.add(iD.hostClassName),this._hoverHost.style.position="absolute"),this._hoverHost}enableCustomHoverHost(){!this._hoverHost&&(this.enableCustomHost=!0,this._hoverHost=document.createElement("div"),this.reactRoot=(0,iR.createRoot)(this._hoverHost),this._hoverHost.style.position="absolute")}requestHover(e){e.target!==this.hoverTarget&&(this.cancelHover(),this.pendingTimeout=function(){for(var e=arguments.length,t=Array(e),n=0;nclearTimeout(r)}}(()=>this.renderHover(e),this.getHoverDelay()))}renderHover(e){var t=this;return(0,e3._)(function*(){var n,r=t.hoverHost,{target:o,content:a,position:s,cssClasses:l,offset:c}=e;if(l&&r.classList.add(...l),t.hoverTarget=o,!t.reactRoot&&a instanceof HTMLElement?(r.appendChild(a),n=a):!t.reactRoot&&"string"==typeof a&&(r.textContent=a),r.style.top="0px",r.style.left="0px",document.body.append(r),e.visualPreview){var d=n?n.offsetWidth:t.hoverHost.offsetWidth,u=e.visualPreview(d);u&&r.appendChild(u)}yield function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new Promise(t=>{!function n(){e<=0?t():(e--,requestAnimationFrame(n))}()})}();var h=t.setHostPosition(o,r,s,c);if(t.reactRoot){var p=t.labelService.renderer(ih,{content:a,position:h,key:new Date().getTime()});t.reactRoot.render(p)}t.disposeOnHide.push({dispose:()=>{t.lastHidHover=Date.now(),r.classList.remove(h),l&&r.classList.remove(...l)}}),t.listenForMouseOut()})()}listenForMouseOut(){var e=e=>{var t;if(!!this.hoverTarget)e.target instanceof Node&&!this.hoverHost.contains(e.target)&&!(null===(t=this.hoverTarget)||void 0===t?void 0:t.contains(e.target))&&this.cancelHover()};document.addEventListener("mousemove",e),this.disposeOnHide.push({dispose:()=>document.removeEventListener("mousemove",e)})}getHoverDelay(){return Date.now()-this.lastHidHover<200?0:200}setHostPosition(e,t,n,r){var o=t.getBoundingClientRect(),a=e.getBoundingClientRect(),s=document.documentElement.scrollHeight,l=document.body.getBoundingClientRect().width,c=r||0;if("top"===(n=eH.invertIfNecessary(n,a,o,l,s,this.enableCustomHost))||"bottom"===n){var d=a.left+a.width/2-o.width/2,u=Math.min(l-o.width,d),h="top"===n?a.top-o.height+c:a.bottom-c,p=Math.max(0,u);t.style.top="".concat(h,"px"),t.style.left="".concat(p,"px")}else{var f=a.top+a.height/2-o.height/2,m=Math.min(s-o.height,f),v="left"===n?a.left-o.width-c:a.right+c,g=Math.max(0,m);t.style.left="".concat(v,"px"),t.style.top="".concat(g,"px")}return t.classList.add(n),n}unRender(){this.hoverHost.remove(),this.hoverHost.replaceChildren()}cancelHover(){var e;if(this.reactRoot){var t=this.labelService.renderer(ih,{visible:!1,key:new Date().getTime()});this.reactRoot.render(t)}else this.unRender();null===(e=this.pendingTimeout)||void 0===e||e.dispose(),this.disposeOnHide.dispose(),this.hoverTarget=void 0}constructor(){this.reactRoot=null,this.lastHidHover=Date.now(),this.enableCustomHost=!1,this.disposeOnHide=new eX.K4}}function iA(){var e=(0,tq.useContext)(r1);if(null==e?void 0:e.wrapperWidget)return null==e?void 0:e.wrapperWidget;if(!e)throw Error("[useCurrentWidget] Undefined react widget from ide context");return e}function iN(e){var t=nF(iq),n=(0,eX.JA)();return(0,tq.useEffect)(()=>{var e=t.onCurrentWidgetChange(()=>{n()});return()=>e.dispose()},[t]),t.getCurrentWidget(e)}iD.hostClassName="flow-hover",iD.styleSheetId="flow-hover-style",(0,e2.gn)([(0,e8.f)(nL),(0,e2.w6)("design:type",void 0===nL?Object:nL)],iD.prototype,"labelService",void 0),iD=(0,e2.gn)([(0,e4.b)()],iD),tq.createContext(void 0);var iL=()=>{nZ("flowide-activity-bar-widget",(e,t)=>{var{getColor:n}=t;return"\n .activity-bar-widget-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: space-between;\n\n .top-container, .bottom-container {\n display: flex;\n flex-direction: column;\n }\n\n .item-container {\n cursor: pointer;\n position: relative;\n color: ".concat(n("flowide.color.base.text.2"),";\n }\n .item-container.active {\n color: ").concat(n("flowide.color.base.text.0"),";\n }\n .item-container.selected {\n color: ").concat(n("flowide.color.base.text.0"),';\n }\n .item-container.selected::before {\n content: "";\n position: absolute;\n width: 2px;\n height: 100%;\n background: ').concat(n("flowide.color.base.primary"),";\n }\n .item-container:hover {\n color: ").concat(n("flowide.color.base.text.0"),";\n }\n\n .item-container > i {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 18px;\n text-align: center;\n color: inherit;\n\n width: 36px;\n height: 36px;\n mask-repeat: no-repeat;\n -webkit-mask-repeat: no-repeat;\n mask-size: 24px;\n -webkit-mask-size: 24px;\n mask-position: 50% 50%;\n -webkit-mask-position: 50% 50%;\n }\n }")})},iz=e=>{var t,n,{list:r,currentUri:o,setCurrentUri:a}=e,s=nF(nL),l=nF(iD),c=nF(ts),d=null===(n=iN(r6.MAIN_PANEL))||void 0===n?void 0:n.uri,u=e=>{var t=s.getIcon(e.uri);return"string"!=typeof t?t:(0,tK.jsx)("i",{className:ib(t)})};var h=(t=(0,e3._)(function*(e,t){(null==t?void 0:t.onClick)?t.onClick(e):"top"===t.position?a(t.uri):c.open(t.uri),l.cancelHover()}),function(e,n){return t.apply(this,arguments)}),p=(0,tq.useCallback)((e,t)=>{if(!!t)l.requestHover({content:t,target:e.currentTarget,position:"right"})},[]),f=e=>{var t=s.getName(e.uri),n=o&&e.uri.isEqualOrParent(o),r=d&&e.uri.isEqualOrParent(d);return(0,tK.jsx)("div",{className:(0,iM.clsx)("item-container",n&&"selected",r&&"active"),onClick:t=>h(t,e),onMouseEnter:t=>!n&&p(t,e.tooltip),children:u(e)},t)};return iL(),(0,tK.jsxs)("div",{className:"activity-bar-widget-container",children:[(0,tK.jsx)("div",{className:"top-container",children:r.filter(e=>"top"===e.position).map(e=>f(e))}),(0,tK.jsx)("div",{className:"bottom-container",children:r.filter(e=>"bottom"===e.position).map(e=>f(e))})]})},iO=new tD("flowide://panel/activity-bar-content");class iB extends r2{initView(e,t){var n=this;return(0,e3._)(function*(){n.list=e,n.id="flowide-activity-bar-container",t&&n.setCurrentUri(t)})()}setCurrentUri(e){this.currentUri===e?this.currentUri=void 0:this.currentUri=e,this.openerService.open(e),this.update()}storeState(){throw Error("Method not implemented.")}restoreState(e){throw Error("Method not implemented.")}render(){return(0,tK.jsx)(iz,{list:this.list,currentUri:this.currentUri,setCurrentUri:e=>this.setCurrentUri(e)})}constructor(...e){super(...e),this.list=[]}}(0,e2.gn)([(0,e8.f)(ts),(0,e2.w6)("design:type",void 0===ts?Object:ts)],iB.prototype,"openerService",void 0),iB=(0,e2.gn)([(0,e4.b)()],iB);var iW=Symbol("SidePanelHandlerFactory");class iF{create(e){this.side=e,this.container=this.createContainer()}createContainer(){var e,t=new rA({direction:"top-to-bottom",spacing:0}),n=new rL({layout:t});this.contentPanel=n;var{side:r}=this;switch(r){case"left":e="left-to-right";break;case"right":e="right-to-left";break;default:throw Error("Illegal argument: ".concat(r))}var o=new rA({direction:e,spacing:0}),a=new rN({layout:new rD});return a.addClass("flow-app-sidebar-container"),this.contentPanel.layout=t,rL.setStretch(a,0),rL.setStretch(n,1),o.addWidget(a),o.addWidget(n),new rL({layout:o})}expand(e){this.container.show()}}iF=(0,e2.gn)([(0,e4.b)()],iF);var iH=Symbol("DockPanelRendererFactory"),iU="flow-tabBar-active";class iV extends rX{get onDidChangeCurrent(){return this.onDidChangeCurrentEmitter.event}get currentTitle(){return this._currentTitle}markActiveTabBar(e){var t=Array.from(this.tabBars());t.forEach(e=>e.removeClass(iU));var n=e&&this.findTabBar(e);n?n.addClass(iU):t.length>0&&t[0].addClass(iU)}get currentTabBar(){return this._currentTitle&&this.findTabBar(this._currentTitle)}addWidget(e,t){if("single-document"!==this.mode||e.parent!==this)(null==t?void 0:t.addClickListener)&&this.addWidgetActiveListener(e),super.addWidget(e,t),this.markActiveTabBar(e.title)}setCurrent(e){if(this.toDisposeOnMarkAsCurrent.dispose(),null==e||e.owner.node.focus(),this._currentTitle!==e&&this.onDidChangeCurrentEmitter.fire(e),this._currentTitle=e,this.markActiveTabBar(e),e){var t=()=>this.setCurrent(void 0);e.owner.disposed.connect(t),this.toDisposeOnMarkAsCurrent.push(eX.JT.create(()=>e.owner.disposed.disconnect(t)))}}addWidgetActiveListener(e){var t=()=>{this._currentTitle!==e.title&&(e.activate(),this.setCurrent(e.title))};e.node.tabIndex=-1,this.toDisposeWidgetRemove[e.id]=eX.JT.create(()=>{e.node.removeEventListener("focus",t,!0)}),e.node.addEventListener("focus",t,!0)}initWidgets(){for(var e of this.widgets())this.addWidgetActiveListener(e)}findTabBar(e){return ry(this.tabBars(),t=>eu.firstIndexOf(t.titles,e)>-1)}handleEvent(e){var t,n,r,o,a=null===(t=e.source)||void 0===t?void 0:t.id;if((!!(null===(r=e.target)||void 0===r?void 0:null===(n=r.closest)||void 0===n?void 0:n.call(r,"#".concat(a)))||"lm-dragenter"!==e.type)&&(null===(o=this._options)||void 0===o?!void 0:!o.disabledSplitScreen))super.handleEvent(e)}activateWidget(e){super.activateWidget(e),this.markActiveTabBar(e.title)}onChildRemoved(e){super.onChildRemoved(e);var t,n=this.toDisposeWidgetRemove[null==e?void 0:null===(t=e.child)||void 0===t?void 0:t.id];n&&n.dispose()}constructor(e){super(e),this.onDidChangeCurrentEmitter=new eX.Q5,this.toDisposeOnMarkAsCurrent=new eX.K4,this.toDisposeWidgetRemove={},this._options=e,this._onCurrentChanged=(e,t)=>{this.setCurrent(t.currentTitle||void 0),super._onCurrentChanged(e,t)},this._onTabActivateRequested=(e,t)=>{this.setCurrent(t.title),super._onTabActivateRequested(e,t)}}}(iV||(iV={})).Factory=Symbol("FlowDockPanel#Factory");var iK=Symbol("ApplicationShellOptions");class iq extends rI{init(e){var t=this;return(0,e3._)(function*(){var n,r,o,a,{createLayout:s,splitScreenConfig:l,disableFullScreen:c}=e;t.disableFullScreen=c,t.mainPanel=t.createMainPanel((0,tm._)({splitOptions:null==l?void 0:null===(n=l.main)||void 0===n?void 0:n.splitOptions},null==l?void 0:null===(r=l.main)||void 0===r?void 0:r.dockPanelOptions)),t.bottomPanel=t.createBottomPanel((0,tm._)({splitOptions:null==l?void 0:null===(o=l.bottom)||void 0===o?void 0:o.splitOptions},null==l?void 0:null===(a=l.bottom)||void 0===a?void 0:a.dockPanelOptions)),t.bottomPanel.hide(),t.topPanel=t.createPanel(r6.TOP_BAR),t.rightToolbar=t.createPanel(r6.RIGHT_BAR),t.rightToolbar.hide(),t.statusBar=t.createPanel(r6.STATUS_BAR),t.activityBar=t.createPanel(r6.ACTIVITY_BAR),t.secondarySidebar=t.createPanel(r6.SECONDARY_SIDEBAR),t.leftPanelHandler=t.sidePanelHandlerFactory(),t.leftPanelHandler.create("left"),t.leftPanelHandler.expand(),t.primarySidebar=t.leftPanelHandler.contentPanel;var d=ir[r6.PRIMARY_SIDEBAR];t.primarySidebar.id=d.displayName,t.widgetManager.setWidget(d.toString(),t.primarySidebar),t.secondarySidebar.hide(),t.layout=(null==s?void 0:s(t))||t.createLayout(),t.activityBarWidget=yield t.widgetManager.getOrCreateWidgetFromURI(iO);try{t.statusBarWidget=yield t.widgetManager.getOrCreateWidgetFromURI(iI)}catch(e){}})()}addWidget(e,t){var n=this;return(0,e3._)(function*(){if(!e.id){console.error("Widgets added to the application shell must have a unique id property.");return}var{area:r,mode:o}=t||{};switch(r){case r6.MAIN_PANEL:n.mainPanel.mode=o||"multiple-document",n.mainPanel.addWidget(e,(0,tm._)({addClickListener:!0},null==t?void 0:t.addOptions));break;case r6.TOP_BAR:n.topPanel.addWidget(e);break;case r6.BOTTOM_PANEL:n.bottomPanel.addWidget(e);break;case r6.STATUS_BAR:n.statusBar.addWidget(e);break;case r6.ACTIVITY_BAR:n.activityBar.addWidget(e);break;case r6.PRIMARY_SIDEBAR:n.primarySidebar.addWidget(e);break;case r6.SECONDARY_SIDEBAR:n.secondarySidebar.addWidget(e);break;default:throw Error("Unexpected area: ".concat(null==t?void 0:t.area))}r!==r6.STATUS_BAR&&r!==r6.TOP_BAR&&n.track(e)})()}getWidgetArea(e){var{parent:t}=e;switch(t){case this.mainPanel:return r6.MAIN_PANEL;case this.topPanel:return r6.TOP_BAR;case this.bottomPanel:return r6.BOTTOM_PANEL;case this.statusBar:return r6.STATUS_BAR;case this.activityBar:return r6.ACTIVITY_BAR;case this.primarySidebar:return r6.PRIMARY_SIDEBAR;case this.secondarySidebar:return r6.SECONDARY_SIDEBAR}throw Error("Unknown widget area: ".concat(e.id))}getPanelFromArea(e){switch(e){case r6.TOP_BAR:return this.topPanel;case r6.ACTIVITY_BAR:return this.activityBar;case r6.BOTTOM_PANEL:return this.bottomPanel;case r6.PRIMARY_SIDEBAR:return this.primarySidebar;case r6.SECONDARY_SIDEBAR:return this.secondarySidebar;case r6.STATUS_BAR:return this.statusBar;case r6.RIGHT_BAR:return this.rightToolbar;default:return this.mainPanel}}setCurrentWidget(e){this._currentWidget=e,this._currentWidgetParent=null==e?void 0:e.parent}getCurrentWidget(e){var t;switch(e){case r6.MAIN_PANEL:t=this.mainPanel.currentTitle;break;case r6.BOTTOM_PANEL:t=this.bottomPanel.currentTitle;break;default:throw Error("Illegal argument: ".concat(e))}return t?t.owner:void 0}get currentWidget(){return this._currentWidget}createLayout(){var e=iC([this.mainPanel,this.bottomPanel],[1,0],{orientation:"vertical",spacing:0});this.bottomSplitLayout=e;var t=new rJ({layout:e}),n=iC([this.primarySidebar,t,this.secondarySidebar],[0,1,0],{orientation:"horizontal",spacing:0});this.leftRightSplitLayout=n;var r=new rJ({layout:n}),o=ik([this.activityBar,r,this.rightToolbar],[0,1,0],{direction:"left-to-right",spacing:0}),a=new rL({layout:o});return ik([this.topPanel,a,this.statusBar],[0,1,0],{direction:"top-to-bottom",spacing:0})}createPanel(e){var t=new rN,n=ir[e];return t.id=n.displayName,this.widgetManager.setWidget(n.toString(),t),t}createBottomPanel(e){var t=this.dockPanelRendererFactory();t.tabBarClasses.push("flow-app-bottom");var n=this.dockPanelFactory((0,tm._)({mode:"multiple-document",renderer:t,spacing:0},e)),r=ir[r6.BOTTOM_PANEL];return n.id=r.displayName,n.node.addEventListener("p-dragenter",e=>{e.preventDefault(),e.stopPropagation()}),this.widgetManager.setWidget(r.toString(),n),n}createMainPanel(e){var t=this.dockPanelRendererFactory(),n=this.dockPanelFactory((0,tm._)({mode:"multiple-document",renderer:t,spacing:0},e)),r=ir[r6.MAIN_PANEL];return n.id=r.displayName,this.widgetManager.setWidget(r.toString(),n),n}tabbarIntoView(e){var t,n=function(n){var r;null==n||null===(r=n.titles)||void 0===r||r.forEach(r=>{var o,a;if((null==r?void 0:null===(o=r.owner)||void 0===o?void 0:o.id)&&r.owner.id===(null===(a=t.currentWidget)||void 0===a?void 0:a.id)){var s,l,c="#shell-tab-".concat(null===(l=t.currentWidget)||void 0===l?void 0:null===(s=l.uri)||void 0===s?void 0:s.displayName),d=n.node.querySelector(c);setTimeout(()=>{null==d||d.scrollIntoView({behavior:e?"smooth":"auto"})},0)}})},{mainPanel:r}=this;for(var o of r.tabBars())t=this,n(o)}track(e){e instanceof r2&&(e.onActivate(()=>{this._currentWidget=e,e.parent&&(this._currentWidgetParent=e.parent),this.onCurrentWidgetChangeEmitter.fire(e),this.tabbarIntoView()}),e.onDispose(()=>{var t=e.getResourceURI();if(t){var n=this.closeWidgetUriStack.findIndex(e=>iS(e,t));-1!==n&&this.closeWidgetUriStack.splice(n,1),this.closeWidgetUriStack.push(t)}if(this._currentWidget===e){var r,o,a,s,l,c,d,u,h=null===(u=this._currentWidgetParent)||void 0===u?void 0:null===(d=u.selectedWidgets)||void 0===d?void 0:null===(c=d.call(u))||void 0===c?void 0:null===(l=c.next)||void 0===l?void 0:null===(s=l.call(c))||void 0===s?void 0:s.value;this._currentWidget=h,this.onCurrentWidgetChangeEmitter.fire(h),this.tabbarIntoView()}!(null===(a=this.bottomPanel.selectedWidgets())||void 0===a?void 0:null===(o=a.next)||void 0===o?void 0:null===(r=o.call(a))||void 0===r?void 0:r.value)&&this.bottomPanel.hide()}))}getLayoutData(){var e=[];return this.primarySidebar.widgets.forEach(t=>{e.push(t)}),{version:.2,mainPanel:(0,tv._)((0,tm._)({},this.mainPanel.saveLayout()),{mode:this.mainPanel.mode}),bottomPanel:(0,tv._)((0,tm._)({},this.bottomPanel.saveLayout()),{expanded:this.bottomPanel.isHidden}),primarySidebar:{widgets:e},split:{main:this.bottomSplitLayout.relativeSizes(),leftRight:this.leftRightSplitLayout.relativeSizes()}}}setLayoutData(e){var{version:t}=e;if(!(t&&Number(t)>.2)){var{mainPanel:n,bottomPanel:r,split:o}=e;if(n&&(this.mainPanel.restoreLayout(n),n.mode===ip&&(this.mainPanel.mode=ip),this.mainPanel.initWidgets()),r){var{expanded:a}=r,s=(0,ij._)(r,["expanded"]);this.bottomPanel.restoreLayout(s),!a&&this.bottomPanel.show()}(null==o?void 0:o.main)&&(this.bottomSplitLayout.setRelativeSizes(o.main),window.temp=this.bottomSplitLayout),(null==o?void 0:o.leftRight)&&this.leftRightSplitLayout.setRelativeSizes(o.leftRight)}}constructor(e,t,n={}){super(n),this.dockPanelRendererFactory=e,this.sidePanelHandlerFactory=t,this.closeWidgetUriStack=[],this.onCurrentWidgetChangeEmitter=new eX.Q5,this.onCurrentWidgetChange=this.onCurrentWidgetChangeEmitter.event}}(0,e2.gn)([(0,e8.f)(iV.Factory),(0,e2.w6)("design:type",void 0===iV||void 0===iV.Factory?Object:iV.Factory)],iq.prototype,"dockPanelFactory",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],iq.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(no),(0,e2.w6)("design:type",void 0===no?Object:no)],iq.prototype,"navigationHistory",void 0),iq=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,(0,e8.f)(iH)),(0,e2.fM)(1,(0,e8.f)(iW)),(0,e2.fM)(2,(0,e8.f)(iK)),(0,e2.fM)(2,(0,tY.j)()),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[Function,Function,"undefined"==typeof RecursivePartial?Object:RecursivePartial])],iq);class iZ{show(){this.debugBarWidget.show(),this.debugBarWidget.update()}hide(){this.debugBarWidget.hide(),this.debugBarWidget.update()}createPortal(){var e=this.debugBarWidget.render.bind(this.debugBarWidget),t=ix(this.debugBarWidget,e,this.viewOptions.widgetFallbackRender);return this.shell.node.insertBefore(this.debugBarWidget.node,null),this.hide(),t}}(0,e2.gn)([(0,e8.f)(r7),(0,e2.w6)("design:type",void 0===r7?Object:r7)],iZ.prototype,"viewOptions",void 0),(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],iZ.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(iv),(0,e2.w6)("design:type",void 0===iv?Object:iv)],iZ.prototype,"debugBarWidget",void 0),iZ=(0,e2.gn)([(0,e4.b)()],iZ);class iY{addReactPortal(e){if(this.widgets.has(e))return e;var t=e.render.bind(e);this.widgets.add(e);var n=ix(e,t,this.viewOptions.widgetFallbackRender);return e.onDispose(()=>{var t=this.reactPortals.indexOf(n);this.widgets.delete(e),this.reactPortals.splice(t,1),this.fireViewChange()}),this.reactPortals.push(n),this.fireViewChange(),e}toReactComponent(e){if(this.reactComp)return this.reactComp;!this.globalReactPortals.length&&(null===(n=this.viewOptions)||void 0===n?void 0:null===(t=n.defaultLayoutData)||void 0===t?void 0:t.debugBar)&&this.globalReactPortals.push(this.debugService.createPortal());var t,n,r=t=>{var{className:n=""}=t,r=this.reactPortals,o=(0,eX.JA)(),a=(0,tq.useRef)(null);return(0,tq.useEffect)(()=>{var t=this.onViewChange(o);return rI.attach(e,a.current||document.body),this.eventService.listenGlobalEvent("resize",()=>{e.update()}),()=>{t.dispose()}},[]),(0,tK.jsxs)("div",{className:"".concat("flowide-container"," ").concat(n),ref:a,children:[this.globalReactPortals.map(e=>{var t=e.comp;return(0,tK.jsx)(t,{},e.key)}),r.map(e=>{var t=e.comp;return(0,tK.jsx)(t,{},e.key)})]})};return this.reactComp=r,r}constructor(){this.onViewChangeEmitter=new eX.Q5,this.onViewChange=this.onViewChangeEmitter.event,this.widgets=new Set,this.reactPortals=[],this.globalReactPortals=[],this.fireViewChange=(0,tF.debounce)(()=>{this.onViewChangeEmitter.fire()},0)}}(0,e2.gn)([(0,e8.f)(r7),(0,e2.w6)("design:type",void 0===r7?Object:r7)],iY.prototype,"viewOptions",void 0),(0,e2.gn)([(0,e8.f)(nY),(0,e2.w6)("design:type",void 0===nY?Object:nY)],iY.prototype,"eventService",void 0),(0,e2.gn)([(0,e8.f)(iZ),(0,e2.w6)("design:type",void 0===iZ?Object:iZ)],iY.prototype,"debugService",void 0),iY=(0,e2.gn)([(0,e4.b)()],iY);var iX=Symbol("CustomPreferenceContribution");(eU||(eU={})).is=function(e){return(0,eX.Kn)(e)&&(0,tF.isFunction)(e.storeState)&&(0,tF.isFunction)(e.restoreState)};class iQ{init(e){this.windowService.onStart(),this.viewOptions=e;var{getStorageKey:t}=e||{};for(var n of(t&&(this.storageKey=t()),this.disabled=this.storageService.getData("layout/disabled/v2",!!e.restoreDisabled),!this.disabled&&(this.unloadEvent=this.windowService.onUnload(()=>{eX.kg.log("LayoutRestorer: unload"),this.storeLayout()})),(e.customPreferenceConfigs||[]).forEach(e=>{this.customPreferenceConfig.push(e)}),this.contributions))n.registerCustomPreferences(this);this.customPreferenceConfig.forEach(e=>{this.customPreferenceValue[e.key]=this.storageService.getData(e.key,e.default)}),this.initd.fire()}setCustomPreferenceValue(e,t){this.customPreferenceValue[e]=t,this.storageService.setData(e,t),this.onCustomPreferenceChangeEmitter.fire({key:e,value:t})}getCustomPreferenceValue(e){return this.customPreferenceValue[e]}registerCustomPreferenceConfig(e){this.customPreferenceConfig.push(e)}ban(e){if(e!==this.disabled){if(e){var t;null===(t=this.unloadEvent)||void 0===t||t.dispose()}else this.unloadEvent=this.windowService.onUnload(()=>{eX.kg.log("LayoutRestorer: unload"),this.storeLayout()});this.disabled=e,this.storageService.setData("layout/disabled/v2",e)}}isWidgetProperty(e){return"widget"===e}isWidgetsProperty(e){return"widgets"===e}deflate(e){if(void 0!==e)return JSON.stringify(e,(e,t)=>{if(this.isWidgetProperty(e))return this.convertToDescription(t);if(this.isWidgetsProperty(e)){var n=[];for(var r of t){var o=this.convertToDescription(r);o&&n.push(o)}return n}if("currentUri"===e&&t)return t.toString();return t})}inflate(e){var t=this;return(0,e3._)(function*(){if(void 0===e)return{};var n=new eV.ParseContext,r=t.parse(e,n);return yield n.inflate(),r})()}parse(e,t){return JSON.parse(e,(e,n)=>{if(this.isWidgetsProperty(e)){for(var r,o=function(e){var n=r;t.push((0,e3._)(function*(){a[e]=yield n.convertToWidget(s[e])}))},a=t.filteredArray(),s=n,l=0;l{for(var t=0;t<(null==e?void 0:e.length);t++)void 0===e[t]&&e.splice(t--,1)})})()}constructor(){this.toInflate=[],this.toFilter=[]}};var iG=Symbol("ViewContribution");class iJ{init(e){var t=this;return(0,e3._)(function*(){t.mergeOptions(e);var n,r,o,a,s,{widgetFactories:l}=e;t.widgetManager.init(l),t.layoutRestorer.init(e),yield t.shell.init({createLayout:e.customLayout,splitScreenConfig:null===(n=e.presetConfig)||void 0===n?void 0:n.splitScreenConfig,disableFullScreen:null===(r=e.presetConfig)||void 0===r?void 0:r.disableFullScreen}),(null===(a=t.options)||void 0===a?void 0:null===(o=a.defaultLayoutData)||void 0===o?void 0:o.debugBar)&&t.debugWidget.initContent(null===(s=e.defaultLayoutData)||void 0===s?void 0:s.debugBar)})()}attach(e){var t=this;return(0,e3._)(function*(){yield t.layoutRestorer.restoreLayout(),null===(r=e.defaultLayoutData)||void 0===r||null===(n=r.defaultWidgets)||void 0===n||n.forEach(e=>{t.openerService.open(e)});var n,r,o,a,s,l=t.shell.activityBarWidget;t.viewRenderer.addReactPortal(l),null==l||null===(a=l.initView)||void 0===a||a.call(l,(null===(o=e.defaultLayoutData)||void 0===o?void 0:o.activityBarItems)||[]),t.shell.addWidget(l,{area:r6.ACTIVITY_BAR});var c=t.shell.statusBarWidget;c&&(t.viewRenderer.addReactPortal(c),c.initView((null===(s=e.defaultLayoutData)||void 0===s?void 0:s.statusBarItems)||[]),t.shell.addWidget(c,{area:r6.STATUS_BAR}))})()}mergeOptions(e){this.viewContributions.getContributions().forEach(t=>{t.registerView({register:t=>{(0,tF.mergeWith)(e,t,(e,t,n)=>{if(["widgetFactories","activityBarItems","statusBarItems","defaultWidgets"].includes(n))return[...e||[],...t]})}})})}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(iG),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],iJ.prototype,"viewContributions",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],iJ.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(r7),(0,e2.w6)("design:type",void 0===r7?Object:r7)],iJ.prototype,"options",void 0),(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],iJ.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],iJ.prototype,"viewRenderer",void 0),(0,e2.gn)([(0,e8.f)(iQ),(0,e2.w6)("design:type",void 0===iQ?Object:iQ)],iJ.prototype,"layoutRestorer",void 0),(0,e2.gn)([(0,e8.f)(ts),(0,e2.w6)("design:type",void 0===ts?Object:ts)],iJ.prototype,"openerService",void 0),(0,e2.gn)([(0,e8.f)(iv),(0,e2.w6)("design:type",void 0===iv?Object:iv)],iJ.prototype,"debugWidget",void 0),iJ=(0,e2.gn)([(0,e4.b)()],iJ);class i${canHandle(){return 1}hidePanelArea(e){var t=this;return(0,e3._)(function*(){var n,r,o=yield t.widgetManager.getWidget(ir[e].toString());null==o||null===(r=o.widgets)||void 0===r||null===(n=r.forEach)||void 0===n||n.call(r,e=>e.hide())})()}bindWidget(e){var t=this;return(0,e3._)(function*(){var n=t.widgetManager.getFactoryFromURI(e),r=yield t.widgetManager.getOrCreateWidgetFromURI(e,n),o=n.area||r6.MAIN_PANEL;return t.viewRenderer.addReactPortal(r),{widget:r,area:o}})()}open(e,t){var n=this;return(0,e3._)(function*(){var r,o,a,s,l,c,d,{widget:u,area:h}=yield n.bindWidget(e);if([r6.MAIN_PANEL,r6.BOTTOM_PANEL].includes(h)){!u.isAttached&&(n.shell.addWidget(u,(0,tv._)((0,tm._)({},t),{area:h})),n.layoutRestorer.restoreWidget(u),u.onDispose(()=>n.layoutRestorer.storeWidget(u))),null===(r=u.parent)||void 0===r||r.show(),h===r6.BOTTOM_PANEL&&n.shell.bottomSplitLayout.absoluteSizes()[1]<26&&n.shell.bottomSplitLayout.setRelativeSizes([.7,.3]),u.uri=e,null===(o=u.parent)||void 0===o||o.activateWidget(u),null===(a=u.onOpenRequest)||void 0===a||a.call(u,e,t);return}if(u.isAttached){if((null===(l=u.parent)||void 0===l?void 0:l.isHidden)&&u.parent.show(),!u.isHidden&&(h===r6.PRIMARY_SIDEBAR||h===r6.SECONDARY_SIDEBAR)){null===(d=u.parent)||void 0===d||d.hide(),yield n.hidePanelArea(h);return}yield n.hidePanelArea(h),u.uri=e,null===(c=u.onOpenRequest)||void 0===c||c.call(u,e,t),u.show()}else yield n.hidePanelArea(h),n.shell.addWidget(u,{area:h}),null===(s=u.parent)||void 0===s||s.show()})()}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],i$.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],i$.prototype,"viewRenderer",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],i$.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(iQ),(0,e2.w6)("design:type",void 0===iQ?Object:iQ)],i$.prototype,"layoutRestorer",void 0),i$=(0,e2.gn)([(0,e4.b)()],i$);var i0=Symbol("TabBarToolbarFactory");class i1 extends r2{initAlign(e){e&&(this.align=e)}updateURI(e){this.currentURI=e,this.update()}render(){var e=this.currentURI,t=(0,tq.useMemo)(()=>{if(!!e){var t=this.widgetManager.getFactoryFromURI(e),n=this.widgetManager.getWidgetFromURI(e,t);return((null==t?void 0:t.toolbarItems)||[]).filter(e=>this.align?e.align===this.align:!e.align||e.align===r4.TRAILING).map((e,t)=>{if(e.render)r=e.render(n);else if(e.commandId){var r,o,a,s=this.commandRegistry.getCommand(e.commandId);o=this.shortcutsService.getLabelWithShortcutUI(e.commandId),(null==s?void 0:s.icon)&&(r=(0,tK.jsx)("div",{className:iu,children:(0,eX.mf)(s.icon)?s.icon(n):null==s?void 0:s.icon}),a=()=>this.commandRegistry.executeCommand(e.commandId,n))}return r?(0,tK.jsx)("div",{className:id,onMouseEnter:e=>{o&&this.hoverService.requestHover({content:o,target:e.currentTarget,position:"bottom"})},onClick:a,children:r},e.commandId||t):null})}},[e]);return(0,tK.jsx)("div",{className:ic,children:t})}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],i1.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(t3),(0,e2.w6)("design:type",void 0===t3?Object:t3)],i1.prototype,"shortcutsService",void 0),(0,e2.gn)([(0,e8.f)(iD),(0,e2.w6)("design:type",void 0===iD?Object:iD)],i1.prototype,"hoverService",void 0),(0,e2.gn)([(0,e8.f)(eX.Ho),(0,e2.w6)("design:type",void 0===eX.Ho?Object:eX.Ho)],i1.prototype,"commandRegistry",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],i1.prototype,"widgetManager",void 0),i1=(0,e2.gn)([(0,e4.b)()],i1);var i2=Symbol("MenuFactory");class i4 extends rI{dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){for(var e=this;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){for(var e=this;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("flow-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){if((e<0||e>=this._items.length)&&(e=-1),-1!==e&&!eK.canActivate(this._items[e])&&(e=-1),this._activeIndex!==e)this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update()}get items(){return this._items}activateNextItem(){var e=this._items.length,t=this._activeIndex,n=t2&&void 0!==arguments[2]?arguments[2]:{};if(!this.isAttached){var r=n.forceX||!1,o=n.forceY||!1;eK.openRootMenu(this,e,t,r,o),this.activate()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mouseup":this._evtMouseUp(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseenter":this._evtMouseEnter(e);break;case"mouseleave":this._evtMouseLeave(e);break;case"mousedown":this._evtMouseDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)}onActivateRequest(e){this.isAttached&&this.node.focus()}onUpdateRequest(e){for(var t,n=function(e,n){var c,d=r[e],u=s[e],h="string"==typeof d.tooltip?d.tooltip:null===(c=d.tooltip)||void 0===c?void 0:c.call(d,{disabled:!d.isEnabled});l[e]=o.renderItem({item:d,active:e===a,collapsed:u,onfocus:()=>{t.activeIndex=e},onmouseenter:e=>{t.hoverService.requestHover({content:h,target:e.currentTarget,position:"right",offset:4})}},t.commands,t.shortcutsService)},r=this._items,{renderer:o}=this,a=this._activeIndex,s=eK.computeCollapsed(r),l=Array(r.length),c=0,d=r.length;cev.hitTest(t,e.clientX,e.clientY));if(t===this._activeIndex)return;if(this.activeIndex=t,(t=this.activeIndex)===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();var n=this.activeItem;if(!!n&&"submenu"===n.type&&!!n.submenu)this._startOpenTimer()}_evtMouseEnter(e){for(var t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}var{clientX:t,clientY:n}=e;if(ev.hitTest(this._childMenu.node,t,n)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){if(!this._parentMenu)eK.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close()}_openChildMenu(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.activeItem;if(!t||"submenu"!==t.type||!t.submenu){this._closeChildMenu();return}var{submenu:n}=t;if(n!==this._childMenu){i4.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,ef.sendMessage(this,rI.Msg.UpdateRequest);var r=this.contentNode.children[this._activeIndex];eK.openSubmenu(n,r),e&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},eK.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},eK.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){eK.saveWindowData()}constructor(){super({node:eK.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new rE(this),this._menuRequested=new rE(this),this.addClass("flow-Menu"),this.setFlag(rI.Flag.DisallowLayout),this.renderer=i4.defaultRenderer}}(0,e2.gn)([(0,e8.f)(t3),(0,e2.w6)("design:type",void 0===t3?Object:t3)],i4.prototype,"shortcutsService",void 0),(0,e2.gn)([(0,e8.f)(eX.Ho),(0,e2.w6)("design:type",void 0===eX.Ho?Object:eX.Ho)],i4.prototype,"commands",void 0),(0,e2.gn)([(0,e8.f)(iD),(0,e2.w6)("design:type",void 0===iD?Object:iD)],i4.prototype,"hoverService",void 0),!function(e){class t{renderItem(e,t,n){var r,o=this.createItemClass(e),a=this.createItemARIA(e),s=e.item.submenu,l=[this.renderLabel(e,t),this.renderShortcut(e,n)];s&&l.push(this.renderSubmenu(e));var c=null==e?void 0:null===(r=e.item)||void 0===r?void 0:r.tooltip;return rW.div((0,tm._)({className:o,tabindex:"0",onfocus:e.onfocus},a,c?{onmouseenter:e.onmouseenter}:{}),...l)}renderLabel(e,t){var n=this.formatLabel(e,t);return rW.div({className:"flow-Menu-itemLabel"},n)}renderShortcut(e,t){var n="",{command:r,customShortcut:o}=e.item,a=t.getShortcutByCommandId(r);return a&&(n=a.map(e=>e.join(" ")).join(" / ")),o&&(n=o),rW.div({className:"flow-Menu-itemShortcut"},n)}renderSubmenu(e){var t=e.item.submenu;return rW.div({className:t?"flow-Menu-itemSubmenuIcon":""})}createItemClass(e){var t="flow-Menu-item";!e.item.isEnabled&&(t+=" flow-mod-disabled"),e.item.isToggled&&(t+=" flow-mod-toggled"),!e.item.isVisible&&(t+=" flow-mod-hidden"),e.active&&(t+=" flow-mod-active"),e.collapsed&&(t+=" flow-mod-collapsed");var n=e.item.className;return n&&(t+=" ".concat(n)),t}createItemARIA(e){var t={};switch(e.item.type){case"separator":t.role="presentation";break;case"submenu":t["aria-haspopup"]="true",!e.item.isEnabled&&(t["aria-disabled"]="true");break;default:!e.item.isEnabled&&(t["aria-disabled"]="true"),t.role="menuitem"}return t}formatLabel(e,t){var n,{command:r}=e.item,o=null===(n=t.getCommand(r))||void 0===n?void 0:n.label;return[rW.span({className:"flow-Menu-itemMnemonic"},o||"")]}}e.Renderer=t,e.defaultRenderer=new t}((i4=(0,e2.gn)([(0,e4.b)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[])],i4))||(i4={})),!function(e){e.TIMER_DELAY=300,e.SUBMENU_OVERLAP=3;var t=null,n=0;function r(){return n>0?(n--,t):a()}e.saveWindowData=function(){t=a(),n++};function o(e){return"separator"!==e.type&&e.isEnabled&&e.isVisible}e.createNode=function(){var e=document.createElement("div"),t=document.createElement("ul");return t.className="flow-Menu-content",e.appendChild(t),t.setAttribute("role","menu"),e.tabIndex=0,e},e.canActivate=o;e.createItem=function(e,t){return new s(e.commands,t)};e.hitTestMenus=function(e,t,n){for(var r=e;r;r=r.childMenu)if(ev.hitTest(r.node,t,n))return!0;return!1};function a(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}e.computeCollapsed=function(e){var t=Array(e.length);eu.fill(t,!1);for(var n=0,r=e.length;n=0;--a){var s=e[a];if(!!s.isVisible){if("separator"!==s.type)break;t[a]=!0}}for(var l=!1;++nl+d&&(t=l+d-m),!a&&n+v>c+u&&(n>c+u?n=c+u-v:n-=v),f.transform="translate(".concat(Math.max(0,t),"px, ").concat(Math.max(0,n),"px"),f.opacity="1"};e.openSubmenu=function(t,n){var o=r(),a=o.pageXOffset,s=o.pageYOffset,l=o.clientWidth,c=o.clientHeight;ef.sendMessage(t,rI.Msg.UpdateRequest);var{node:d}=t,{style:u}=d;u.opacity="0",u.maxHeight="".concat(c,"px"),rI.attach(t,document.body);var{width:h,height:p}=d.getBoundingClientRect(),f=ev.boxSizing(t.node),m=n.getBoundingClientRect(),v=m.right-e.SUBMENU_OVERLAP;v+h>a+l&&(v=m.left+e.SUBMENU_OVERLAP-h);var g=m.top-f.borderTop-f.paddingTop;g+p>s+c&&(g=m.bottom+f.borderBottom+f.paddingBottom-p),u.transform="translate(".concat(Math.max(0,v),"px, ").concat(Math.max(0,g),"px"),u.opacity="1"};e.findMnemonic=function(e,t,n){for(var r=-1,a=-1,s=!1,l=t.toUpperCase(),c=0,d=e.length;c=0&&ft.command===e);eu.removeFirstOf(this._items,t)}else this._items.forEach(t=>{e(t.command)&&eu.removeFirstOf(this._items,t)})}addItem(e){var t=eq.createItem(e,this._idTick++);return this._items.push(t),eX.JT.create(()=>{eu.removeFirstOf(this._items,t)})}close(){this.menu.close()}open(e,t){if(i4.saveWindowData(),this.menu.clearItems(),0===this._items.length)return!1;var n=eq.matchItems(this._items,e,this._groupByTarget,this._sortBySelector);if(!n||0===n.length)return!1;for(var r of n){if(t&&(r.args=t),!r.filter||!!r.filter(t))this.menu.addItem(r)}return this.menu.open(e.clientX,e.clientY),!0}constructor(){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0}}(0,e2.gn)([(0,e8.f)(i2),(0,e2.w6)("design:type",void 0===i2?Object:i2)],i6.prototype,"menuFactory",void 0),(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],i6.prototype,"init",null),i6=(0,e2.gn)([(0,e4.b)()],i6),!function(e){e.createItem=function(e,t){var n=function(e){if(-1!==e.indexOf(","))throw Error("Selector cannot contain commas: ".concat(e));if(!ey.isValid(e))throw Error("Invalid selector: ".concat(e));return e}(e.selector),r=void 0!==e.rank?e.rank:1/0;return(0,tv._)((0,tm._)({},e),{selector:n,rank:r,id:t})};e.matchItems=function(e,r,o,a){var s=r.target;if(!s)return null;var l=r.currentTarget;if(!l)return null;for(var c=[],d=e.slice();null!==s;){for(var u=[],h=0,p=d.length;h{this.contextMenu.deleteItem(e)})}clearMenuItem(e){}addMenuItem(e){this.contextMenu.addItem(e)}createSubMenu(){return this.menuFactory()}addSubMenuItem(e,t){e.addItem(t)}open(e,t){return this.contextMenu.open(e,t)}close(){this.contextMenu.close()}}(0,e2.gn)([(0,e8.f)(i6),(0,e2.w6)("design:type",void 0===i6?Object:i6)],i3.prototype,"contextMenu",void 0),(0,e2.gn)([(0,e8.f)(i2),(0,e2.w6)("design:type",void 0===i2?Object:i2)],i3.prototype,"menuFactory",void 0),i3=(0,e2.gn)([(0,e4.b)()],i3);var i8=e0({containerModules:[new eQ.n(e=>{e(i5).toService(i3),(0,eX.KV)(e,i3,[eG]),e(i2).toFactory(e=>()=>{var t=e.container.createChild();return t.bind(i4).toSelf().inSingletonScope(),t.get(i4)}),e(i6).toSelf().inSingletonScope()})]}),i9=Symbol("TabBarRendererFactory");(0,rp.GW)((0,e4.b)(),rZ.Renderer);class i7 extends rZ.Renderer{dispose(){this.toDispose.dispose()}set tabBar(e){if(this._tabBar!==e)this._tabBar=e}get tabBar(){return this._tabBar}renderTab(e,t,n){var r=e.title,o=this.shortcutsService.getLabelWithShortcutUI(eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET),a=this.tabBar&&"horizontal"===this.tabBar.orientation&&"string"==typeof r.label?{onmouseenter:e=>this.handleMouseEnterEvent(e,r)}:{title:r.caption};return rW.li((0,tv._)((0,tm._)({},a),{key:this.createTabKey(e),className:this.createTabClass(e),id:this.createTabId(r,n),style:this.createTabStyle(e),dataset:this.createTabDataset(e),ondblclick:e=>this.handleDblClickEvent(e,r),onauxclick:e=>{e.preventDefault()},onclick:e=>this.handleClickEvent(e,r),oncontextmenu:e=>{this.menuService.open(e,r.owner),e.stopPropagation(),e.preventDefault()}}),rW.div({className:"flow-tab-icon-label"},this.renderIcon(e),this.renderLabel(e)),rW.div({className:r.saving?"lm-TabBar-tabCloseIcon saving action-label ".concat(iu):"lm-TabBar-tabCloseIcon action-label ".concat(iu),onmouseenter:e=>{e.stopPropagation(),o&&this.hoverService.requestHover({content:o,position:"bottom",target:e.target})},onclick:e=>this.handleCloseClickEvent(e,r),ondblclick:e=>e.stopPropagation()}))}createTabClass(e){var t,n=super.createTabClass(e);return!(null===(t=e.visible)||void 0===t||t)&&(n+=" p-mod-invisible"),n}handleClickEvent(e,t){this.menuService.close()}createTabId(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"shell-tab-".concat(null===(n=e.owner)||void 0===n?void 0:null===(t=n.uri)||void 0===t?void 0:t.displayName).concat(r?"-hidden":"")}createTabStyle(e){return function(e){var t,n,r="".concat(e.zIndex),{labelSize:o}=e,{iconSize:a}=e;if(o||a){var s=o?o.height:0,l=a?a.height:0,c=e.paddingTop||0;s>0&&l>0&&(c*=1.5);var d=e.paddingBottom||0;t="".concat(s+l+c+d,"px")}return{zIndex:r,height:t,minWidth:n=e.tabWidth?"".concat(e.tabWidth,"px"):"",maxWidth:n}}(e)}renderLabel(e){var t,n,r,{labelSize:o}=e,{iconSize:a}=e;if(o&&(t="".concat(o.width,"px"),n="".concat(o.height,"px")),e.paddingTop||a){var s=a?a.height:0,l=e.paddingTop||0;s>0&&(l*=1.5),r="".concat(l+s,"px")}var c={width:t,height:n,top:r};return"string"==typeof e.title.label?rW.div({className:"flow-TabBar-tabLabel-text",style:c},e.title.label):rF("div",{className:"flow-TabBar-tabLabel",style:c},{render:t=>{var n=this.labelNodeRoot.get(t);if(n)n.render(e.title.label);else{var r=(0,iR.createRoot)(t);r.render(e.title.label),this.labelNodeRoot.set(t,r)}},unrender:e=>{var t=this.labelNodeRoot.get(e);t&&(t.unmount(),this.labelNodeRoot.delete(e))}})}renderIcon(e){if(!e.title.iconLabel)return rW.div();e.paddingTop&&(t="".concat(e.paddingTop||0,"px"));var t,n={top:t},r=this.createIconClass(e);return"string"==typeof e.title.iconLabel?rW.i({className:ib(e.title.iconLabel)}):rF("div",{className:r,style:n},{render:t=>{var n=this.iconNodeRoot.get(t);if(n)n.render(e.title.iconLabel);else{var r=(0,iR.createRoot)(t);this.iconNodeRoot.set(t,r),r.render(e.title.iconLabel)}},unrender:e=>{var t=this.labelNodeRoot.get(e);t&&(t.unmount(),this.labelNodeRoot.delete(e))}})}constructor(){super(),this.toDispose=new eX.K4,this.iconNodeRoot=new WeakMap,this.labelNodeRoot=new WeakMap,this.handleMouseEnterEvent=(e,t)=>{if(this.tabBar&&this.hoverService&&e.currentTarget instanceof HTMLElement&&t){var n=t.label||t.caption;"horizontal"===this.tabBar.orientation?n&&this.hoverService.requestHover({content:n,target:e.currentTarget,position:"bottom"}):n&&this.hoverService.requestHover({content:n,target:e.currentTarget,position:"right"})}},this.handleCloseClickEvent=(e,t)=>{e.stopPropagation(),e.preventDefault(),this.tabBar&&e.currentTarget instanceof HTMLElement&&((null==t?void 0:t.saving)?this.commandService.executeCommand(eX.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,[t]):null==t||t.owner.close())},this.handleDblClickEvent=(e,t)=>{if(!this.shell.disableFullScreen){var n,r,o=(null==t?void 0:null===(r=t.owner)||void 0===r?void 0:null===(n=r.parent)||void 0===n?void 0:n.id)===ie;this.tabBar&&e.currentTarget instanceof HTMLElement&&o&&this.commandService.executeCommand(eX.mY.Default.VIEW_FULL_SCREEN)}}}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],i7.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(iD),(0,e2.w6)("design:type",void 0===iD?Object:iD)],i7.prototype,"hoverService",void 0),(0,e2.gn)([(0,e8.f)(t3),(0,e2.w6)("design:type",void 0===t3?Object:t3)],i7.prototype,"shortcutsService",void 0),(0,e2.gn)([(0,e8.f)(eX.VD),(0,e2.w6)("design:type",void 0===eX.VD?Object:eX.VD)],i7.prototype,"commandService",void 0),(0,e2.gn)([(0,e8.f)(i5),(0,e2.w6)("design:type",void 0===i5?Object:i5)],i7.prototype,"menuService",void 0),i7=(0,e2.gn)([(0,e4.b)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[])],i7);var oe=Symbol("TabBarRendererFactory");class ot extends rZ{getHandleEvent(e){return!!(!e||e.classList.contains(il))||!(e.classList.contains("flow-toolbar-item")||e.classList.contains("flow-toolbar-container")||e.classList.contains(iu))&&this.getHandleEvent(e.parentElement)}handleEvent(e){(this.getHandleEvent(e.target)||"pointerup"===e.type)&&super.handleEvent(e)}rewrireDOM(){var{contentNode:e}=this;if(!e)throw Error("'this.node' does not have the content as a direct child with class name 'p-TabBar-content'.");this.node.removeChild(e);var t=document.createElement("div");t.classList.add(ia),this.preActionContainer=document.createElement("div"),this.preActionContainer.classList.add("pre-flow-tabBar-action-container"),t.appendChild(this.preActionContainer),this.scrollContainer=document.createElement("div"),this.scrollContainer.classList.add(il),t.appendChild(this.scrollContainer),this.scrollContainer.appendChild(e),this.actionContainer=document.createElement("div"),this.actionContainer.classList.add(is),t.appendChild(this.actionContainer),this.node.appendChild(t)}onResize(e){var t;super.onResize(e),null===(t=this.scrollBar)||void 0===t||t.update()}onAfterAttach(e){!this.scrollBar&&(this.scrollBar=this.scrollBarFactory()),this.toolbar&&(this.toolbar.isAttached&&rI.detach(this.toolbar),rI.attach(this.toolbar,this.actionContainer),this.viewRenderer.addReactPortal(this.toolbar)),this.preActionContainer&&(this.preToolbar.isAttached&&rI.detach(this.preToolbar),rI.attach(this.preToolbar,this.preActionContainer),this.viewRenderer.addReactPortal(this.preToolbar)),super.onAfterAttach(e)}onBeforeDetach(e){this.toolbar&&this.toolbar.isAttached&&rI.detach(this.toolbar),this.preToolbar&&this.preToolbar.isAttached&&rI.detach(this.preToolbar),super.onBeforeDetach(e)}onUpdateRequest(e){var t;super.onUpdateRequest(e),null===(t=this.scrollBar)||void 0===t||t.update()}constructor(e,t,n=t()){super({renderer:n}),this.tabBarToolbarFactory=e,this.rewrireDOM(),this.preToolbar=this.tabBarToolbarFactory(r4.LEADING),this.toolbar=this.tabBarToolbarFactory(),this.preToolbar.tabBar=this,this.toolbar.tabBar=this,n.tabBar=this,this.currentChanged.connect(()=>{var e,t=(null===(e=this.currentTitle)||void 0===e?void 0:e.owner).getResourceURI();t&&(this.preToolbar.updateURI(t),this.toolbar.updateURI(t))}),this.scrollBarFactory=()=>new rd(this.scrollContainer,{useBothWheelAxes:!0,suppressScrollY:!0})}}(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],ot.prototype,"viewRenderer",void 0),ot=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,(0,e8.f)(i0)),(0,e2.fM)(1,(0,e8.f)(i9)),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[void 0===i0?Object:i0,void 0===i9?Object:i9,void 0])],ot);class on{createTabBar(){return this.tabBarFactory()}createHandle(){return rX.defaultRenderer.createHandle()}constructor(e){this.tabBarFactory=e,this.tabBarClasses=[]}}(0,e2.gn)([(0,e8.f)(iV.Factory),(0,e2.w6)("design:type",void 0===iV||void 0===iV.Factory?Object:iV.Factory)],on.prototype,"dockPanelFactory",void 0),(0,e2.gn)([(0,e8.f)(ot),(0,e2.w6)("design:type",void 0===ot?Object:ot)],on.prototype,"customTabBar",void 0),on=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,(0,e8.f)(oe)),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[void 0===oe?Object:oe])],on);class or{toggleBottomLayout(){this.shell.bottomSplitLayout.setRelativeSizes([.7,.3])}hideBottomLayout(){this.shell.bottomSplitLayout.setRelativeSizes([1,0])}getOpenTitles(){var e=[];for(var t of this.shell.mainPanel.layout.tabBars())e=e.concat(t.titles);return e}getAllTabsFromArea(e){var t=e===r6.MAIN_PANEL?this.shell.mainPanel.widgets():this.shell.bottomPanel.widgets(),n=[];for(var r of t)n.push(r);return n}closeOtherTabs(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];try{var t,n=function(t){[...t.titles].map(n=>{var r;n.label!==(null===(r=t.currentTitle)||void 0===r?void 0:r.label)&&(t.removeTab(n),e&&n.owner.dispose())})},r=null===(t=this.shell.currentWidget)||void 0===t?void 0:t.parent;if(!r)return;for(var o of r.tabBars())n(o)}catch(e){console.error(e)}}openNextTab(){for(var e of this.shell.mainPanel.layout.tabBars()){var t=e.titles.findIndex(e=>e.owner===this.shell.currentWidget);if(-1!==t){var n,r=null===(n=e.titles[(t+1)%e.titles.length].owner)||void 0===n?void 0:n.getResourceURI();r&&this.openHandler.open(r)}}}openLastTab(){for(var e of this.shell.mainPanel.layout.tabBars()){var t=e.titles.findIndex(e=>e.owner===this.shell.currentWidget);if(-1!==t){var n,r=null===(n=e.titles[(t-1+e.titles.length)%e.titles.length].owner)||void 0===n?void 0:n.getResourceURI();r&&this.openHandler.open(r)}}}enableFullScreenMode(){if(!this.isFullScreenMode)ii.forEach(e=>{if(e!==r6.MAIN_PANEL){var t=this.shell.getPanelFromArea(e);this.prevPanelMap.set(e,t.isHidden),t.hide()}}),this.isFullScreenMode=!0,this.onFullScreenModeChangeEmitter.fire(!0)}disableFullScreenMode(){if(!!this.isFullScreenMode)ii.forEach(e=>{if(e!==r6.MAIN_PANEL){var t=this.shell.getPanelFromArea(e),n=!!this.prevPanelMap.get(e);t.setHidden(n)}}),this.isFullScreenMode=!1,this.onFullScreenModeChangeEmitter.fire(!1)}switchFullScreenMode(){this.isFullScreenMode?this.disableFullScreenMode():this.enableFullScreenMode()}setActivityBarUri(e){this.shell.activityBarWidget.setCurrentUri(e)}get activityBarUri(){return this.shell.activityBarWidget.currentUri}constructor(){this.isFullScreenMode=!1,this.onFullScreenModeChangeEmitter=new eX.Q5,this.onFullScreenModeChange=this.onFullScreenModeChangeEmitter.event,this.prevPanelMap=new Map}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],or.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(i$),(0,e2.w6)("design:type",void 0===i$?Object:i$)],or.prototype,"openHandler",void 0),or=(0,e2.gn)([(0,e4.b)()],or);class oi{startDrag(e){var t,{uris:n,position:r,dragImage:o,callback:a,backdropTransform:s}=e,{clientX:l,clientY:c}=r,d=new rk,u=this;var h=(t=(0,e3._)(function*(){var e,t=[];return yield Promise.all(n.map((e=(0,e3._)(function*(e){var n=u.widgetManager.getFactoryFromURI(e),r=yield u.widgetManager.getOrCreateWidgetFromURI(e,n);u.viewRenderer.addReactPortal(r),t.push(r)}),function(t){return e.apply(this,arguments)}))),t}),function(){return t.apply(this,arguments)});d.setData("application/vnd.lumino.widget-factory",h),new rK({document,mimeData:d,dragImage:o,proposedAction:"move",supportedActions:"move",source:this.shell.mainPanel,backdropTransform:s}).start(l,c).then(a)}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],oi.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],oi.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],oi.prototype,"viewRenderer",void 0),oi=(0,e2.gn)([(0,e4.b)()],oi);var oo="expand",oa="close";class os extends r2{get defaultStretch(){return this._defaultStretch}set defaultStretch(e){this._defaultStretch=e}get orientation(){return this._orientation}set orientation(e){this._orientation=e}storeState(){var e;if(!!(null===(e=this.splitPanels)||void 0===e?void 0:e.length))return{sizes:this.getRelativeSizes(),panelClose:this.panels.map(e=>e.node.classList.contains(oa))}}restoreState(e){var t;if(!!(null===(t=this.splitPanels)||void 0===t?void 0:t.length))this.storeData=e,this.addClassNames()}onFitRequest(e){var t;if(super.onFitRequest(e),!!(null===(t=this.panels)||void 0===t?void 0:t.length)&&"horizontal"===this.orientation)this.panels.forEach(e=>{var t,n,r,o,a,s,l,c,d=null==e?void 0:e.node;d&&((null==d?void 0:null===(n=d.classList)||void 0===n?void 0:null===(t=n.contains)||void 0===t?void 0:t.call(n,"close"))?null===(a=d.previousSibling)||void 0===a||null===(o=a.classList)||void 0===o||null===(r=o.add)||void 0===r||r.call(o,"lm-mod-hidden"):null===(c=d.previousSibling)||void 0===c||null===(l=c.classList)||void 0===l||null===(s=l.remove)||void 0===s||s.call(l,"lm-mod-hidden"))})}init(e){var t;if(super.init(e),!!(null===(t=this.splitPanels)||void 0===t?void 0:t.length))!this.layout&&this.createContainer()}createPanel(e){var t=new rN;return t.id=e.displayName,t}addClassNames(){var e;if(!!(null===(e=this.storeData)||void 0===e?void 0:e.panelClose))this.panels.forEach((e,t)=>{var n,r;(null===(r=this.storeData)||void 0===r?void 0:null===(n=r.panelClose)||void 0===n?void 0:n[t])?this.closePanel(t):this.expandPanel(t)})}getWidget(e){var t=this.widgetManager.uriToWidgetID(e);return this.widgetManager.getWidget(t)}getWidgetExpand(e){if(!e)return!1;var t,n=this.widgetManager.uriToWidgetID(e),r=this.widgetManager.getWidget(n);return!!(null==r?void 0:null===(t=r.parent)||void 0===t?void 0:t.node.classList.contains("expand"))}createPanels(e){var t=this;return(0,e3._)(function*(){var n;return t.splitPanels.sort((e,t)=>(e.order||0)-(t.order||0)),Promise.all(t.splitPanels.map((n=(0,e3._)(function*(n,r){var o,{widgetUri:a,widget:s}=n,l=t.createPanel(a);if((null==e?void 0:e[r])===0?l.node.classList.add(oa):l.node.classList.add(oo),o=t.getWidget(a))return o;(o=yield t.widgetManager.createSubWidget(a,s)).wrapperWidget=t,t.viewRenderer.addReactPortal(o);s&&l.addWidget(o),t.panels.push(l)}),function(e,t){return n.apply(this,arguments)})))})()}toggleSubWidget(e){if(!!e&&!!this.layout){var t=this.contentPanel.relativeSizes(),n=this.panels.findIndex(t=>t.id===e.displayName);this.panels.forEach((e,r)=>{var o=e.node.classList.contains(oo);r===n&&o?(t[r]=0,e.node.classList.remove(oo),e.node.classList.add(oa),this.contentPanel.fit(),this.setRelativeSizes(t)):r===n&&!o&&(t[r]=1,e.node.classList.remove(oa),e.node.classList.add(oo),this.contentPanel.fit(),this.setRelativeSizes(t))})}}getRelativeSizes(){return this.contentPanel.relativeSizes()}closePanel(e){var t=this.panels[e];if(!(!t||t.node.classList.contains(oa)))t.node.classList.remove(oo),t.node.classList.add(oa)}expandPanel(e){var t=this.panels[e];if(!(!t||t.node.classList.contains(oo)))t.node.classList.remove(oa),t.node.classList.add(oo)}syncPanelRelativeSizes(e){this.contentPanel.setRelativeSizes(e),(null==e?void 0:e.length)&&(e.forEach((e,t)=>{0===e?this.closePanel(t):this.expandPanel(t)}),this.contentPanel.fit())}setRelativeSizes(e){this.contentPanel.setRelativeSizes(e)}getDefaultStretch(){if(this.defaultStretch)return this.defaultStretch;var e=this.panels.length;return Array(e).fill(1/e)}createContainer(){var e=this;return(0,e3._)(function*(){var t,n=e.getDefaultStretch();yield e.createPanels(n);var r=iC(e.panels,n,{orientation:e.orientation,spacing:0}),o=new rJ({layout:r});o.addClass(io),e.contentPanel=o,e.setRelativeSizes((null===(t=e.storeData)||void 0===t?void 0:t.sizes)||n),e.layout=ik([e.contentPanel],[1],{direction:e.direction,spacing:0})})()}render(){return null}constructor(...e){super(...e),this.panels=[],this.splitPanels=[],this.direction="left-to-right"}}(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],os.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],os.prototype,"viewRenderer",void 0),(0,e2.gn)([(0,e8.f)(iQ),(0,e2.w6)("design:type",void 0===iQ?Object:iQ)],os.prototype,"layoutRestorer",void 0),os=(0,e2.gn)([(0,e4.b)()],os);var ol=e=>{e(r5).toDynamicValue(e=>{var{container:t}=e;return{area:r6.ACTIVITY_BAR,canHandle:e=>e.isEqualOrParent(iO),createWidget:()=>{var e=t.createChild();return e.bind(iB).toSelf().inSingletonScope(),e.get(iB)}}}),e(r5).toDynamicValue(e=>{var{container:t}=e;return{area:r6.STATUS_BAR,canHandle:e=>e.isEqualOrParent(iI),createWidget:()=>{var e=t.createChild();return e.bind(iP).toSelf().inSingletonScope(),e.get(iP)}}})},oc=e=>"\n #".concat(ir[r6.TOP_BAR].displayName," {\n min-height: 40px;\n background: ").concat(e("flowide.color.base.bg.2"),";\n color: ").concat(e("flowide.color.base.text.0"),";\n border-bottom: 1px solid ").concat(e("flowide.color.base.border"),";\n }\n #").concat(ir[r6.ACTIVITY_BAR].displayName," {\n min-width: 36px;\n color: ").concat(e("flowide.color.base.text.0"),";\n background: ").concat(e("flowide.color.base.bg.2"),";\n border-right: 1px solid ").concat(e("flowide.color.base.border"),";\n }\n #").concat(ir[r6.PRIMARY_SIDEBAR].displayName," {\n min-width: 110px !important;\n color: ").concat(e("flowide.color.base.text.0"),";\n background: ").concat(e("flowide.color.base.bg.1"),";\n border-right: 1px solid ").concat(e("flowide.color.base.border"),";\n }\n #").concat(ir[r6.MAIN_PANEL].displayName," {\n color: ").concat(e("flowide.color.base.text.0"),";\n background: ").concat(e("flowide.color.base.bg.0"),";\n }\n #").concat(ir[r6.SECONDARY_SIDEBAR].displayName," {\n min-width: 110px;\n }\n #").concat(ir[r6.STATUS_BAR].displayName," {\n min-height: 22px;\n background: ").concat(e("flowide.color.base.bg.2"),";\n border-top: 1px solid ").concat(e("flowide.color.base.border"),";\n }\n #").concat(ir[r6.BOTTOM_PANEL].displayName," {\n background: ").concat(e("flowide.color.base.bg.0"),";\n color: ").concat(e("flowide.color.base.text.0"),";\n border-top: 1px solid ").concat(e("flowide.color.base.border"),";\n }\n\n .").concat(io," .lm-SplitPanel-child.expand {\n min-height: 75px;\n }\n\n .").concat(io," .lm-SplitPanel-child.close {\n min-height: 22px;\n max-height: 22px;\n }\n\n .").concat(io,'[data-orientation="vertical"] .lm-SplitPanel-handle {\n background: ').concat(e("flowide.color.base.border"),";\n min-height: 1px;\n z-index: 3;\n }\n .").concat(io,'[data-orientation="vertical"] .lm-SplitPanel-handle:hover {\n background: ').concat(e("flowide.color.base.primary.hover"),";\n min-height: 4px;\n }\n .").concat(io,'[data-orientation="vertical"] .lm-SplitPanel-handle:active {\n background: ').concat(e("flowide.color.base.primary"),";\n min-height: 4px;\n }\n\n .").concat(io,'[data-orientation="horizontal"] .lm-SplitPanel-handle {\n background: ').concat(e("flowide.color.base.border"),";\n min-width: 1px;\n }\n .").concat(io,'[data-orientation="horizontal"] .lm-SplitPanel-handle:hover {\n background: ').concat(e("flowide.color.base.primary.hover"),";\n min-width: 4px;\n }\n .").concat(io,'[data-orientation="horizontal"] .lm-SplitPanel-handle:active {\n background: ').concat(e("flowide.color.base.primary"),";\n min-width: 4px;\n }\n "),od=e=>"\n .flow-Menu {\n z-index: 10000;\n position: absolute;\n top: 0;\n left: 0;\n padding: 4px;\n white-space: nowrap;\n overflow-x: hidden;\n overflow-y: auto;\n outline: none;\n font: 12px Helvetica,Arial,sans-serif;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background: ".concat(e("flowide.color.base.bg.0"),";\n color: ").concat(e("flowide.color.base.text.0"),";\n border: 1px solid ").concat(e("flowide.color.menu.border"),";\n box-shadow: 0 1px 6px ").concat(e("flowide.color.menu.box.shadow"),";\n border-radius: 6px;\n }\n\n .flow-Menu-content {\n margin: 0;\n padding: 0;\n display: flex;\n outline: none;\n flex-direction: column;\n list-style-type: none;\n }\n\n .flow-Menu-item {\n display: flex;\n justify-content: space-between;\n padding: 0 4px;\n border-radius: 4px;\n align-items: center;\n outline: none;\n cursor: pointer;\n }\n\n .flow-Menu-item.flow-mod-active {\n background: ").concat(e("flowide.color.base.fill.0"),";\n }\n\n .flow-Menu-item.flow-mod-disabled {\n opacity: 0.35;\n }\n\n .flow-Menu-item.flow-mod-hidden,\n .flow-Menu-item.flow-mod-collapsed {\n display: none !important;\n }\n\n .flow-Menu-itemIcon,\n .flow-Menu-itemSubmenuIcon {\n text-align: center;\n }\n\n .flow-Menu-itemLabel {\n text-align: left;\n padding: 4px 35px 4px 2px;\n }\n\n .flow-Menu-itemShortcut {\n text-align: right;\n }\n .flow-Menu-itemIcon::before,\n .flow-Menu-itemSubmenuIcon::before {\n font-family: codicon;\n }\n\n .flow-Menu-item > .flow-Menu-itemSubmenuIcon::before {\n content: '\\eab6';\n line-height: 20px;\n }\n");class ou{get commandService(){return this.commandFactory()}registerStyle(e,t){var{add:n}=e,{getColor:r}=t;n("\n ".concat(od(r),"\n .flow-hover {\n color: ").concat(r("flowide.color.base.text.0"),";\n background: ").concat(r("flowide.color.base.bg.0"),";\n\n border: 2px solid ").concat(r("flowide.color.base.border"),";\n border-radius: 6px;\n padding: 4px;\n }\n .flowide-container {\n height: 100%;\n }\n .flowide-container .debug-bar-widget-container {\n position: fixed;\n width: fit-content;\n height: fit-content;\n }\n .flowide-container .lm-Widget {\n width: 100%;\n height: 100%;\n }\n .flowide-container .flow-tab-icon-label {\n display: flex;\n align-items: center;\n width: 100%;\n overflow: hidden;\n }\n .flowide-container .flow-tab-icon-label .flow-TabBar-tabLabel-text {\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: keep-all;\n white-space: nowrap;\n }\n .flowide-container .lm-TabBar-tabCloseIcon:hover {\n cursor: pointer;\n }\n .flowide-container .lm-TabBar-content {\n width: fit-content;\n border: 0;\n }\n .flowide-container .lm-DockPanel-handle {\n background: ").concat(r("flowide.color.base.border"),";\n }\n .flowide-container .lm-TabBar {\n color: ").concat(r("flowide.color.base.text.2"),";\n background: ").concat(r("flowide.color.base.fill.0"),";\n display: flex;\n height: 24px;\n }\n .flowide-container .lm-TabBar-tab {\n background: transparent;\n border: 0;\n min-width: 125px;\n max-height: 24px;\n line-height: 24px;\n }\n .flowide-container .lm-TabBar-tab:hover {\n color: ").concat(r("flowide.color.base.text.0"),";\n background: ").concat(r("flowide.color.base.fill.0"),';\n }\n .flowide-container .lm-DockPanel-handle[data-orientation="vertical"] {\n min-height: 1px;\n z-index: 3;\n }\n .flowide-container .lm-DockPanel-handle[data-orientation="vertical"]:hover {\n background: ').concat(r("flowide.color.base.primary.hover"),';\n min-height: 4px;\n }\n .flowide-container .lm-DockPanel-handle[data-orientation="vertical"]:active {\n background: ').concat(r("flowide.color.base.primary"),';\n min-height: 4px;\n }\n\n .flowide-container .lm-DockPanel-handle[data-orientation="horizontal"] {\n min-width: 1px;\n }\n .flowide-container .lm-DockPanel-handle[data-orientation="horizontal"]:hover {\n background: ').concat(r("flowide.color.base.primary.hover"),';\n min-width: 4px;\n }\n .flowide-container .lm-DockPanel-handle[data-orientation="horizontal"]:active {\n background: ').concat(r("flowide.color.base.primary"),";\n min-width: 4px;\n }\n .flowide-container .lm-TabBar-tab.lm-mod-current {\n background: ").concat(r("flowide.color.base.bg.0"),";\n color: ").concat(r("flowide.color.base.text.0"),";\n transform: unset;\n position: relative;\n }\n .flowide-container #").concat(ie,' .lm-TabBar-tab.lm-mod-current::before {\n position: absolute;\n top: 0;\n left: 0;\n content: "";\n width: 100%;\n height: 2px;\n background: ').concat(r("flowide.color.base.primary"),";\n }\n .flowide-container #").concat(it,' .lm-TabBar-tab.lm-mod-current::before {\n position: absolute;\n bottom: 0;\n left: 0;\n content: "";\n width: 100%;\n height: 2px;\n background: ').concat(r("flowide.color.base.primary"),';\n }\n .flowide-container .lm-TabBar-tabCloseIcon.saving:before {\n content: "\\f111";\n }\n .flowide-container .lm-TabBar-tabCloseIcon.saving:hover:before {\n content: "\\f00d";\n }\n .flowide-container .').concat(ia," {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: space-between;\n }\n .flowide-container .").concat(il," {\n flex-grow: 1;\n position: relative;\n overflow: hidden;\n }\n .flowide-container .").concat(il," .ide-ps__rail-x {\n z-index: 999999;\n user-select: none;\n pointer-events: none;\n }\n .flowide-container .").concat(il," .ide-ps__thumb-x {\n height: 2px;\n }\n .flowide-container .").concat(is," {\n flex-shrink: 0;\n height: 100%;\n }\n .flowide-container .").concat(is," .").concat(ic," {\n display: flex;\n height: 100%;\n }\n .flowide-container .").concat(is," .").concat(id," {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 4px;\n }\n ").concat(oc(r),"\n }"))}registerCommands(e){e.registerCommand({id:eX.mY.Default.VIEW_CLOSE_ALL_WIDGET,label:"Close All Tab"},{execute:()=>{var e,t=(null===(e=this.shell.currentWidget)||void 0===e?void 0:e.parent).tabBars(),n=[];for(var r of t)n=n.concat(r.titles);this.commandService.executeCommand(eX.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,n)}}),e.registerCommand({id:eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET,label:"Close Current Tab",shortLabel:"Close"},{execute:e=>{var t=e||this.shell.currentWidget;t&&this.commandService.executeCommand(eX.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,[t.title])}}),e.registerCommand({id:eX.mY.Default.VIEW_REOPEN_LAST_WIDGET,label:"Reopen Last Tab"},{execute:()=>{var e=this.shell.closeWidgetUriStack.pop();e&&this.openHandler.open(e)}}),e.registerCommand({id:eX.mY.Default.VIEW_CLOSE_OTHER_WIDGET,label:"Close Other Tab"},{execute:e=>{try{var t=e||this.shell.currentWidget,n=null==t?void 0:t.parent;if(!n)return;var r=[];for(var o of n.tabBars())[...o.titles].map(e=>{e.owner!==t&&r.push(e)});this.commandService.executeCommand(eX.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,r)}catch(e){console.error(e)}}}),e.registerCommand({id:eX.mY.Default.VIEW_CLOSE_BOTTOM_PANEL,label:"Close/Open Bottom Pannel"},{execute:()=>{var e;!(null===(e=this.shell.bottomPanel)||void 0===e?void 0:e.currentTitle)&&this.commandService.executeCommand(eX.mY.Default.VIEW_PROBLEMS),this.shell.bottomPanel.setHidden(!this.shell.bottomPanel.isHidden)}}),e.registerCommand({id:eX.mY.Default.VIEW_OPEN_NEXT_TAB,label:"Open Next Tab"},{execute:()=>{this.viewService.openNextTab()}}),e.registerCommand({id:eX.mY.Default.VIEW_OEPN_LAST_TAB,label:"Open Last Tab"},{execute:()=>{this.viewService.openLastTab()}}),e.registerCommand({id:eX.mY.Default.VIEW_FULL_SCREEN,label:"Full Screen"},{execute:this.shell.disableFullScreen?()=>null:()=>{this.viewService.switchFullScreenMode()}})}registerShortcuts(e){e.registerHandlers({keybinding:"alt shift w",commandId:eX.mY.Default.VIEW_CLOSE_ALL_WIDGET}),e.registerHandlers({keybinding:"alt shift rightarrow",commandId:eX.mY.Default.VIEW_OPEN_NEXT_TAB,preventDefault:!0}),e.registerHandlers({keybinding:"alt shift leftarrow",commandId:eX.mY.Default.VIEW_OEPN_LAST_TAB,preventDefault:!0}),e.registerHandlers({keybinding:"alt w",commandId:eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET}),e.registerHandlers({keybinding:"alt shift t",commandId:eX.mY.Default.VIEW_REOPEN_LAST_WIDGET}),e.registerHandlers({keybinding:"meta alt t",commandId:eX.mY.Default.VIEW_CLOSE_OTHER_WIDGET}),e.registerHandlers({keybinding:"meta j",commandId:eX.mY.Default.VIEW_CLOSE_BOTTOM_PANEL}),e.registerHandlers({keybinding:"alt f",commandId:eX.mY.Default.VIEW_FULL_SCREEN})}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],ou.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(or),(0,e2.w6)("design:type",void 0===or?Object:or)],ou.prototype,"viewService",void 0),(0,e2.gn)([(0,e8.f)(na),(0,e2.w6)("design:type",void 0===na?Object:na)],ou.prototype,"navigationService",void 0),(0,e2.gn)([(0,e8.f)(eX.BB),(0,e2.w6)("design:type",Function)],ou.prototype,"commandFactory",void 0),(0,e2.gn)([(0,e8.f)(i$),(0,e2.w6)("design:type",void 0===i$?Object:i$)],ou.prototype,"openHandler",void 0),ou=(0,e2.gn)([(0,e4.b)()],ou);var oh=()=>(0,tK.jsx)("div",{children:"Something went wrong."});var op=e0({onBind:(e,t)=>{var{bind:n}=e;n(iJ).toSelf().inSingletonScope(),n(r9).toSelf().inSingletonScope(),n(iY).toSelf().inSingletonScope(),n(r7).toConstantValue((0,tm._)({widgetFallbackRender:oh},t)),n(iq).toSelf().inSingletonScope(),n(iQ).toSelf().inSingletonScope(),(0,eX.yb)(n,r5),(0,eX.yb)(n,iG),(0,eX.yb)(n,iX),(0,eX.KV)(n,i$,[ta]),n(iD).toSelf().inSingletonScope(),n(oi).toSelf().inSingletonScope(),n(or).toSelf().inSingletonScope(),n(iZ).toSelf().inSingletonScope(),n(iv).toSelf().inSingletonScope(),n(iW).toAutoFactory(iF),n(iF).toSelf(),n(r3).toFactory(e=>e=>(e.bind(r8).toSelf().inSingletonScope(),e.get(r8))),n(iH).toFactory(e=>()=>{var t=e.container.createChild();return t.bind(on).toSelf().inSingletonScope(),t.bind(ot).toSelf().inSingletonScope(),t.bind(oe).toFactory(e=>()=>{var t=e.container.createChild();return t.bind(ot).toSelf().inSingletonScope(),t.get(ot)}),t.bind(i0).toFactory(e=>t=>{var n=e.container.createChild();n.bind(i1).toSelf().inSingletonScope();var r=n.get(i1);return r.initAlign(t),r}),t.bind(i9).toFactory(e=>()=>{var t=e.container.createChild();return t.bind(i7).toSelf().inSingletonScope(),t.get(i7)}),t.get(on)}),n(nH).toDynamicValue(e=>{var t=e.container.get(iq);return e.container.get(iY).toReactComponent(t)}).inSingletonScope(),(0,eX.KV)(n,ou,[eX.pY,nM,t5]),n(iV.Factory).toFactory(()=>e=>new iV(e)),ol(n)},onInit:(X=(0,e3._)(function*(e,t){var n=e.get(iJ);yield n.init(t)}),function(e,t){return X.apply(this,arguments)}),onLayoutInit:(Q=(0,e3._)(function*(e,t){if(!(null===(n=t.presetConfig)||void 0===n?void 0:n.disableContextMenu)){var n,r=e.container.get(i5);r.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_ALL_WIDGET,selector:".lm-TabBar-tab"}),r.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_OTHER_WIDGET,selector:".lm-TabBar-tab"}),r.addMenuItem({command:eX.mY.Default.VIEW_FULL_SCREEN,selector:".lm-TabBar-tab",filter:e=>{var t;return(null==e?void 0:null===(t=e.parent)||void 0===t?void 0:t.id)===ie}}),r.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET,selector:".lm-TabBar-tab"})}var o=e.get(iJ);yield o.attach(t);var a=e.container.get(nY),s=e.container.get(i5);a.listenGlobalEvent("contextmenu",e=>{if(!t2(e.target)){var n,r=s.open(e);(!(null===(n=t.presetConfig)||void 0===n?void 0:n.disableContextMenu)||r)&&(e.stopPropagation(),e.preventDefault())}})}),function(e,t){return Q.apply(this,arguments)}),onDispose:e=>{e.get(iQ).storeLayout()}}),of=n("407821"),om=n.n(of),ov=n("472772"),og=n.n(ov),ob=n("395245"),oy=n.n(ob),o_=n("297998"),ow=n.n(o_),ox=n("646576"),oS=n.n(ox),ok=n("606121"),oC=n.n(ok),oj=n("950367"),oE={};oE.styleTagTransform=oC(),oE.setAttributes=ow(),oE.insert=oy().bind(null,"head"),oE.domAPI=og(),oE.insertStyleElement=oS(),om()(oj.Z,oE),oj.Z&&oj.Z.locals&&oj.Z.locals;var oT=n("268063"),oI={};oI.styleTagTransform=oC(),oI.setAttributes=ow(),oI.insert=oy().bind(null,"head"),oI.domAPI=og(),oI.insertStyleElement=oS(),om()(oT.Z,oI),oT.Z&&oT.Z.locals&&oT.Z.locals;class oP{onInit(){}registerCommands(e){}}(0,e2.gn)([(0,e8.f)(na),(0,e2.w6)("design:type",void 0===na?Object:na)],oP.prototype,"navigationService",void 0),(0,e2.gn)([(0,e8.f)(ts),(0,e2.w6)("design:type",void 0===ts?Object:ts)],oP.prototype,"openerService",void 0),oP=(0,e2.gn)([(0,e4.b)()],oP);(eZ||(eZ={})).create=function(e){return{container:e,get resourceService(){return e.get(tB)},get historyService(){return e.get(eX.qp)},get commandService(){return e.get(eX.VD)},get:t=>e.get(t),getAll:t=>e.getAll(t)}};var oM=(0,tq.forwardRef)((e,t)=>{var{options:n,container:r,containerModules:o,children:a,className:s}=e,l=(0,tq.useMemo)(()=>{var e;return{containerModules:o,container:r,plugins:(e=n,t=>{var n=e(t),r=[];return r.push(tW(n.resource||{}),op(n.view||{widgetFactories:[],defaultLayoutData:{activityBarItems:[],defaultWidgets:[]}}),nl(n.navigation||{}),tV(n.command||{}),(0,eX.JE)(n.history||{}),e1(n),nO(n.label||{}),t8(n.shortcut||{}),nt(n.preferences||{}),nA({}),i8(),nG()),r.push(e1({onBind(e){var{bind:t}=e;(0,eX.KV)(t,oP,[eX.pY,eG]),n.openHandlers&&n.openHandlers.forEach(e=>{"function"==typeof e?(t(e).toSelf().inSingletonScope(),t(ta).toService(e)):t(ta).toConstantValue(e)})}})),n.plugins&&r.push(...n.plugins),r}),customPluginContext:e=>eZ.create(e)}},[]);return(0,tK.jsx)(nK,(0,tv._)((0,tm._)({},l),{ref:t,children:(0,tK.jsxs)(tK.Fragment,{children:[(0,tK.jsx)(nU,{className:s}),a]})}))}),oR=()=>({version:"",patch:()=>null}),oD=n("407694"),oA=Symbol("OptionsService");class oN{send(e){}init(){}onDispose(){}constructor(){this.onMessageSendEmitter=new eX.Q5,this.onMessageSend=this.onMessageSendEmitter.event}}(0,e2.gn)([(0,e8.f)(oA),(0,e2.w6)("design:type",void 0===oA?Object:oA)],oN.prototype,"options",void 0),oN=(0,e2.gn)([(0,e4.b)()],oN);var oL=Symbol("WidgetContext"),oz=()=>(0,oD.Cg)()(e=>e.spaceId),oO="coze-project",oB=new tD("".concat(oO,":///top-bar")),oW=new tD("".concat(oO,":///default")),oF=new tD("".concat(oO,":///side-bar")),oH=new tD("".concat(oO,":///secondary-sidebar")),oU=new tD("".concat(oO,":///side-bar/resource")),oV=new tD("".concat(oO,":///side-bar/config")),oK=new tD("".concat(oO,":///ui-builder")),oq=new tD("".concat(oO,":///ui-builder/content")),oZ=new tD("".concat(oO,":///session"));var oY=((G={}).RELOAD="reload",G);class oX{switchPanel(e){var t,n,r=this.widgetManager.getWidgetFromURI(oK);e&&oK.match(e)?((null===(t=this.shell.mainPanel.parent)||void 0===t?void 0:t.parent).hide(),null==r||r.show()):(null==r||r.hide(),(null===(n=this.shell.mainPanel.parent)||void 0===n?void 0:n.parent).show())}uiBuilderReopen(){var e=this;return(0,e3._)(function*(){(yield e.widgetManager.getOrCreateWidgetFromURI(oq)).dispose(),e.openPanel("ui-builder")})()}secondarySidebarReOpen(){if(!!this.secondarySidebar.getVisible()){var e=this.widgetManager.getWidgetFromURI(oH);null==e||e.dispose(),this.openerService.open(oH)}}open(e){var t=this;return(0,e3._)(function*(){t.switchPanel(e),yield t.openerService.open(e)})()}openPanel(e){var t=this;return(0,e3._)(function*(){if("ui-builder"===e){t.switchPanel(oK);var n=t.widgetManager.getFactoryFromURI(oq),r=yield t.widgetManager.getOrCreateWidgetFromURI(oq,n);if(t.viewRenderer.addReactPortal(r),!(null==r?void 0:r.isAttached)&&r){var o,a=t.widgetManager.getWidgetFromURI(oK);null==a||null===(o=a.addWidget)||void 0===o||o.call(a,r)}}else t.switchPanel()})()}openDefault(){var e=this;return(0,e3._)(function*(){yield e.openerService.open(oW,{mode:"single-document"})})()}closeWidgetByUri(e){var t=this.widgetManager.getWidgetFromURI(e);t&&t.close()}getWidgetContextFromURI(e){var t=this.widgetManager.getWidgetFromURI(e);if(t)return t.context}splitScreen(e,t){var n,r,o,a=null===(o=this.shell.mainPanel)||void 0===o?void 0:null===(r=o.layout)||void 0===r?void 0:null===(n=r.saveLayout())||void 0===n?void 0:n.main;if((null==a?void 0:a.type)==="tab-area")this.shell.mainPanel.addWidget(t,{mode:"left"===e?"split-left":"split-right"}),this.shell.mainPanel.activateWidget(t);else if((null==a?void 0:a.type)==="split-area"){var{widgets:s}=null==a?void 0:a.children["left"===e?0:1],l=s.find(e=>e.isVisible);this.shell.mainPanel.addWidget(t,{mode:"tab-after",ref:l}),this.shell.mainPanel.activateWidget(t)}}switchFullScreenMode(){this.isFullScreenMode?this.disableFullScreenMode():this.enableFullScreenMode()}enableFullScreenMode(){if(!this.isFullScreenMode)this.primarySidebar.changeVisible(!1),this.shell.getPanelFromArea(r6.TOP_BAR).hide(),this.isFullScreenMode=!0,this.onFullScreenModeChangeEmitter.fire(!0)}disableFullScreenMode(){if(!!this.isFullScreenMode)this.primarySidebar.changeVisible(!0),this.shell.getPanelFromArea(r6.TOP_BAR).show(),this.isFullScreenMode=!1,this.onFullScreenModeChangeEmitter.fire(!1)}constructor(){this.isFullScreenMode=!1,this.onSidebarVisibleChangeEmitter=new eX.Q5,this.onSidebarVisibleChange=this.onSidebarVisibleChangeEmitter.event,this.onSecondarySidebarVisibleChangeEmitter=new eX.Q5,this.onSecondarySidebarChange=this.onSecondarySidebarVisibleChangeEmitter.event,this.onFullScreenModeChangeEmitter=new eX.Q5,this.onFullScreenModeChange=this.onFullScreenModeChangeEmitter.event,this.primarySidebar={onSidebarVisibleChange:this.onSidebarVisibleChange,getVisible:()=>this.shell.primarySidebar.isVisible,changeVisible:e=>{e?(this.shell.primarySidebar.show(),this.onSidebarVisibleChangeEmitter.fire(!0)):(this.shell.primarySidebar.hide(),this.onSidebarVisibleChangeEmitter.fire(!1))}},this.secondarySidebar={getVisible:()=>this.shell.secondarySidebar.isVisible,changeVisible:e=>{e?(!this.widgetManager.getWidgetFromURI(oH)&&this.openerService.open(oH),this.shell.secondarySidebar.show(),this.onSecondarySidebarVisibleChangeEmitter.fire(!0)):(this.shell.secondarySidebar.hide(),this.onSecondarySidebarVisibleChangeEmitter.fire(!1))}}}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],oX.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],oX.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(ts),(0,e2.w6)("design:type",void 0===ts?Object:ts)],oX.prototype,"openerService",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],oX.prototype,"viewRenderer",void 0),oX=(0,e2.gn)([(0,e4.b)()],oX);class oQ{registerMenus(e,t){var n=()=>{var e,n=this.contextKeyService.getContext("widgetFocus");return!!(null==t?void 0:null===(e=t.test)||void 0===e?void 0:e.call(t,n.toString()))};e.forEach(e=>{if(e.submenu){var t=this.menu.createSubMenu();this.menu.addMenuItem({command:e.commandId,selector:e.selector,submenu:t,filter:n}),e.submenu.forEach(e=>{t.addItem({command:e.commandId,filter:n})})}else this.menu.addMenuItem({command:e.commandId,selector:e.selector,filter:n})})}constructor(){var e=this;this.contextmenu={registerContextMenu:(e,t)=>{this.registerMenus(e,t)},open:e=>this.menu.open(e)},this.command={execute:function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;onF(oQ);function oJ(){var e=iA();if(!e.context)throw Error("[useWidgetContext] Undefined widgetContext from ide context");return e.context}var o$=()=>{var e=iN(r6.MAIN_PANEL);return null==e?void 0:e.context},o0=n("157728"),o1=(e,t)=>{var n=iC([e.mainPanel],[1],{orientation:"vertical",spacing:0});e.bottomSplitLayout=n;var r=new rJ({layout:n}),o=ik([e.primarySidebar,r],[0,1],{direction:"left-to-right",spacing:6}),a=ik([new rL({layout:o}),t,e.secondarySidebar],[1,0,0],{direction:"left-to-right"}),s=new rL({layout:a});return ik([e.topPanel,s],[0,1],{direction:"top-to-bottom",spacing:0})},o2=(e,t)=>{var n=(0,tq.lazy)(e);return()=>(0,tK.jsx)(tq.Suspense,{fallback:t,children:(0,tK.jsx)(n,{})})},o4=e=>{var t,n,r=e.match(/space\/\d+\/project-ide\/\d+\/([^\/]+)(?:\/([^\/]+))?/);return r&&(t=r[1],n=r[2]),{resourceType:t,resourceId:n}},o6=e=>{var t=e.match(/space\/[^/]+\/project-ide\/[^/]+\/(.*)/);return t?t[1]:null},o5=e=>e.path.toString(),o3=(e,t,n)=>new tD("".concat(oO,":///").concat(e,"/").concat(t).concat(n?"?".concat(n):"")),o8=e=>new tD("".concat(oO,":///").concat(e)),o9=e=>"".concat(e.path.toString()).concat(e.query?"".concat(e.query):"").concat(e.fragment?"#".concat(e.fragment):""),o7=(e,t)=>!!e&&!!t&&e.toString()===t.toString(),ae=["commit_version"];function at(e){if(!e)return e;var t=new URLSearchParams(window.location.search),n=new URLSearchParams;for(var r of ae){var o=t.get(r);o&&!e.includes("".concat(r,"="))&&n.append(r,o)}var a=e.includes("?")?"&":"?",s=n.toString();return s?"".concat(e).concat(a).concat(s):e}var an=()=>(0,oD.Cg)()(e=>e.projectId),ar=()=>{var{view:e}=oG(),t=oz(),n=an(),r=(0,o0.useNavigate)();return(0,tq.useCallback)((o,a)=>{var s="/space/".concat(t,"/project-ide/").concat(n).concat(o),l=new tD("".concat(oO,"://").concat(o)),c=l.displayName===oK.displayName;o&&"/"!==o&&!c?e.open(l):e.openPanel(c?"ui-builder":"dev"),r(at(s),a)},[t,n,e,r])},ai=(e,t)=>{var n,r,o,a=-1,s=null===(o=e.mainPanel)||void 0===o?void 0:null===(r=o.layout)||void 0===r?void 0:null===(n=r.saveLayout)||void 0===n?void 0:n.call(r).main,l=(null==s?void 0:s.children)||[s];return(l.forEach((e,n)=>{t&&((null==e?void 0:e.widgets)||[]).some(e=>{var n,r;return(null===(r=e.uri)||void 0===r?void 0:null===(n=r.toString)||void 0===n?void 0:n.call(r))===t.toString()})&&(a=n)}),(null==l?void 0:l.length)===1)?void 0:1===a?"right":"left"},ao=(e,t)=>{var n,r=nF(iq),[o,a]=(0,tq.useState)(ai(r,e));return(0,tq.useEffect)(()=>{a(ai(r,e));var n=()=>{(null==t?void 0:t.titles.some(t=>{var n;return o7(null===(n=t.owner)||void 0===n?void 0:n.uri,e)}))&&a(ai(r,e))};return r.mainPanel.layoutModified.connect(n),()=>{r.mainPanel.layoutModified.disconnect(n)}},[null==e?void 0:null===(n=e.toString)||void 0===n?void 0:n.call(e)]),o},aa=()=>{var{widget:e}=oJ(),[t,n]=(0,tq.useState)(e.getTitle());return(0,tq.useEffect)(()=>{var t=e.onTitleChanged(e=>{n(e)});return()=>{var e;null==t||null===(e=t.dispose)||void 0===e||e.call(t)}},[]),t},as=e=>{var t=iA();(0,tq.useLayoutEffect)(()=>{var n=t.onActivate(()=>{e(t)});return()=>n.dispose()},[t,e])},al=()=>{var e,t,n=iA(),[r,o]=(0,tq.useState)((null===(e=n.uri)||void 0===e?void 0:e.queryObject)||{}),a=(0,tq.useRef)(null===(t=n.uri)||void 0===t?void 0:t.query);return as((0,tq.useCallback)(e=>{var t,n,r=null===(t=e.uri)||void 0===t?void 0:t.query;a.current!==r&&(a.current=r,o((null===(n=e.uri)||void 0===n?void 0:n.queryObject)||{}))},[a,o])),r},ac=e=>{var t,n=nF(eX.Ho);return{keybinding:nF(t3).getShortcutByCommandId(e).map(e=>e.join(" ")).join("/"),label:null===(t=n.getCommand(e))||void 0===t?void 0:t.label}},ad=n("336205"),au=n("298203"),ah=n("909776"),ap=n("382534");var af=((J={}).RESOURCE="resource",J.CLOSE_CONFIRM="close-confirm",J);class am{startPolling(e){var t=this;return(0,e3._)(function*(){t._stopPolling=!1;var n=e.res_name;try{t.onModalVisibleChangeEmitter.fire({type:"resource",scene:e.scene,resourceName:n});var{task_id:r,failed_reasons:o}=yield ap.Js.ResourceCopyDispatch(e);if(t._taskId=r,null==o?void 0:o.length){var a="";a=o.some(e=>e.res_type===ah.b0.Workflow)?ad.o.t("resource_copy_move_notify"):o.reduce((e,t)=>{var n="".concat(t.res_name||"").concat(t.reason||"");return e?"".concat(e,"\n").concat(n):n},""),t.onErrorEmitter.fire(a);return}r?t.doPolling(r):t.onErrorEmitter.fire("no_task_id")}catch(e){t.onErrorEmitter.fire(!0)}})()}retry(){var e=this;return(0,e3._)(function*(){e._stopPolling=!1,e._taskId&&(yield ap.Js.ResourceCopyRetry({task_id:e._taskId}),e.onErrorEmitter.fire(!1),e.doPolling(e._taskId))})()}doPolling(e){var t=this;return(0,e3._)(function*(){if(t._taskId=e,!t._stopPolling)try{var n=yield t.polling(),{status:r}=n||{};yield(0,au._v)(1e3),t._taskId&&!t._stopPolling&&t.onModalVisibleChangeEmitter.fire({type:"resource",scene:null==n?void 0:n.scene,resourceName:null==n?void 0:n.res_name}),r===ah.hY.Processing?t.doPolling(e):r===ah.hY.Successed?(t._stopPolling=!0,t.onModalVisibleChangeEmitter.fire({type:"resource",visible:!1}),t.onSuccessEmitter.fire(n)):t.onErrorEmitter.fire(!0)}catch(e){t._stopPolling=!0,t.onErrorEmitter.fire(!0)}})()}polling(){var e=this;return(0,e3._)(function*(){try{var{task_detail:t}=yield ap.Js.ResourceCopyDetail({task_id:e._taskId});return t}catch(t){return e._stopPolling=!0,e.onErrorEmitter.fire(!0),{status:ah.hY.Failed}}})()}onCloseResourceModal(){var e=this;return(0,e3._)(function*(){e._stopPolling=!0,e.onModalVisibleChangeEmitter.fire({type:"resource",visible:!1}),e.onCancelEmitter.fire(),e._taskId&&(yield ap.Js.ResourceCopyCancel({task_id:e._taskId}),e._taskId=void 0)})()}constructor(){this.onModalVisibleChangeEmitter=new eX.Q5,this.onModalVisibleChange=this.onModalVisibleChangeEmitter.event,this.onCancelEmitter=new eX.Q5,this.onCancel=this.onCancelEmitter.event,this.pollingDelay=1e3,this.onErrorEmitter=new eX.Q5,this.onError=this.onErrorEmitter.event,this.onSuccessEmitter=new eX.Q5,this.onSuccess=this.onSuccessEmitter.event,this._stopPolling=!1}}(0,e2.gn)([(0,e8.f)(oA),(0,e2.w6)("design:type",void 0===oA?Object:oA)],am.prototype,"options",void 0),am=(0,e2.gn)([(0,e4.b)()],am);class av{toErrorPage(){this.onErrorEmitter.fire()}constructor(){this.onErrorEmitter=new eX.Q5,this.onError=this.onErrorEmitter.event}}av=(0,e2.gn)([(0,e4.b)()],av);class ag{toKey(e){return this.widgetManager.uriToWidgetID(e)}get(e){var t=this.toKey(e);if(this.events.has(t))return this.events.get(t);var n=[];return this.events.set(t,n),n}delete(e){var t=this.toKey(e);return this.events.delete(t)}send(e,t){this.get(e).push(t),this.onSendEmitter.fire((0,tm._)({uri:e},t))}on(e){var t=this.get(e);return this.delete(e),t}compare(e,t){return this.toKey(e)===this.toKey(t)}constructor(){this.events=new Map,this.onSendEmitter=new eX.Q5,this.onSend=this.onSendEmitter.event}}(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],ag.prototype,"widgetManager",void 0),ag=(0,e2.gn)([(0,e4.b)()],ag);var ab=e=>{var t=nF(oN);return(0,tq.useEffect)(()=>{var n=t.onMessageSend(e);return()=>{n.dispose()}},[]),{send:(0,tq.useCallback)(e=>{t.send(e)},[t])}},ay=n("537845"),a_=()=>nF(ag),aw=()=>{var e=a_(),t=ar(),n=(0,tq.useCallback)((t,n)=>{var r="string"==typeof t?new tD("".concat(oO,"://").concat(t)):t;e.send(r,n)},[e]);return{send:n,sendOpen:(0,tq.useCallback)((n,r)=>{var o="string"==typeof n?new tD("".concat(oO,"://").concat(n)):n;e.send(o,r),t(o9(o))},[e,t])}},ax=(e,t)=>{var n=a_(),r=(0,tq.useRef)(e),o=(0,ay.Z)(()=>{n.on(e).forEach(t)});(0,tq.useEffect)(()=>{o();var e=n.onSend(e=>{n.compare(e.uri,r.current)&&o()});return()=>e.dispose()},[n,o,r])},aS=e=>{var t=nF(r9),n=new tD("".concat(oO,"://").concat(e));return t.getWidgetFromURI(n)};class ak extends r2{refresh(){this.onRefreshEmitter.fire()}render(){return null}constructor(e){super(e),this.onRefreshEmitter=new eX.Q5,this.onRefresh=this.onRefreshEmitter.event,this.scrollOptions={minScrollbarLength:35}}}class aC{init(e,t){this.registry=e,this._widgetTitleRender=t,this.setTitle(this._title)}update(){this.widget.title.iconLabel=this._widgetTitleRender({commandRegistry:this.commandRegistry,registry:this.registry,uiState:this._uiState,title:this._title,widget:this.widget}),this.widget.title.saving="saving"===this._uiState}setTitle(e,t){this._title!==e&&this.onTitleChangedEmitter.fire(e),this._title=e,t&&(this._uiState=t),this.update()}getTitle(){return this._title}getUIState(){return this._uiState}setUIState(e){this._uiState!==e&&(this._uiState=e,this.update())}getIconType(){return this._iconType}setIconType(e){this._iconType!==e&&this.onIconTypeChangeEmitter.fire(e),this._iconType=e,this.update()}close(){this.widget.close()}constructor(){this._uiState="loading",this.onFocusEmitter=new eX.Q5,this.onFocus=this.onFocusEmitter.event,this.onTitleChangedEmitter=new eX.Q5,this.onTitleChanged=this.onTitleChangedEmitter.event,this.onIconTypeChangeEmitter=new eX.Q5,this.onIconTypeChanged=this.onIconTypeChangeEmitter.event}}(0,e2.gn)([(0,e8.f)(ak),(0,e2.w6)("design:type",ak)],aC.prototype,"widget",void 0),(0,e2.gn)([(0,e8.f)(eX.Ho),(0,e2.w6)("design:type",void 0===eX.Ho?Object:eX.Ho)],aC.prototype,"commandRegistry",void 0),aC=(0,e2.gn)([(0,e4.b)()],aC),Symbol("RegistryHandler");var aj=Symbol("ProjectIDEClientProps"),aE=n("659596");class aT{init(){this.hoverService.enableCustomHoverHost()}canHandle(e){return 500}renderer(e,t){return(null==t?void 0:t.content)?(0,tK.jsx)(aE.u,{content:t.content,position:t.position,style:{opacity:1},trigger:"custom",getPopupContainer:()=>document.body,visible:!0,children:(0,tK.jsx)("div",{style:{width:0}})},t.content):null}onDispose(){}constructor(){this.visible=!1}}(0,e2.gn)([(0,e8.f)(iD),(0,e2.w6)("design:type",void 0===iD?Object:iD)],aT.prototype,"hoverService",void 0),(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],aT.prototype,"init",null),aT=(0,e2.gn)([(0,e4.b)()],aT);class aI extends ak{render(){var e=this.props.view.primarySideBar;return e?(0,tK.jsx)(e,{}):null}}(0,e2.gn)([(0,e8.f)(aj),(0,e2.w6)("design:type",void 0===aj?Object:aj)],aI.prototype,"props",void 0),aI=(0,e2.gn)([(0,e4.b)()],aI);class aP extends ak{render(){var e=this.props.view.configuration;return e?(0,tK.jsx)(e,{}):null}}(0,e2.gn)([(0,e8.f)(aj),(0,e2.w6)("design:type",void 0===aj?Object:aj)],aP.prototype,"props",void 0),aP=(0,e2.gn)([(0,e4.b)()],aP);class aM extends os{render(){return null}init(e){this.orientation="vertical",this.defaultStretch=[.7,.3],this.splitPanels=[{widgetUri:oU,widget:aI,order:1},{widgetUri:oV,widget:aP,order:2}],super.init(e)}}aM=(0,e2.gn)([(0,e4.b)()],aM);var aR=n("345420"),aD=(e,t)=>{var[n,r]=(0,tq.useState)(t.isVisible),[o,a]=(0,tq.useState)(0),s=(0,tq.useRef)(t.isVisible),[l,c]=(0,tq.useState)(!e.load),d=(0,tq.useMemo)(()=>(0,aR.Z)(e.renderContent)?e.renderContent(t.context,t):null,[e,t,o]),u=(0,tq.useCallback)((0,e3._)(function*(){if(!!e.load&&!!(0,aR.Z)(e.load))yield e.load(t.context),c(!0)}),[e,t,c]),h=(0,tq.useCallback)(e=>{var{isVisible:t}=e;return t&&!s.current&&(r(!0),s.current=!0),e.onDidChangeVisibility(e=>{e&&!s.current&&(r(!0),s.current=!0)})},[r,s]);return(0,tq.useLayoutEffect)(()=>{var e=h(t),n=t.onRefresh(()=>{a(e=>e+1)});return()=>{e.dispose(),n.dispose()}},[t,h]),(0,tq.useEffect)(()=>{u()},[u]),{loaded:l,mounted:n,content:d}};class aA{init(){this.disposable.push(this.shell.mainPanel.onDidChangeCurrent(e=>{e&&this.onFocusEmitter.fire(e)}))}dispose(){this.disposable.dispose()}constructor(){this.onFocusEmitter=new eX.Q5,this.onFocus=this.onFocusEmitter.event,this.disposable=new eX.K4(this.onFocusEmitter)}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],aA.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(nY),(0,e2.w6)("design:type",void 0===nY?Object:nY)],aA.prototype,"eventService",void 0),(0,e2.gn)([(0,e8.f)(i5),(0,e2.w6)("design:type",void 0===i5?Object:i5)],aA.prototype,"menuService",void 0),(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],aA.prototype,"init",null),aA=(0,e2.gn)([(0,e4.b)()],aA);var aN=(e,t,n)=>{var r=nF(aA),o=nF(e5),a=(0,tq.useCallback)(()=>{var r;null==e||null===(r=e.onFocus)||void 0===r||r.call(e,t),o.setContext("widgetFocus",null==n?void 0:n.uri),o.setContext("widgetContext",t)},[t]),s=nF(iq);(0,tq.useEffect)(()=>{var o,l,c,d,u=null===(l=s.mainPanel.currentTitle)||void 0===l?void 0:null===(o=l.owner)||void 0===o?void 0:o.uri;u&&(null==n?void 0:null===(c=n.uri)||void 0===c?void 0:c.match(u))&&a();var h=r.onFocus(e=>{var t,r;(null===(t=e.owner.uri)||void 0===t?void 0:t.toString())===(null==n?void 0:null===(r=n.uri)||void 0===r?void 0:r.toString())&&a()}),p=null==n?void 0:null===(d=n.onDispose)||void 0===d?void 0:d.call(n,()=>{var n;null==e||null===(n=e.onDispose)||void 0===n||n.call(e,t)});return()=>{var e,t;null==h||null===(e=h.dispose)||void 0===e||e.call(h),null==p||null===(t=p.dispose)||void 0===t||t.call(p)}},[])},aL=e=>()=>{var t=iA(),{context:n}=t;aN(e,n,t);var{loaded:r,mounted:o,content:a}=aD(e,t);return r&&o?a:(0,tK.jsx)(aE.yC,{})};class az{onInit(){this.wsService.init(),this.props.view.widgetRegistries.forEach(e=>{if(e.registerCommands&&e.registerCommands().forEach(t=>{!this.commandRegistry.getCommand(t.id)&&this.commandRegistry.registerCommand({id:t.id,label:t.label},{execute:e=>{var n=this.contextKeyService.getContext("widgetContext");t.execute(n,e)},isEnabled:n=>{var r,o=this.contextKeyService.getContext("widgetFocus"),a=this.contextKeyService.getContext("widgetContext");return((null==o?!void 0:null===(r=o.toString)||void 0===r?!void 0:!r.call(o))||!!e.match.test(o.toString())||"widgetFocus"!==t.when)&&t.isEnable(a,n)}})}),e.registerShortcuts&&e.registerShortcuts().forEach(e=>{this.shortcutsService.registerHandlers({commandId:e.commandId,keybinding:e.keybinding,preventDefault:e.preventDefault})}),e.registerContextMenu){var t=e.registerContextMenu();this.services.contextmenu.registerContextMenu(t,e.match)}}),this.commandRegistry.unregisterCommand(eX.mY.Default.VIEW_FULL_SCREEN),this.commandRegistry.registerCommand({id:eX.mY.Default.VIEW_FULL_SCREEN,label:ad.o.t("project_ide_maximize")},{execute:()=>{this.viewService.switchFullScreenMode()}}),this.commandRegistry.registerCommand({id:oY.RELOAD,label:ad.o.t("refresh_project_tags")},{execute:e=>{if(e)e.refresh();else{var t,{currentWidget:n}=this.shell;null==n||null===(t=n.refresh)||void 0===t||t.call(n)}}}),this.shortcutsService.registerHandlers({commandId:oY.RELOAD,keybinding:"alt r",preventDefault:!1})}createLayout(e){var t=new rL;return t.id=oK.displayName,this.widgetManager.setWidget(oK.toString(),t),o1(e,t)}createWidget(e,t){var n,r=this.widgetManager.containerFactory.createChild();r.bind(ak).toSelf().inSingletonScope();var o=r.get(ak),a=null===(n=e.createStore)||void 0===n?void 0:n.call(e,t);r.bind(aC).toSelf().inSingletonScope();var s=r.get(aC);s.init(e,this.props.view.widgetTitleRender);var l={uri:t,store:a,widget:s,services:this.services};return o.context=l,o.container=r,r.bind(oL).toConstantValue(l),o.render=aL(e),o}registerView(e){var t=this.props.view.widgetRegistries.map(e=>({area:e.area||r6.MAIN_PANEL,match:e.match,createWidget:this.createWidget.bind(this,e),toolbarItems:this.props.view.preToolbar?[{render:this.props.view.preToolbar,align:r4.LEADING},{render:this.props.view.toolbar,align:r4.TRAILING}]:[]}));e.register({presetConfig:{disableContextMenu:!0,splitScreenConfig:{main:{splitOptions:{maxSplitCount:2,splitOrientation:"horizontal"},dockPanelOptions:{spacing:6}}},disableFullScreen:!0},widgetFactories:[{area:r6.MAIN_PANEL,canHandle:oq.match.bind(oq),render:this.props.view.uiBuilder},{area:r6.TOP_BAR,canHandle:oB.match.bind(oB),render:this.props.view.topBar},{area:r6.MAIN_PANEL,canHandle:oW.match.bind(oW),render:this.props.view.widgetDefaultRender},{area:r6.PRIMARY_SIDEBAR,canHandle:oF.match.bind(oF),widget:aM},{area:r6.SECONDARY_SIDEBAR,canHandle:oH.match.bind(oH),render:this.props.view.secondarySidebar},...t],defaultLayoutData:{defaultWidgets:[oB]},customLayout:this.createLayout.bind(this)})}onDispose(){this.wsService.onDispose()}}(0,e2.gn)([(0,e8.f)(aj),(0,e2.w6)("design:type",void 0===aj?Object:aj)],az.prototype,"props",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],az.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(e5),(0,e2.w6)("design:type",void 0===e5?Object:e5)],az.prototype,"contextKeyService",void 0),(0,e2.gn)([(0,e8.f)(oQ),(0,e2.w6)("design:type",void 0===oQ?Object:oQ)],az.prototype,"services",void 0),(0,e2.gn)([(0,e8.f)(eX.Ho),(0,e2.w6)("design:type",void 0===eX.Ho?Object:eX.Ho)],az.prototype,"commandRegistry",void 0),(0,e2.gn)([(0,e8.f)(t3),(0,e2.w6)("design:type",void 0===t3?Object:t3)],az.prototype,"shortcutsService",void 0),(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],az.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(oX),(0,e2.w6)("design:type",void 0===oX?Object:oX)],az.prototype,"viewService",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],az.prototype,"viewRenderer",void 0),(0,e2.gn)([(0,e8.f)(oN),(0,e2.w6)("design:type",void 0===oN?Object:oN)],az.prototype,"wsService",void 0),az=(0,e2.gn)([(0,e4.b)()],az);var aO=e0({onBind:(e,t)=>{var{bind:n}=e;n(aj).toConstantValue(t),n(aA).toSelf().inSingletonScope(),n(oX).toSelf().inSingletonScope(),n(am).toSelf().inSingletonScope(),n(ag).toSelf().inSingletonScope(),n(av).toSelf().inSingletonScope(),n(oN).toSelf().inSingletonScope(),n(oQ).toSelf().inSingletonScope(),(0,eX.KV)(n,az,[iG,eG]),(0,eX.KV)(n,aT,[nN])},onStart:e=>{e.container.get(tp).onStart()},onDispose:e=>{e.container.get(aA).dispose()}}),aB={SPLIT_LEFT:{id:"view.custom.split-left",label:ad.o.t("project_ide_tabs_open_on_left")},SPLIT_RIGHT:{id:"view.custom.split-right",label:ad.o.t("project_ide_tabs_open_on_right")},REFRESH:{id:"view.custom.refresh-widget",label:ad.o.t("refresh_project_tags")}};function aW(e){var t=0;return Array.from(e.children()).forEach(e=>{e instanceof rZ&&(t+=e.titles.length)}),t}var aF=e0({onInit(e){var t=e.container.get(i5),n=e.container.get(eX.Ho),r=e.container.get(oX),o=e.container.get(iq),a=e.container.get(t3);n.updateCommand(eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET,{label:ad.o.t("project_ide_tabs_close")}),n.updateCommand(eX.mY.Default.VIEW_CLOSE_OTHER_WIDGET,{label:ad.o.t("project_ide_tabs_close_other_tabs")}),n.updateCommand(eX.mY.Default.VIEW_CLOSE_ALL_WIDGET,{label:ad.o.t("project_ide_tabs_close_all")}),n.registerCommand(aB.REFRESH,{execute:e=>{e.refresh()}}),a.registerHandlers({keybinding:"alt r",commandId:aB.REFRESH.id}),n.registerCommand(aB.SPLIT_LEFT,{execute:e=>{r.splitScreen("left",e)},isEnabled:()=>aW(o.mainPanel)>1}),n.registerCommand(aB.SPLIT_RIGHT,{execute:e=>{r.splitScreen("right",e)},isEnabled:()=>aW(o.mainPanel)>1}),t.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET,selector:".lm-TabBar-tab"}),t.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_OTHER_WIDGET,selector:".lm-TabBar-tab"}),t.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_ALL_WIDGET,selector:".lm-TabBar-tab"}),t.addMenuItem({command:aB.REFRESH.id,selector:".lm-TabBar-tab"}),t.addMenuItem({type:"separator",selector:".lm-TabBar-tab"}),t.addMenuItem({command:aB.SPLIT_LEFT.id,selector:".lm-TabBar-tab"}),t.addMenuItem({command:aB.SPLIT_RIGHT.id,selector:".lm-TabBar-tab"})}});class aH{registerCommands(e){e.registerCommand(eX.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,{execute:e=>{e.some(e=>null==e?void 0:e.saving)?this.modalService.onModalVisibleChangeEmitter.fire({type:af.CLOSE_CONFIRM,options:e}):e.forEach(e=>{var t,n;return null==e?void 0:null===(n=e.owner)||void 0===n?void 0:null===(t=n.close)||void 0===t?void 0:t.call(n)})}})}}(0,e2.gn)([(0,e8.f)(am),(0,e2.w6)("design:type",void 0===am?Object:am)],aH.prototype,"modalService",void 0),aH=(0,e2.gn)([(0,e4.b)()],aH);var aU=e0({onBind:e=>{var{bind:t}=e;(0,eX.KV)(t,aH,[eX.pY])}}),aV=e=>{var{presetOptions:t,plugins:n,children:r}=e,o=(0,tq.useCallback)(()=>({preferences:{defaultData:{theme:"light"}},view:{restoreDisabled:!0,widgetFactories:[],defaultLayoutData:{},widgetFallbackRender:t.view.widgetFallbackRender},plugins:[aO(t),aU(),aF(),...n||[]]}),[t,n]);return(0,tK.jsx)(oM,{options:o,className:"e2e-flow-container",children:r})},aK=n("392300");var aq=(($={}).Folder="folder",$);var aZ=((ee={}).CreateFolder="resource-folder-create-folder",ee.CreateResource="resource-folder-create-resource",ee.EditName="resource-folder-edit-name",ee.Delete="resource-folder-delete",ee),aY={"resource-folder-create-folder":{id:"resource-folder-create-folder",label:"Create Folder",executeName:"onCreateFolder"},"resource-folder-create-resource":{id:"resource-folder-create-resource",label:"Create Resource",executeName:"onCreateResource"},"resource-folder-edit-name":{id:"resource-folder-edit-name",label:"Edit Name",executeName:"onEnter"},"resource-folder-delete":{id:"resource-folder-delete",label:"Delete",executeName:"onDelete"}},aX="$-ROOT-$",aQ="resource-list-right-click-wrapper",aG={id:aX,type:aq.Folder,name:"root"},aJ="resourceFolderContextKey",a$="more-tools-class-name";var a0=((et=a0||{}).Normal="normal",et.Disabled="disabled",et),a1={textErrorColor:"rgba(var(--blockwise-error-color))",textWarningColor:"rgba(var(--blockwise-warning-color))",textSelectedColor:"rgba(6, 7, 9, 0.96)",textNormalColor:"rgba(6, 7, 9, 0.5)"},a2=(e,t)=>"".concat("resource-folder-command-prefix","_").concat(e,"_").concat(t),a4=(e,t)=>{var n=0,r=e;if(String(r.id)===String(t[n])){for(n+=1;nString(e.id)===String(t[n])),n+=1;return r}},a6=(e,t)=>{var n=null,r=null,o=(e,a)=>{if(!r){if(String(e.id)===String(t)){r={resource:e,parent:n,path:a};return}if(e.children){var s=n;n=e,e.children.forEach(e=>{o(e,[...a,e.id])}),n=s}return null}};return o(e,[e.id]),r},a5=e=>{var{resourceTree:t,from:n,to:r,options:o}=e,{collapsedMap:a}=o||{},s=[],l=!1,c=(e,t)=>{var o=String(e.id)===String(n)||String(e.id)===String(r);!l&&o?(l=!0,s.push(e.id)):l&&(s.push(e.id),o&&(l=!1)),e.children&&!(null==a?void 0:a[e.id])&&e.children.forEach(e=>{c(e,[...t,e.id])})};return c(t,[t.id]),s},a3=e=>{var t=(e,t)=>{var n,r,o,a,s=(null===(r=e.name)||void 0===r?void 0:null===(n=r.toLowerCase)||void 0===n?void 0:n.call(r))||"",l=(null===(a=t.name)||void 0===a?void 0:null===(o=a.toLowerCase)||void 0===o?void 0:o.call(a))||"";return sl?1:0},n=e.filter(e=>e.type===aq.Folder).sort((e,n)=>t(e,n)),r=e.filter(e=>e.type!==aq.Folder).sort((e,n)=>t(e,n));return n.concat(r)},a8=e=>{var{selectedId:t,resourceTree:n,collapsedMap:r,itemHeight:o}=e,a=-1,s=!1,l=e=>{if(!!e&&!s){if(a+=1,t===e.id){s=!0;return}e.children&&!r[e.id]&&e.children.forEach(e=>{l(e)})}};return l(n),(a-1)*o},a9=e=>{if(!e)return{};var t=(0,tv._)((0,tm._)({},aG),{children:e instanceof Array?e:[e]}),n={},r=(e,t)=>{if(!e)return{maxDeep:t.length-1};var o=t.length+("folder"===e.type?1:0),a="draft"===e.edit_status;return e.children&&e.children.forEach(e=>{var{maxDeep:n,editDraft:s}=r(e,[...t,e.id]);o=Math.max(o,n),a=!!(a||s)}),n[String(e.id)]=(0,tv._)((0,tm._)({},e),{path:t,maxDeep:o-t.length}),{maxDeep:o,editDraft:a}};return r(t,[t.id]),n},a7=(e,t,n)=>{var r=[],o=e=>(r.push(t[e.id]),e.children&&!n[e.id]&&e.children.forEach(e=>{o(e)}),null);return o(e),r},se=e=>{for(var{resourceList:t,parentId:n,type:r}=e,o=0,a=!1,s=[];o64?"Length exceeds":/^[A-Za-z]/.test(t)?/^[A-Za-z][0-9a-zA-Z_]*$/.test(t)?"":"only ASCII letters, digits, and _":"Must start with letter":"Empty Key"}var sn=n("825251"),sr=n("70131"),si="name_input_wrapper",so=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!e||!!(n>10)||(null===(t=e.dataset)||void 0===t?void 0:t[si])===void 0&&so(e.parentElement,n+1)},sa=e=>{var t,n,r,o,{resource:a,initValue:s,handleSave:l,handleChangeName:c,errorMsg:d,errorMsgRef:u,validateConfig:h,config:p}=e,[f,m]=(0,tq.useState)(s),v=(0,tq.useRef)(null),g=()=>{l((null==u?void 0:u.current)?s:void 0)},b=(0,tq.useRef)(!1);return(0,tq.useEffect)(()=>{setTimeout(()=>{b.current=!0},0);var e=e=>{so(e.target)&&g()};return window.addEventListener("mousedown",e,!0),()=>{window.removeEventListener("mousedown",e,!0)}},[]),(0,tK.jsxs)("div",{["data-".concat(si)]:!0,className:"base-item-name-input ".concat("mouseup-ignore-class-name"," ").concat(d?"base-item-name-input-error":""),style:{width:"100%"},children:[(0,tK.jsx)(aE.II,{className:(null==p?void 0:null===(t=p.input)||void 0===t?void 0:t.className)||"",style:(0,tm._)({padding:0},null==p?void 0:null===(n=p.input)||void 0===n?void 0:n.style),ref:v,placeholder:null==p?void 0:null===(r=p.input)||void 0===r?void 0:r.placeholder,onMouseDown:e=>{e.stopPropagation()},onKeyDown:e=>{e.stopPropagation(),"Escape"===e.code&&l("")},onEnterPress:e=>{if(!!b.current)e.stopPropagation(),e.preventDefault(),g()},onChange:e=>{m(e),c(e)},value:f,autoFocus:!0}),d?(null==h?void 0:h.errorMsgRender)?null==h?void 0:null===(o=h.errorMsgRender)||void 0===o?void 0:o.call(h,d,a):(0,tK.jsx)("div",{style:(null==h?void 0:h.errorMsgStyle)||{},className:"base-item-name-input-error-msg-absolute ".concat(null==h?void 0:h.errorMsgClassName),children:d}):null]})},ss=n("873183"),sl=e=>{var{resource:t,contextMenuCallback:n,resourceTreeWrapperRef:r,renderMoreSuffix:o}=e,a=e=>{e.currentTarget=r.current,n(e,[t])},s=(0,tK.jsx)(aE.zx,(0,tv._)((0,tm._)({"data-testid":"agent-ide.resource-item.".concat(t.type,".").concat(t.name,".more-tools")},"object"==typeof o&&(null==o?void 0:o.extraProps)?null==o?void 0:o.extraProps:{}),{className:"base-item-more-hover-display-class ".concat(a$," base-item-more-btn ").concat("object"==typeof o&&o.className?o.className:""),style:"object"==typeof o&&o.style?o.style:{},icon:(0,tK.jsx)(ss.NsR,{}),theme:"borderless",size:"small",onMouseUp:a}));if("object"==typeof o&&o.render)return o.render({onActive:a,baseBtn:s,resource:t});if("object"==typeof o&&o.tooltip)return"string"==typeof o.tooltip?(0,tK.jsx)(aE.u,{content:o.tooltip,children:s}):(0,tK.jsx)(aE.u,(0,tv._)((0,tm._)({},o.tooltip),{children:s}));return s},{Text:sc}=aE.ZT,sd=(0,tq.memo)(e=>{var{name:t,resource:n,searchConfig:r,isSelected:o,tooltipSpace:a,textRender:s}=e,l=(()=>{var e,t;if((null===(e=n.problem)||void 0===e?void 0:e.status)==="error")return a1.textErrorColor;if((null===(t=n.problem)||void 0===t?void 0:t.status)==="warning")return a1.textWarningColor;if(o)return a1.textSelectedColor;return a1.textNormalColor})();return(0,tK.jsx)("span",{style:{flex:1,display:"flex",height:"100%",alignItems:"center",justifyContent:"space-between",overflow:"hidden",fontSize:12},children:(0,tK.jsx)(sc,{style:{flex:1},ellipsis:{showTooltip:{opts:{content:"".concat(t),style:{wordBreak:"break-all"},position:"right",spacing:8+(a||0)}}},children:s?s({resource:n,isSelected:o}):(0,tK.jsx)("span",{style:{color:l},children:(0,tK.jsx)(aE.y$,{sourceString:t,searchWords:[(null==r?void 0:r.searchKey)||""],highlightStyle:(0,tv._)((0,tm._)({},null==r?void 0:r.highlightStyle),{backgroundColor:"transparent",color:"var(--semi-color-primary)"})})})})})},(e,t)=>{var n,r;return e.name===t.name&&(null===(n=e.searchConfig)||void 0===n?void 0:n.searchKey)===(null===(r=t.searchConfig)||void 0===r?void 0:r.searchKey)&&e.resource===t.resource&&e.isSelected===t.isSelected&&!0}),su=e=>{var{resource:t,path:n,icon:r,isSelected:o,isTempSelected:a,isInEdit:s,searchConfig:l,suffixRender:c,config:d,renderMoreSuffix:u,textRender:h,isDragging:p,useOptimismUI:f,isOptimismSaving:m,contextMenuCallback:v,resourceTreeWrapperRef:g}=e,b=(0,ij._)(e,["resource","path","icon","isSelected","isTempSelected","isInEdit","searchConfig","suffixRender","config","renderMoreSuffix","textRender","isDragging","useOptimismUI","isOptimismSaving","contextMenuCallback","resourceTreeWrapperRef"]),{name:y,status:_}=t,w=(0,tq.useMemo)(()=>m&&"object"==typeof f&&f.loadingRender?f.loadingRender():null,[m]),x=(0,tq.useMemo)(()=>{var e;return!s&&(null==c?void 0:null===(e=c.render)||void 0===e?void 0:e.call(c,{resource:t,isSelected:o,isTempSelected:a}))},[o,s,t,a]),S=(0,tq.useMemo)(()=>!s&&u?(0,tK.jsx)(sl,{resource:t,contextMenuCallback:v,resourceTreeWrapperRef:g,renderMoreSuffix:u}):null,[s,t,u]);return(0,tK.jsxs)("div",{"data-testid":"agent-ide.resource-item.".concat(t.type,".").concat(t.name),className:"base-item",style:(0,tm._)({justifyContent:"space-between",height:(null==d?void 0:d.itemHeight)||24,borderRadius:4,paddingLeft:(n.length-1)*((null==d?void 0:d.tabSize)||8)-4},_===a0.Disabled?{fontStyle:"italic",filter:"opacity(0.5)",cursor:"not-allowed",textDecoration:"line-through"}:{}),children:[(0,tK.jsxs)("div",{style:{display:"flex",overflow:s?"visible":"hidden",width:"100%"},children:[r?(0,tK.jsx)("span",{className:"base-item-icon",style:{color:"rgba(6, 7, 9, 0.96)"},children:r}):null,s?(0,tK.jsx)(sa,{resource:t,initValue:y,handleSave:b.handleSave,handleChangeName:b.handleChangeName,errorMsg:b.errorMsg,errorMsgRef:b.errorMsgRef,validateConfig:b.validateConfig,config:d}):(0,tK.jsx)(sd,{isSelected:o,resource:t,name:y,searchConfig:l,tooltipSpace:((null==c?void 0:c.width)||0)+(u?26:0),textRender:h})]}),w,x,S]},t.id)},sh=e=>{var{resource:t,path:n,style:r}=e,o=(0,ij._)(e,["resource","path","style"]),{id:a}=t,{iconRender:s,isSelected:l,isTempSelected:c,isExpand:d,draggingError:u,isDragging:h}=o,p=1===n.length;return(0,tK.jsx)(tK.Fragment,{children:(0,tK.jsx)("div",{style:(0,tv._)((0,tm._)({},r||{}),{cursor:u?"not-allowed":h?"grabbing":"default"}),children:!p&&(0,tK.jsx)(su,(0,tm._)({resource:t,path:n,icon:s?s({resource:t,isSelected:l,isTempSelected:c,isExpand:d}):void 0},o))},"folder-".concat(a))})},sp=e=>{var{resource:t,path:n}=e,r=(0,ij._)(e,["resource","path"]),{isDragging:o,draggingError:a,isSelected:s,isTempSelected:l,iconRender:c}=r;return(0,tK.jsx)("div",{style:{cursor:a?"not-allowed":o?"grabbing":"pointer"},children:(0,tK.jsx)(su,(0,tm._)({resource:t,path:n,icon:(null==t?void 0:t.type)?null==c?void 0:c({resource:t,isSelected:s,isTempSelected:l}):void 0},r))},"file-".concat(t.id))},sf=e=>{var t=(0,sn._)({},(0,sr._)(e)),{resource:n,path:r}=t,o=n.type===aq.Folder?sh:sp;return o?(0,tK.jsx)(o,(0,tv._)((0,tm._)({},t),{path:[...r,n.id]}),"base-render-".concat(n.id)):(0,tK.jsx)(tK.Fragment,{})},sm=(e,t)=>{var[n,r]=(0,tq.useState)(e),o=(0,tq.useRef)(e);return[o,e=>{o.current=e,r(e),null==t||t(e)},n]},sv=e=>{var{selected:t,resourceMap:n,collapsedMapRef:r,setCollapsed:o,tempSelectedMapRef:a,setTempSelectedMap:s,scrollInView:l,updateContext:c}=e,d=(0,tq.useRef)(t||"");return(0,tq.useEffect)(()=>{var e,u;if(!t){s({});return}d.current=t,c({currentSelectedId:t}),((null===(e=n.current[t])||void 0===e?void 0:e.path)||[]).forEach(e=>{delete r.current[e]}),o((0,tm._)({},r.current)),a.current={},(null===(u=n.current)||void 0===u?void 0:u[t])&&(a.current={[t]:n.current[t]}),s(a.current),setTimeout(()=>{l(t)},16)},[t]),d},sg=e=>e.map(e=>"type"in e?e:aY[e.id]?(0,tv._)((0,tm._)({},aY[e.id],e),{id:e.id}):(0,tv._)((0,tm._)({},e),{id:e.id})),sb=new Set,sy="resource-folder-separator-key",s_=e=>{var{tempSelectedMapRef:t,contextMenuHandler:n,registerCommand:r,id:o,contextMenuDisabled:a,onContextMenuVisibleChange:s}=e,l=nF(i5),c=(0,tq.useRef)(0),d=(0,tq.useRef)(0),u=(0,tq.useRef)(!1),h=e=>{u.current!==e&&(u.current=e,null==s||s(u.current))},p=()=>{l.clearMenuItems([...sb.keys(),...Object.keys(aY),...Array(c.current).fill(null).map(e=>e=>e===sy)].filter(Boolean)),c.current=0,d.current=0},f=()=>{var e,t,n;p(),null==l||null===(n=l.contextMenu)||void 0===n||null===(t=n.menu)||void 0===t||null===(e=t.close)||void 0===e||e.call(t),null==h||h(!1)};return(0,tq.useEffect)(()=>{var e,t,n,r;return null==l||null===(r=l.contextMenu)||void 0===r||null===(n=r.menu)||void 0===n||null===(t=n.aboutToClose)||void 0===t||null===(e=t.connect)||void 0===e||e.call(t,()=>{u.current&&(null==h||h(!1))}),()=>{f()}},[]),{contextMenuCallback:(e,s)=>{var u=sg(n?n(s||Object.values(t.current)):[]);return r(u),p(),u.forEach(e=>{if("type"in e){c.current=c.current+1,d.current=d.current+1,l.addMenuItem({command:sy,type:"separator",selector:".".concat(a2(aQ,o))});return}if(!!e.id)!sb.has(e.id)&&sb.add(e.id),!a&&(d.current=d.current+1,l.addMenuItem({command:e.id,selector:".".concat(a2(aQ,o)),args:e,tooltip:e.tooltip}))}),!a&&d.current>0&&(l.open(e),setTimeout(()=>{null==h||h(!0)},0)),()=>{f()}},closeContextMenu:f}},sw=e=>{var{isFocus:t,id:n,updateContext:r,clearContext:o,selectedIdRef:a,tempSelectedMapRef:s}=e,l=(0,tq.useRef)({}),c=nF(eX.Ho),d=(0,tq.useRef)({onEnter:()=>{var e,t;null===(e=(t=l.current)[aZ.EditName])||void 0===e||e.call(t)},onDelete:()=>{var e,t;null===(e=(t=l.current)[aZ.Delete])||void 0===e||e.call(t)},onCreateFolder:()=>{var e,t;null===(e=(t=l.current)[aZ.CreateFolder])||void 0===e||e.call(t)},onCreateResource:()=>{var e,t;null===(e=(t=l.current)[aZ.CreateResource])||void 0===e||e.call(t)}});return(0,tq.useEffect)(()=>{t?r((0,tv._)((0,tm._)({},d.current),{currentSelectedId:a.current,tempSelectedMap:s.current,id:n})):o()},[t]),{registerEvent:(e,t)=>{l.current[e]=t},registerCommand:e=>{e.forEach(e=>{if(!("type"in e))aY[e.id]?(e.label||e.shortLabel)&&c.updateCommand(e.id,(0,tm._)({},e.label?{label:e.label}:{},e.shortLabel?{shortLabel:e.shortLabel}:{})):e.execute&&(c.getCommand(e.id)&&c.unregisterCommand(e.id),c.registerCommand({id:e.id,label:e.label,shortLabel:e.label},{execute:()=>{var t;null===(t=e.execute)||void 0===t||t.call(e)},isEnabled:e=>!e.disabled,isVisible:e=>!e.isHidden}))})}}},sx=e=>{var{enable:t,onChange:n=aK.Z,onDrag:r=aK.Z,onChangeName:o=aK.Z,onCreate:a=aK.Z,onDelete:s=aK.Z,onRevertDelete:l=aK.Z,changeResourceTree:c,scrollInView:d,resourceTreeRef:u,resourceMap:h}=e,[p,f]=(0,tq.useState)({}),m=e=>{var t=e instanceof Array?e:[e];f((0,tm._)({},p,t.reduce((e,t)=>(0,tm._)({[t]:!0},e),{})))},v={optimismSavingMap:p,clearOptimismSavingMap:()=>{f({})}};return t?(0,tm._)({handleDrag:e=>{var t,o,{toId:a,resourceList:s}=e;if(!!a&&!!s){s.forEach(e=>{var t=a4(u.current,e.path.slice(0,e.path.length-1));(null==t?void 0:t.children)&&(t.children=t.children.filter(t=>t.id!==e.id))});var l=null===(t=a6(u.current,a))||void 0===t?void 0:t.resource;l&&(l.children=a3([...l.children||[],...s])),m(s.map(e=>e.id)),c(u.current),null==r||r(e),null==n||n((null===(o=u.current)||void 0===o?void 0:o.children)||[])}},handleChangeName:e=>{var t,r=a4(u.current,e.path||[]);if(!!r)r.name=e.name,m(r.id),c(u.current),null==o||o(e),null==n||n((null===(t=u.current)||void 0===t?void 0:t.children)||[])},handleCreate:e=>{var t,{path:r,type:o,name:s}=e,l=a4(u.current,r);if(!!l){var p="".concat("resource-folder-optimism-id-").concat(Number(new Date)),f={id:p,type:o,name:s};m(p),l.children=a3([...l.children||[],f]),c(u.current),a(e),h.current[p]=f,null==d||d(p),null==n||n((null===(t=u.current)||void 0===t?void 0:t.children)||[])}},handleDelete:e=>{s(e)},handleRevertDelete:e=>{var t;e.forEach(e=>{var t=a4(u.current,e.path||[]);t&&(t.status="normal")}),c(u.current),null==l||l(e),null==n||n((null===(t=u.current)||void 0===t?void 0:t.children)||[])}},v):(0,tm._)({handleDrag:r,handleChangeName:o,handleCreate:a,handleDelete:s,handleRevertDelete:l},v)},sS="resource_folder_key",sk="resource_folder_drag_and_drop_stop_tag",sC="resource_folder_drag_and_drop_id",sj="click_tool_bar",sE="click_outside",sT="click_context_menu",sI=(e,t)=>e.x>t.x&&e.xt.y&&e.y{var{e:t,wrapperElm:n,uniqId:r}=e,{pageX:o,pageY:a}=t,{x:s,y:l,width:c,height:d}=n.getBoundingClientRect();return sI({x:o,y:a},{x:s,y:l,width:c,height:d})&&!sI({x:o,y:a},{x:s+8,y:l+8,width:c-16,height:d-16})?aG:sM(t.target,r)},sM=(e,t,n)=>{var r,o,a,s,l,c={};if(n&&(null==e?void 0:null===(o=e.classList)||void 0===o?void 0:null===(r=o.contains)||void 0===r?void 0:r.call(o,n))&&(c.customTag=n),!e)return sE;if((null===(a=e.dataset)||void 0===a?void 0:a[sC])!==void 0&&(null===(s=e.dataset)||void 0===s?void 0:s[sS])===t)return(0,tm._)({id:e.dataset[sC]},c);if((null===(l=e.dataset)||void 0===l?void 0:l[sk])&&e.dataset[sS]===t)return(0,tm._)({id:aX},c);if(e.classList.contains("resource_folder_tool_bar_class_name"))return sj;var d=sM(e.parentElement,t,n);return"object"==typeof d&&null!==d?(0,tm._)({},d,c):d},sR=e=>{var t;if(!e)return"";if("folder"===e.type)return String(e.id);return String(null===(t=e.path)||void 0===t?void 0:t[e.path.length-2])},sD=(e,t)=>!!(Math.abs(t.x-e.x)>10||Math.abs(t.y-e.y)>10)||!1,sA=(e,t,n)=>{var{name:r,path:o,id:a}=t,s=e.filter(e=>{var t=e.path||[];return t[t.length-2]===a});if(s.length)return"Can't move ".concat(s.map(e=>e.name).join(", ")," into ").concat(r);var l=e.filter(e=>(o||[]).includes(String(e.id)));if(l.length)return"Can't move ".concat(l.map(e=>e.name).join(", ")," into ").concat(r);var c=e.reduce((e,t)=>Math.max(e,((null==t?void 0:t.maxDeep)||0)+1),0);return(t.path||[]).length-1+c>((null==n?void 0:n.maxDeep)||5)?"Can't move into ".concat(r,". MaxDeep is ").concat((null==n?void 0:n.maxDeep)||5):""};var sN=((en=sN||{}).MouseDown="mouseDown",en.MouseDownInDiv="mouseDownInDiv",en.MouseUpInDiv="mouseUpInDiv",en.MouseUp="mouseUp",en.MouseMove="mouseMove",en.KeyDown="keyDown",en),sL=()=>{var e=(0,tq.useRef)([]),t=(0,tq.useRef)([]),n=(0,tq.useRef)([]),r=(0,tq.useRef)([]),o=(0,tq.useRef)([]),a=(0,tq.useRef)([]),s=t=>{e.current.forEach(e=>{e(t)})},l=e=>{t.current.forEach(t=>{t(e)})},c=e=>{n.current.forEach(t=>{t(e)})},d=e=>{r.current.forEach(t=>{t(e)})},u=e=>{a.current.forEach(t=>{t(e)})},h=e=>{o.current.forEach(t=>{t(e)})};return(0,tq.useEffect)(()=>(window.addEventListener("mousedown",s),window.addEventListener("mouseup",d),window.addEventListener("keydown",u),window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousedown",s),window.removeEventListener("mouseup",d),window.removeEventListener("keydown",u),window.removeEventListener("mousemove",h)}),[]),{addEventListener:(s,l)=>{"keyDown"===s?a.current.push(l):"mouseDownInDiv"===s?t.current.push(l):"mouseUpInDiv"===s?n.current.push(l):"mouseDown"===s?e.current.push(l):"mouseUp"===s?r.current.push(l):"mouseMove"===s&&o.current.push(l)},customEventBox:e=>{var{children:t}=e;return(0,tK.jsx)("div",{className:"resource-list-custom-event-wrapper",onMouseDownCapture:l,onMouseUp:c,children:t})},onMouseDownInDiv:l,onMouseUpInDiv:c}},sz=e=>{var t,n,r,{iconRender:o,selectedMap:a,addEventListener:s,config:l}=e,[c,d]=(0,tq.useState)(!1),u=(0,tq.useRef)(!1),[h,p]=(0,tq.useState)(null),f=e=>{u.current&&p({x:e.clientX,y:e.clientY})};(0,tq.useEffect)(()=>{s(sN.MouseMove,f)},[]);var m=!h||(null==l?void 0:null===(t=l.dragUi)||void 0===t?void 0:t.disable)?(0,tK.jsx)(tK.Fragment,{}):(0,tK.jsx)("div",{style:(0,tm._)({position:"absolute",zIndex:99999,top:5,left:5,display:c&&(null==h?void 0:h.x)?"block":"none",transform:"translate(".concat((null==h?void 0:h.x)||0,"px, ").concat((null==h?void 0:h.y)||0,"px)"),userSelect:"none",pointerEvents:"none",backgroundColor:"rgba(6, 7, 9, 0.08)",borderRadius:6,padding:"2px 4px",minWidth:20,minHeight:20},(null==l?void 0:null===(n=l.dragUi)||void 0===n?void 0:n.wrapperStyle)||{}),className:(null==l?void 0:null===(r=l.dragUi)||void 0===r?void 0:r.wrapperClassName)||"",children:Object.values(a).length>1?(0,tK.jsx)(tK.Fragment,{children:Object.values(a).length}):Object.values(a).map(e=>(0,tK.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(null==e?void 0:e.type)?(0,tK.jsx)("span",{style:{marginRight:4},children:null==o?void 0:o({resource:e})}):(0,tK.jsx)(tK.Fragment,{}),(0,tK.jsx)("span",{children:e.name})]},e.name))});return{handleDrag:e=>{u.current=e,d(e),p(null),e?document.body.style.cursor="grabbing":document.body.style.cursor=""},isDragging:c,isDraggingRef:u,dragPreview:m}},sO=e=>{var{draggable:t,uniqId:n,updateId:r,setTempSelectedMap:o,collapsedMapRef:a,setCollapsedMap:s,resourceTreeRef:l,onDrag:c,disabled:d,resourceMap:u,addEventListener:h,selectedIdRef:p,onSelected:f,tempSelectedMapRef:m,resourceTreeWrapperRef:v,iconRender:g,config:b}=e,y=(0,tq.useRef)(null),[_,w]=(0,tq.useState)(!1),x=(0,tq.useRef)(!1),S=nF(oi),[k,C]=(0,tq.useState)(""),j=(0,tq.useRef)(null),{isDragging:E,isDraggingRef:T,handleDrag:I,dragPreview:P}=sz({iconRender:g,selectedMap:m.current,addEventListener:h,config:b}),M=e=>{if(!(null==b?void 0:b.resourceUriHandler))return;var t,n=Object.values(m.current).filter(e=>e.type!==aq.Folder).map(e=>{var t;return null===(t=b.resourceUriHandler)||void 0===t?void 0:t.call(b,e)}).filter(Boolean);if(!!n.length)null==S||null===(t=S.startDrag)||void 0===t||t.call(S,{uris:n,position:{clientX:e.clientX,clientY:e.clientY},callback:e=>{},backdropTransform:{clientX:e=>{var t;return Math.max(e,((null===(t=v.current)||void 0===t?void 0:t.clientWidth)||0)+100)}}})},R=e=>{t&&(M(e),C(""),I(!0))},D=()=>{C(""),I(!1)},A=e=>{var t=Object.values(e);1===t.length?j.current=t[0]:0===t.length&&(j.current=null),m.current=e,o(e)},[N,L]=(0,tq.useState)(null),z=(0,tq.useRef)(null),[O,B]=(0,tq.useState)({});(0,tq.useEffect)(()=>{if(null==N?void 0:N.id){var e=sR(N);e!==z.current&&(B((u.current[e]?a7(u.current[e],u.current,a.current):[]).reduce((e,t,n)=>(0,tv._)((0,tm._)({},e),{[t.id]:(0,tm._)({},t)}),{})),z.current=e)}else z.current=null,B({})},[null==N?void 0:N.id]);var W=()=>{r(),w(!0),x.current=!0},F=()=>{A({}),w(!1),x.current=!1},H=()=>{var e=Object.values(m.current).filter(e=>e.id!==aX);return e=e.filter(e=>{var{type:t,path:n}=u.current[e.id];if(t!==aq.Folder){var r=n||[];return!(r||[]).slice(0,r.length-1).some(e=>e!==aX&&m.current[e])}return!0})},U=e=>{if(null==d?void 0:d.current)return;var t=sM(e.target,n);if(!!t){if(W(),"object"==typeof t&&0===e.button&&(y.current={x:e.clientX,y:e.clientY}),"object"==typeof t&&!e.shiftKey&&!e.metaKey){var r,o,a=null;(null==(a=t.id===aX?aG:(null==u?void 0:null===(o=u.current)||void 0===o?void 0:o[String(null==t?void 0:t.id)])||{})?void 0:a.id)&&!(null===(r=m.current)||void 0===r?void 0:r[a.id])&&A({[a.id]:a})}}},V=e=>{if((null==d?!void 0:!d.current)&&!!x.current){var t=sM(e.target,n);if(D(),!t||t===sE){F();return}if(t===sT)return}},K=e=>{if((null==d?!void 0:!d.current)&&!T.current){var t=sM(e.target,n,a$);if("object"==typeof t&&null!==t){var r=null;if(r=t.id===aX?aG:(null==u?void 0:null===(c=u.current)||void 0===c?void 0:c[String(null==t?void 0:t.id)])||{},t.customTag===a$){A({[r.id]:r});return}if(e.ctrlKey||2===e.button&&(null==r?void 0:r.id)&&(null===(o=m.current)||void 0===o?void 0:o[r.id]))return;if(e.shiftKey){var o,c,h,v=(null===(h=j.current)||void 0===h?void 0:h.id)||(null==p?void 0:p.current);if(!v||!(null==r?void 0:r.id)||v===(null==r?void 0:r.id))return;var g=a5({resourceTree:l.current,from:v,to:r.id,options:{collapsedMap:a.current}});(g=(g||[]).reduce((e,t)=>{var n="object"==typeof t?String(t.id):String(t);return(0,tv._)((0,tm._)({},e),{[n]:null==u?void 0:u.current[n]})},{}))[aX]&&delete g[aX],A(g)}else if(e.metaKey){var b=(0,tm._)({},m.current);(null==r?void 0:r.id)&&(b[r.id]?delete b[r.id]:b=(0,tv._)((0,tm._)({},b),{[r.id]:r})),b[aX]&&delete b[aX],A(b)}else(null==r?void 0:r.type)&&"folder"!==r.type&&(null==f||f(r.id,r)),(null==r?void 0:r.id)&&A({[r.id]:r})}(!T.current||!Object.keys(m.current).length)&&"object"==typeof t&&null!==t&&t.id!==aX&&0===e.button&&!e.shiftKey&&!e.metaKey&&s(t.id,!a.current[t.id])}},q=e=>{if(null==d?!void 0:!d.current){if(T.current&&Object.keys(m.current).length&&v.current){var t=sP({e,wrapperElm:v.current,uniqId:n});if(t===sT||!t)return;if("object"==typeof t){var r=H(),o=sR(u.current[t.id]),a=sA(r,u.current[o],b);a?null==c||c({errorMsg:a}):(null==c||c({resourceList:r,toId:o}),s(o,!1))}D()}y.current=null,L(null)}};return(0,tq.useEffect)(()=>{h(sN.MouseDown,V),h(sN.MouseDownInDiv,U),h(sN.MouseUpInDiv,K),h(sN.MouseUp,q)},[]),{context:{isDragging:E,draggingError:k,isFocus:_,dataHandler:e=>({["data-".concat(sC)]:e.id,["data-".concat(sS)]:n}),tempSelectedMapRef:m,currentHoverItem:N,highlightItemMap:O},isFocusRef:x,onMouseMove:e=>{if((null==d?void 0:d.current)||!y.current)return;var t=Object.values(m.current);if(0===t.length||1===t.length&&t[0].id===aX||!(T.current||sD(y.current,{x:e.clientX,y:e.clientY})))return;if(!T.current){R(e);return}if(!v.current)return;var r=sP({e,wrapperElm:v.current,uniqId:n});if(r!==sT){if(!r||r===sE||r===sj){L(null);return}if("object"==typeof r&&(null==r?void 0:r.id)!==(null==N?void 0:N.id)){if((null==r?void 0:r.id)===aX)L(aG);else{L(u.current[String(null==r?void 0:r.id)]);var o=sR(u.current[r.id]);C(sA(H(),u.current[o],b))}}}},dragPreview:P,handleFocus:W,handleBlur:F}},sB=e=>{var{resourceTreeRef:t,collapsedMapRef:n,resourceMap:r,config:o}=e,a=(0,tq.useRef)(null),s=(0,tq.useRef)(!0);return{scrollInView:e=>{if(!a.current||!s.current||!e||!t.current||!(null==r?void 0:null===(l=r.current)||void 0===l?void 0:l[e]))return;var l,c=a8({selectedId:e,resourceTree:t.current,collapsedMap:n.current,itemHeight:(null==o?void 0:o.itemHeight)||24});if(!(c>a.current.scrollTop)||!(c{s.current=!1,setTimeout(()=>{s.current=!0},e||300)}}};class sW{registerPromiseFn(e){return this.mainFunction=e,this}registerCallbackFb(e){return this.callbacks.push(e),this}excute(e){var t=this;return(0,e3._)(function*(){if(!!t.mainFunction){t.lastVersion+=1;var n=t.lastVersion,r=yield t.mainFunction(e);t.lastVersion===n&&t.callbacks.forEach(e=>e(r))}})()}dispose(){this.callbacks=[]}constructor(){this.callbacks=[],this.lastVersion=0}}var sF=e=>{var{validator:t,callback:n}=e,r=(0,tq.useRef)(new sW);return(0,tq.useEffect)(()=>(r.current.registerPromiseFn(t).registerCallbackFb(n),()=>{var e,t;null===(t=r.current)||void 0===t||null===(e=t.dispose)||void 0===e||e.call(t)}),[]),{validateAndUpdate:e=>{var t;null===(t=r.current)||void 0===t||t.excute(e)}}},sH=e=>{var t,{folderEnable:n,defaultResourceType:r,tempSelectedMapRef:o,registerEvent:a,setCollapsedMap:s,onChangeName:l,onCreate:c,resourceMap:d,selectedIdRef:u,resourceTreeRef:h,onDelete:p,validateConfig:f,config:m,resourceList:v}=e,[g,b]=(0,tq.useState)(""),y=(0,tq.useRef)(""),[_,w]=(0,tq.useState)(!1),x=(0,tq.useRef)(!1),S=e=>{x.current=e,w(e)},[k,C]=(0,tq.useState)(null),j=(0,tq.useRef)(null),[E,T]=(0,tq.useState)(null),I=(0,tq.useRef)(null),P=(0,tq.useRef)(null),M=(0,tq.useRef)(null),R=()=>{C(null),j.current=null,T(null),I.current=null,S(!1),b(""),y.current="",P.current=null,M.current=null},D=e=>{var t=d.current[e];t&&t.status!==a0.Disabled&&(C(t),j.current=t,S(!0),P.current=t.name,M.current=t.name)},A=()=>{var e=o.current;1===Object.keys(e).filter(e=>e!==aX).length&&D(Object.values(e)[0].id)},{validateAndUpdate:N}=sF({validator:(null==f?void 0:f.customValidator)||st,callback:e=>{if(e){b(e),y.current=e;return}b(""),y.current=""}});var L=(t=(0,e3._)(function*(e){var t=e||r;if(!!t&&(!!n||t!==aq.Folder)){var a=Object.values(o.current||{})[0];if(!a&&(a=d.current[u.current]),!a&&(a=d.current[aX]),"folder"!==a.type&&(null==a?void 0:a.path)&&(a=d.current[a.path[a.path.length-2]]),((null==a?void 0:null===(l=a.path)||void 0===l?void 0:l.length)||0)+(t===aq.Folder?1:0)>((null==m?void 0:m.maxDeep)||5)){aE.FN.warning("Can't create ".concat(t,". MaxDeep is 5"));return}if(a){var l,c,h,p=a.id;"folder"!==a.type&&(p=(null===(h=a.path)||void 0===h?void 0:h[(null===(c=a.path)||void 0===c?void 0:c.length)-2])||""),P.current="",M.current="",s(p,!1),yield new Promise(e=>{setTimeout(()=>{e(null)},0)}),j.current={id:"-1",name:"",type:t},C(j.current),I.current={parentId:p,type:t};var f=se({resourceList:v.current,parentId:p,type:t});T({parentId:p,type:t,index:f}),S(!0)}}}),function(e){return t.apply(this,arguments)});return(0,tq.useEffect)(()=>{a(aZ.EditName,()=>{!j.current&&A()}),a(aZ.Delete,()=>{var e=Object.values(o.current).filter(e=>e.id!==aX);e.length>0&&(null==p||p(e))}),a(aZ.CreateFolder,()=>{L(aq.Folder)}),a(aZ.CreateResource,e=>{L(e)})},[]),{context:{isInEditMode:_,editResourceId:null==k?void 0:k.id,createResourceInfo:E,handleChangeName:e=>{if(M.current=e,null==I?void 0:I.current){var t,n;N({type:"create",label:e||"",parentPath:(null===(t=d.current[null==I?void 0:null===(n=I.current)||void 0===n?void 0:n.parentId])||void 0===t?void 0:t.path)||[],resourceTree:h.current,id:"-1"})}else if(null==j?void 0:j.current){var r,o=(null==j?void 0:null===(r=j.current)||void 0===r?void 0:r.path)||[];N({type:"edit",label:e||"",parentPath:o.slice(0,(null==o?void 0:o.length)-1)||[],resourceTree:h.current,id:j.current.id})}},errorMsg:g,errorMsgRef:y,handleSave:e=>{var t,n,r,o,a,s,u=void 0===e?M.current||"":e;j.current&&("-1"===j.current.id?""!==u&&(null===(t=I.current)||void 0===t?void 0:t.parentId)&&(null==c||c({parentId:null===(n=I.current)||void 0===n?void 0:n.parentId,name:u,type:null===(r=I.current)||void 0===r?void 0:r.type,path:(null===(s=d.current)||void 0===s?void 0:null===(o=s[null===(a=I.current)||void 0===a?void 0:a.parentId])||void 0===o?void 0:o.path)||[]})):""!==u&&u!==P.current&&j.current.id&&(null==l||l({id:j.current.id,name:u,type:j.current.type,path:d.current[j.current.id].path,resource:d.current[j.current.id]}))),R()}},onCreateResource:L,isInEditModeRef:x,handleRenderList:(e,t)=>{if(!t)return e;var{index:n}=t;return[...e.slice(0,n),"-1",...e.slice(n,e.length)]},handleRename:D}},sU=e=>{var t=(0,tq.useRef)({id:e}),n=nF(e5),r=e=>{n.setContext(aJ,e)},o=()=>n.getContext(aJ);return{updateContext:n=>{var a;(null===(a=o())||void 0===a?void 0:a.id)===e&&(t.current=(0,tm._)({},t.current,n),r(t.current))},clearContext:()=>{var r;(null===(r=o())||void 0===r?void 0:r.id)===e&&n.setContext(aJ,void 0),t.current={id:e}},updateId:()=>{r(t.current)}}},sV=e=>{var{_collapsedMap:t,_setCollapsedMap:n,resourceMap:r}=e,[o,a,s]=sm(t||{});(0,tq.useEffect)(()=>{t&&a(t)},[t]);var l=e=>{null==n||n(e),!t&&a(e)};return{handleCollapse:(e,t)=>{var n,a;(null===(a=r.current)||void 0===a?void 0:null===(n=a[e])||void 0===n?void 0:n.type)==="folder"&&l((0,tv._)((0,tm._)({},o.current),{[e]:t}))},collapsedMapRef:o,setCollapsed:l,collapsedState:s}},sK=n("307321"),sq={};sq.styleTagTransform=oC(),sq.setAttributes=ow(),sq.insert=oy().bind(null,"head"),sq.domAPI=og(),sq.insertStyleElement=oS(),om()(sK.Z,sq);var sZ=sK.Z&&sK.Z.locals?sK.Z.locals:void 0,sY=0,sX=(0,tq.forwardRef)((e,t)=>{var n,r,o,{id:a,resourceTree:s,resourceMap:l,selected:c,disabled:d,searchConfig:u,defaultResourceType:h,useOptimismUI:p=!1,style:f,collapsedMap:m,setCollapsedMap:v,validateConfig:g,onChange:b=aK.Z,onSelected:y=aK.Z,onDrag:_=aK.Z,onChangeName:w=aK.Z,onCreate:x=aK.Z,onDelete:S=aK.Z,iconRender:k,suffixRender:C,textRender:j,renderMoreSuffix:E=!1,contextMenuHandler:T,onContextMenuVisibleChange:I,contextMenuDisabled:P,config:M,powerBlackMap:R,empty:D}=e,A=(0,tq.useRef)(a||"".concat(sY++)),N=(0,tq.useRef)(null),{updateContext:L,clearContext:z,updateId:O}=sU(A.current),[B,W]=sm({},e=>{null==L||L({tempSelectedMap:e})}),F=(0,tq.useRef)(l||{}),H=e=>{F.current=e,B.current=Object.keys(B.current).reduce((e,t)=>F.current[t]?(0,tv._)((0,tm._)({},e),{[t]:F.current[t]}):e,{}),W(B.current)};(0,tq.useEffect)(()=>{H(l)},[l]);var{collapsedMapRef:U,handleCollapse:V,setCollapsed:K,collapsedState:q}=sV({_collapsedMap:m,_setCollapsedMap:v,resourceMap:F}),[Z,Y]=sm((0,tv._)((0,tm._)({},aG),{children:s instanceof Array?s:[s]}),e=>{Q(a7(e,F.current,U.current))}),[X,Q]=sm(a7(Z.current,F.current,U.current));(0,tq.useEffect)(()=>{Q(a7(Z.current,F.current,U.current))},[q]);var G=(0,tq.useRef)(!!d);(0,tq.useEffect)(()=>{G.current=!!d},[d]);var{scrollInView:J,scrollWrapper:$,tempDisableScroll:ee}=sB({resourceTreeRef:Z,collapsedMapRef:U,resourceMap:F,config:M}),{handleDrag:et,handleChangeName:en,handleCreate:er,handleDelete:ei,optimismSavingMap:eo,clearOptimismSavingMap:ea}=sx({enable:!!p,onDrag:_,onChangeName:w,onCreate:x,onDelete:S,changeResourceTree:e=>{Z.current=e,H(a9((null==e?void 0:e.children)||[])),Y(Z.current)},scrollInView:J,resourceTreeRef:Z,resourceMap:F,onChange:b});(0,tq.useEffect)(()=>{Z.current=(0,tv._)((0,tm._)({},aG),{children:s instanceof Array?s:[s]}),Y(Z.current),ea()},[s]);var es=sv({selected:c,resourceMap:F,collapsedMapRef:U,setCollapsed:K,tempSelectedMapRef:B,setTempSelectedMap:W,scrollInView:J,updateContext:L}),{addEventListener:el,onMouseDownInDiv:ec,onMouseUpInDiv:ed}=sL(),{onMouseMove:eu,context:eh,context:{isFocus:ep},isFocusRef:ef,dragPreview:em,handleFocus:ev,handleBlur:eg}=sO({draggable:!(null==R?void 0:R.dragAndDrop),uniqId:A.current,updateId:O,iconRender:k,resourceTreeWrapperRef:N,collapsedMapRef:U,tempSelectedMapRef:B,setTempSelectedMap:W,setCollapsedMap:V,resourceTreeRef:Z,selectedIdRef:es,onSelected:function(){for(var e=arguments.length,t=Array(e),n=0;n({focus:()=>{ev()},blur:()=>{eg()},createResource:e=>{if(!ex.current&&!!e)null==ew||ew(e)},renameResource:e=>{ek(e)},createFolder:()=>{if(!ex.current)null==ew||ew(aq.Folder)},expandAll:()=>{U.current={},K(U.current)},collapseAll:()=>{U.current=Object.keys(F.current).reduce((e,t)=>{var n,r;return t!==aX&&(null===(r=F.current)||void 0===r?void 0:null===(n=r[t])||void 0===n?void 0:n.type)==="folder"?(0,tv._)((0,tm._)({},e),{[t]:!0}):e},{}),K(U.current)},closeContextMenu:ej}));var eE={searchConfig:u,suffixRender:C,config:M,renderMoreSuffix:!P&&E,textRender:j,contextMenuCallback:eC,resourceTreeWrapperRef:N,iconRender:k,isDragging:eh.isDragging,draggingError:eh.draggingError,currentHoverItem:eh.currentHoverItem,validateConfig:g,errorMsg:e_.errorMsg,errorMsgRef:e_.errorMsgRef,editResourceId:e_.editResourceId,handleChangeName:e_.handleChangeName,handleSave:e_.handleSave,useOptimismUI:p},eT=(null==e_?void 0:e_.createResourceInfo)?(0,tK.jsx)("div",{children:(0,tK.jsx)(sf,(0,tm._)({resource:{id:"-1",name:"",type:null==e_?void 0:e_.createResourceInfo.type},path:[...(null===(o=F.current)||void 0===o?void 0:null===(r=o[null==e_?void 0:e_.createResourceInfo.parentId])||void 0===r?void 0:r.path)||[],"-1"],isInEdit:"-1"===e_.editResourceId},eE))},"-1"):null,eI=eS(X.current,null==e_?void 0:e_.createResourceInfo);return(0,tK.jsxs)(tK.Fragment,{children:[(0,tK.jsx)("div",{className:"resource-list-wrapper ".concat(sZ["resource-list-wrapper"]),ref:N,style:f||{},children:(0,tK.jsxs)("div",{["data-".concat(sk)]:!0,["data-".concat(sS)]:A.current,ref:$,className:"".concat(a2(aQ,A.current)," resource-list-drag-and-drop-wrapper resource-list-custom-event-wrapper resource-list-scroll-container"),onMouseDown:ec,onMouseUp:ed,onMouseMove:eu,onContextMenu:e=>{e.preventDefault()},onContextMenuCapture:eC,children:[eI.map((e,t)=>{if("-1"===e)return eT;if(e.id===aX)return null;if(!e)return(0,tK.jsx)(tK.Fragment,{});var n,r,o,a,s,l,d=String(e.id)===String(e_.editResourceId),u=String(c)===String(e.id),h=!!B.current[e.id],f=(null===(n=X.current[t-1])||void 0===n?void 0:n.id)!==aX&&!!B.current[null===(r=X.current[t-1])||void 0===r?void 0:r.id],m=!!B.current[null===(o=X.current[t+1])||void 0===o?void 0:o.id],v=!U.current[e.id],g=!(null==R?void 0:R.folder)&&!!eh.highlightItemMap[e.id],b=(null===(a=X.current[t-1])||void 0===a?void 0:a.id)!==aX&&!!eh.highlightItemMap[null===(s=X.current[t-1])||void 0===s?void 0:s.id],y=!!eh.highlightItemMap[null===(l=X.current[t+1])||void 0===l?void 0:l.id],_=[...g?[e.id!==aX?"dragging-hover-class":"",b||y?"":"base-radius-class-single",b?"":"base-radius-class-first",y?"":"base-radius-class-last"]:[],u?"item-is-selected":"",...h&&!g?["item-is-temp-selected",f||m?"":"base-radius-class-single",f?"":"base-radius-class-first",m?"":"base-radius-class-last"]:[],d?"item-is-in-edit":"",eh.isDragging||u?"":"base-item-hover-class"].join(" ");return(0,tK.jsx)("div",(0,tv._)((0,tm._)({className:"item-wrapper ".concat(_)},eh.dataHandler(e)),{children:(0,tK.jsx)(sf,(0,tm._)({resource:e,path:e.path||[],isSelected:u,isTempSelected:h,isInEdit:d,isExpand:v,isOptimismSaving:p&&eo[e.id]},eE))}),e.id)}),(0===(n=eI||[]).length||1===n.length&&"-1"!==n[0]&&n[0].id===aX)&&D?D:null,(0,tK.jsx)("div",{style:{padding:12}})]})},A.current),i_.createPortal(em,document.body)]})})},678473:function(e,t,n){"use strict";n.r(t),n.d(t,{ProjectIDE:()=>ns,IDELayout:()=>eh});var r,o,a,s,l=n("151064");n("327212");var c=n("157728"),d=n("455069");n("407694");var u=()=>null,h=()=>null,p=()=>(0,l.jsx)("div",{}),f=e=>null,m=n("149528"),v=n("562392"),g=n("873183"),b={match:/\/plugin\/.*/,area:m.px.MAIN_PANEL,renderContent(){var e=(0,m.jL)(()=>n.e("1794").then(n.bind(n,517362)));return(0,l.jsx)(e,{})},renderIcon:()=>(0,l.jsx)(g.QWX,{})},y={match:/\/knowledge\/.*/,area:m.px.MAIN_PANEL,renderContent(){var e=(0,m.jL)(()=>n.e("1546").then(n.bind(n,620410)));return(0,l.jsx)(e,{})},renderIcon:()=>(0,l.jsx)(g.Guk,{})},_={match:/\/variables\/?$/,area:m.px.MAIN_PANEL,renderContent(){var e=(0,m.jL)(()=>n.e("6809").then(n.bind(n,430474)));return(0,l.jsx)(e,{})},renderIcon:()=>(0,l.jsx)(g.pFl,{})},w={match:/\/database\/.*/,area:m.px.MAIN_PANEL,renderContent(){var e=(0,m.jL)(()=>n.e("3838").then(n.bind(n,119131)));return(0,l.jsx)(e,{})},renderIcon:()=>(0,l.jsx)(g.Dzy,{})},x=n("66860"),S=n("942185"),k=n("130001"),C=n("771531"),j=n("435946");class E{listen(){this.disposable.push(this.viewService.shell.onCurrentWidgetChange(e=>{this.toggleDefaultWidget(e),this.syncURL(e)}))}toggleDefaultWidget(e){if(null==e?void 0:e.uri){if("default"!==(null==e?void 0:e.uri).displayName){var t,n=this.widgetManager.getWidgetFromURI(m.AE);null==n||null===(t=n.dispose)||void 0===t||t.call(n)}}else this.viewService.disableFullScreenMode(),this.projectIDEServices.view.openDefault()}syncURL(e){if(e){var t=null==e?void 0:e.uri;if(!(0,m.fZ)(t,m.AE)){if(t){var n=(0,m.L8)(t);if(n){var r="/space/".concat(this.optionsService.spaceId,"/project-ide/").concat(this.optionsService.projectId).concat(n);t.query&&(r+="?".concat(t.query)),this.navigate(r)}}}}else this.navigate("/space/".concat(this.optionsService.spaceId,"/project-ide/").concat(this.optionsService.projectId))}diffPath(e){var{pathname:t,search:n}=window.location;return t+n!==e}navigate(e){if(!!this.diffPath(e))this.optionsService.navigate((0,m.PF)(e))}dispose(){this.disposable.dispose()}constructor(){this.disposable=new m.K4}}(0,k.gn)([(0,C.f)(m.s1),(0,k.w6)("design:type",void 0===m.s1?Object:m.s1)],E.prototype,"viewService",void 0),(0,k.gn)([(0,C.f)(m.fH),(0,k.w6)("design:type",void 0===m.fH?Object:m.fH)],E.prototype,"widgetManager",void 0),(0,k.gn)([(0,C.f)(m.k7),(0,k.w6)("design:type",void 0===m.k7?Object:m.k7)],E.prototype,"projectIDEServices",void 0),(0,k.gn)([(0,C.f)(m.IC),(0,k.w6)("design:type",void 0===m.IC?Object:m.IC)],E.prototype,"optionsService",void 0),E=(0,k.gn)([(0,j.b)()],E);var T=n("825955"),I=n("287487"),P=n("28260"),M=n("286518"),R=n("382534");class D{init(){this.updateProjectInfo().catch(()=>{this.errorService.toErrorPage()});this.initTaskList(),this.reportUserBehavior()}initTaskList(){var e=this;return(0,T._)(function*(){var t,{task_list:n}=(yield R.sD.DraftProjectInnerTaskList({project_id:e.optionsService.projectId})).data||{},r=null==n?void 0:null===(t=n[0])||void 0===t?void 0:t.task_id;if(r){var{task_detail:o}=yield R.Js.ResourceCopyDetail({task_id:r});e.modalService.onModalVisibleChangeEmitter.fire({type:m.w8.RESOURCE,scene:null==o?void 0:o.scene,resourceName:null==o?void 0:o.res_name}),e.modalService.doPolling(r)}})()}reportUserBehavior(){R.pr.ReportUserBehavior({space_id:this.optionsService.spaceId,behavior_type:M.YQ.Visit,resource_id:this.optionsService.projectId,resource_type:M.$L.Project})}wakeUpPlugin(){var e;R.Js.WakeupIdePlugin({space_id:this.optionsService.spaceId,project_id:this.optionsService.projectId,dev_id:null===(e=I.Z.getUserInfo())||void 0===e?void 0:e.user_id_str})}updateProjectInfo(){var e=this;return(0,T._)(function*(){var t,n,r,o,a,s,l,c,d,u,h,p,f,m=yield R.sD.GetDraftIntelligenceInfo({intelligence_id:e.optionsService.projectId,intelligence_type:P.jH.Project,version:e.optionsService.version||void 0});e.projectInfo={projectInfo:null===(t=m.data)||void 0===t?void 0:t.basic_info,publishInfo:null===(n=m.data)||void 0===n?void 0:n.publish_info,ownerInfo:null===(r=m.data)||void 0===r?void 0:r.owner_info},e.initialValue={space_id:null===(o=e.optionsService)||void 0===o?void 0:o.spaceId,project_id:null===(a=e.optionsService)||void 0===a?void 0:a.projectId,name:null===(l=e.projectInfo)||void 0===l?void 0:null===(s=l.projectInfo)||void 0===s?void 0:s.name,description:null===(d=e.projectInfo)||void 0===d?void 0:null===(c=d.projectInfo)||void 0===c?void 0:c.description,icon_uri:[{uid:(null===(h=e.projectInfo)||void 0===h?void 0:null===(u=h.projectInfo)||void 0===u?void 0:u.icon_uri)||"",url:(null===(f=e.projectInfo)||void 0===f?void 0:null===(p=f.projectInfo)||void 0===p?void 0:p.icon_url)||""}]},e.onProjectInfoUpdatedEmitter.fire()})()}constructor(){this.onProjectInfoUpdatedEmitter=new m.Q5,this.onProjectInfoUpdated=this.onProjectInfoUpdatedEmitter.event}}(0,k.gn)([(0,C.f)(m.IC),(0,k.w6)("design:type",void 0===m.IC?Object:m.IC)],D.prototype,"optionsService",void 0),(0,k.gn)([(0,C.f)(m.Z7),(0,k.w6)("design:type",void 0===m.Z7?Object:m.Z7)],D.prototype,"modalService",void 0),(0,k.gn)([(0,C.f)(m.T_),(0,k.w6)("design:type",void 0===m.T_?Object:m.T_)],D.prototype,"errorService",void 0),D=(0,k.gn)([(0,j.b)()],D);class A{open(){var{resourceType:e}=(0,m.hU)(window.location.pathname);if(e===m.sq.displayName)this.openDesign(),this.tryOpenDefault();else{var t,n,r,o=(0,m.qj)(window.location.pathname);!o||o.startsWith(m.AE.displayName)?(this.tryOpenDefault(),(null===(t=this.applicationShell.mainPanel.currentTitle)||void 0===t?void 0:t.owner)&&this.applicationShell.setCurrentWidget(null===(r=this.applicationShell.mainPanel)||void 0===r?void 0:null===(n=r.currentTitle)||void 0===n?void 0:n.owner)):this.projectIDEServices.view.open((0,m.W9)(o))}}listen(){var e="popstate";window.addEventListener(e,this.syncPopstate),this.disposable.push(m.JT.create(()=>window.removeEventListener(e,this.syncPopstate)))}openDevelop(e,t,n){this.projectIDEServices.view.open((0,m.Ym)(e,t,n))}openDesign(){this.projectIDEServices.view.openPanel("ui-builder")}tryOpenDefault(){var e,t,n,r,o;(null===(o=this.viewService.shell.mainPanel)||void 0===o?void 0:null===(r=o.tabBars)||void 0===r?void 0:null===(n=r.call(o))||void 0===n?void 0:null===(t=n.next)||void 0===t?void 0:null===(e=t.call(n))||void 0===e?void 0:e.done)&&this.projectIDEServices.view.openDefault()}dispose(){this.disposable.dispose()}constructor(){this.disposable=new m.K4,this.syncPopstate=()=>{this.open()}}}(0,k.gn)([(0,C.f)(m.k7),(0,k.w6)("design:type",void 0===m.k7?Object:m.k7)],A.prototype,"projectIDEServices",void 0),(0,k.gn)([(0,C.f)(m.s1),(0,k.w6)("design:type",void 0===m.s1?Object:m.s1)],A.prototype,"viewService",void 0),(0,k.gn)([(0,C.f)(m.Ew),(0,k.w6)("design:type",void 0===m.Ew?Object:m.Ew)],A.prototype,"applicationShell",void 0),A=(0,k.gn)([(0,j.b)()],A);var N=n("710705"),L=n("808549"),z=n("18174");let O=Symbol.for("Dexie"),B=globalThis[O]||(globalThis[O]=z);if(z.semVer!==B.semVer)throw Error(`Two different versions of Dexie loaded in the same app: ${z.semVer} and ${B.semVer}`);let{liveQuery:W,mergeRanges:F,rangesOverlap:H,RangeSet:U,cmp:V,Entity:K,PropModification:q,replacePrefix:Z,add:Y,remove:X}=B;var Q=e=>e.timestamp(!s&&(s=new B("CozProjectIDELayoutData")).version(1).stores({layout:"++id, spaceId, projectId, timestamp, data"}),s);var J=(r=(0,T._)(function*(e,t,n){var r=G(),o=yield r.layout.where({spaceId:e,projectId:t}).first();o?yield r.layout.update(o.id,(0,L._)({},n)):yield r.layout.add((0,L._)({spaceId:e,projectId:t},n))}),function(e,t,n){return r.apply(this,arguments)});var $=(o=(0,T._)(function*(e,t){var n=G(),r=yield n.layout.where({spaceId:e,projectId:t}).first();if(!!r){if(Q(r)){yield n.layout.where({id:r.id}).delete();return}return r}}),function(e,t){return o.apply(this,arguments)}),ee="coz-project-ide-layout-data",et=(e,t,n)=>{var r="".concat(ee,"-").concat(e,"-").concat(t);window.localStorage.setItem(r,JSON.stringify(n))},en=(e,t)=>{var n="".concat(ee,"-").concat(e,"-").concat(t),r=window.localStorage.getItem(n);if(!!r)try{var o=JSON.parse(r);if(Q(o)){window.localStorage.removeItem(n);return}return o}catch(e){console.error(e);return}},er=(e,t)=>{var n="".concat(ee,"-").concat(e,"-").concat(t);window.localStorage.removeItem(n)},ei=(e,t,n)=>{try{var r={data:JSON.stringify(n),timestamp:Number(Date.now()),version:3};et(e,t,r),J(e,t,r)}catch(e){console.error(e)}};var eo=(a=(0,T._)(function*(e,t){var n,r=yield $(e,t),o=en(e,t);if(o?!r||r.timestamp!!e.context;class es{get openFirstWorkflow(){return this._openFirstWorkflow}set openFirstWorkflow(e){this._openFirstWorkflow=e}init(){}storeLayout(){ei(this.optionsService.spaceId,this.optionsService.projectId,this.getLayoutData())}restoreLayout(){var e=this;return(0,T._)(function*(){if(yield e.addSidebarWidget(),e.enabled){var t=yield eo(e.optionsService.spaceId,e.optionsService.projectId);yield e.setLayoutData(t||{})}})()}storeWidget(){}restoreWidget(){}getLayoutData(){var e={},{primarySidebar:t,mainPanel:n}=this.applicationShell;e.primarySidebar={isHidden:!!(null==t?void 0:t.isHidden)};var r=n.saveLayout();return e.mainPanel=this.widgetsStringifyBFS(r),e}setLayoutData(e){var t=this;return(0,T._)(function*(){var{primarySidebar:n,mainPanel:r}=e||{};if(n&&n.isHidden?t.applicationShell.primarySidebar.hide():t.applicationShell.primarySidebar.show(),r){var o,a,s=yield t.widgetsParseBFS(r),{main:l}=s||{};!(null==l?void 0:null===(o=l.widgets)||void 0===o?void 0:o.length)&&!(null==l?void 0:null===(a=l.children)||void 0===a?void 0:a.length)&&(t._openFirstWorkflow=!0),t.applicationShell.mainPanel.restoreLayout(s),t.applicationShell.mainPanel.initWidgets()}})()}addSidebarWidget(){var e=this;return(0,T._)(function*(){var t=yield e.widgetParse({uri:m.tN.toString()});e.applicationShell.primarySidebar.addWidget(t)})()}listen(){var e=()=>{this.storeLayout(),window.removeEventListener("unload",e)};window.addEventListener("unload",e)}widgetStringify(e){if(!!(null==e?void 0:e.uri)){var t={uri:e.uri.toString()};if(ea(e)){var n=e.context.widget,r=n.getTitle();r&&(t.title=r);var o=n.getIconType();o&&(t.iconType=o)}return t}}widgetsStringify(e){return e.map(e=>this.widgetStringify(e)).filter(e=>(null==e?void 0:e.uri)&&e.uri!==m.AE.toString())}widgetsStringifyBFS(e){var t=e=>(0,N.Z)(e)?Object.keys(e).reduce((n,r)=>("widgets"===r&&Array.isArray(e[r])?n[r]=this.widgetsStringify(e[r]):n[r]=t(e[r]),n),{}):Array.isArray(e)?e.map(t):e;return t(e)}widgetParse(e){var t=this;return(0,T._)(function*(){var n=new m.ov(e.uri),r=t.widgetManager.getFactoryFromURI(n),o=yield t.widgetManager.getOrCreateWidgetFromURI(n,r);if(ea(o)){var a=o.context.widget;e.title&&a.setTitle(e.title,"normal"),e.iconType&&a.setIconType(e.iconType)}return t.viewRenderer.addReactPortal(o),t.applicationShell.track(o),o})()}widgetsParseBFS(e){var t=this;return(0,T._)(function*(){var n,r=(n=(0,T._)(function*(e){if((0,N.Z)(e)){var n;return yield Object.keys(e).reduce((n=(0,T._)(function*(n,o){var a=yield n;return"widgets"===o&&Array.isArray(e[o])?a[o]=yield Promise.all(e[o].map(e=>t.widgetParse(e))):a[o]=yield r(e[o]),a}),function(e,t){return n.apply(this,arguments)}),Promise.resolve({}))}return Array.isArray(e)?yield Promise.all(e.map(r)):e}),function(e){return n.apply(this,arguments)});return yield r(e)})()}constructor(){this._openFirstWorkflow=!1,this.enabled=!0}}(0,k.gn)([(0,C.f)(m.Ew),(0,k.w6)("design:type",void 0===m.Ew?Object:m.Ew)],es.prototype,"applicationShell",void 0),(0,k.gn)([(0,C.f)(m.fH),(0,k.w6)("design:type",void 0===m.fH?Object:m.fH)],es.prototype,"widgetManager",void 0),(0,k.gn)([(0,C.f)(m.l0),(0,k.w6)("design:type",void 0===m.l0?Object:m.l0)],es.prototype,"viewRenderer",void 0),(0,k.gn)([(0,C.f)(m.IC),(0,k.w6)("design:type",void 0===m.IC?Object:m.IC)],es.prototype,"optionsService",void 0),es=(0,k.gn)([(0,j.b)()],es);class el{onStart(){this.projectInfoService.init(),this.openURIResourceService.open(),this.openURIResourceService.listen(),this.widgetEventService.listen(),this.layoutRestorer.listen(),this.onStartedEmitter.fire()}onDispose(){this.widgetEventService.dispose(),this.openURIResourceService.dispose(),this.onStartedEmitter.dispose()}constructor(){this.onStartedEmitter=new m.Q5,this.onStarted=this.onStartedEmitter.event}}(0,k.gn)([(0,C.f)(A),(0,k.w6)("design:type",void 0===A?Object:A)],el.prototype,"openURIResourceService",void 0),(0,k.gn)([(0,C.f)(E),(0,k.w6)("design:type",void 0===E?Object:E)],el.prototype,"widgetEventService",void 0),(0,k.gn)([(0,C.f)(m.cw),(0,k.w6)("design:type",void 0===m.cw?Object:m.cw)],el.prototype,"layoutRestorer",void 0),(0,k.gn)([(0,C.f)(D),(0,k.w6)("design:type",void 0===D?Object:D)],el.prototype,"projectInfoService",void 0),el=(0,k.gn)([(0,j.b)()],el);var ec=(0,m.M1)({onBind(e,t){var{bind:n,rebind:r}=e;n(m.IC).toConstantValue(t),n(D).toSelf().inSingletonScope(),n(A).toSelf().inSingletonScope(),n(E).toSelf().inSingletonScope(),r(m.cw).to(es).inSingletonScope(),(0,m.KV)(n,el,[m.dQ])}}),ed=n("244470"),eu=e=>{var{spaceId:t,projectId:n,version:r}=e;return(0,S.Gy)(n),(0,ed.Z)(t,n)?(0,l.jsx)(ns,{spaceId:t,projectId:n,version:r}):null},eh=()=>{var{space_id:e,project_id:t}=(0,c.useParams)(),n=new URLSearchParams(window.location.search).get("commit_version");return(0,l.jsx)(eu,{spaceId:e||"",projectId:t||"",version:n||""},t)},ep=n("659596"),ef=n("336205"),em=n("967465"),ev=()=>{var e,t,n,r=(0,m.RX)(D),[o,a]=(0,d.useState)(!0),[s,l]=(0,d.useState)(null===(e=r.projectInfo)||void 0===e?void 0:e.projectInfo),[c,u]=(0,d.useState)(null==r?void 0:null===(t=r.projectInfo)||void 0===t?void 0:t.publishInfo),[h,p]=(0,d.useState)(null==r?void 0:null===(n=r.projectInfo)||void 0===n?void 0:n.ownerInfo),[f,v]=(0,d.useState)(r.initialValue),{patch:g}=(0,m.zu)(e=>({patch:e.patch}));return(0,d.useEffect)(()=>{r.projectInfo&&a(!1),g({projectInfo:{projectInfo:s,publishInfo:c,ownerInfo:h}});var e=r.onProjectInfoUpdated(()=>{var e,t,n;a(!1),l(null===(e=r.projectInfo)||void 0===e?void 0:e.projectInfo),u(null===(t=r.projectInfo)||void 0===t?void 0:t.publishInfo),p(null===(n=r.projectInfo)||void 0===n?void 0:n.ownerInfo),g({projectInfo:r.projectInfo}),v(r.initialValue)});return()=>{var t;null==e||null===(t=e.dispose)||void 0===t||t.call(e)}},[]),{loading:o,initialValue:f,projectInfo:s,ownerInfo:h,publishInfo:c,updateProjectInfo:r.updateProjectInfo.bind(r)}},eg=n("479886"),eb=n.n(eg),ey=n("378925"),e_=n("407821"),ew=n.n(e_),ex=n("472772"),eS=n.n(ex),ek=n("395245"),eC=n.n(ek),ej=n("297998"),eE=n.n(ej),eT=n("646576"),eI=n.n(eT),eP=n("606121"),eM=n.n(eP),eR=n("840486"),eD={};eD.styleTagTransform=eM(),eD.setAttributes=eE(),eD.insert=eC().bind(null,"head"),eD.domAPI=eS(),eD.insertStyleElement=eI(),ew()(eR.Z,eD);var eA=eR.Z&&eR.Z.locals?eR.Z.locals:void 0,eN=e=>{var t=Number(e);return isNaN(t)?"-":eb().unix(t).format("YYYY-MM-DD HH:mm:ss")},eL=e=>{var{spaceId:t,projectInfo:n,publishInfo:r,ownerInfo:o}=e,a=(0,ey.$_)(t);if(!n)return null;var s=eN(null==n?void 0:n.create_time);return(0,l.jsxs)("div",{className:eA.content,children:[(0,l.jsx)(ep.EZ,{type:"bot",size:"xl",src:null==n?void 0:n.icon_url}),(0,l.jsx)("div",{className:eA.title,children:null==n?void 0:n.name}),(0,l.jsx)("div",{className:eA.description,children:null==n?void 0:n.description}),(0,l.jsxs)("div",{className:eA["tag-container"],children:[a?(0,l.jsx)(ep.Vp,{className:eA.tag,color:"primary",prefixIcon:(0,l.jsx)(ep.EZ,{size:"mini",src:a.icon_url}),children:a.name}):null,(null==r?void 0:r.has_published)?(0,l.jsx)(ep.Vp,{className:eA.tag,color:"green",prefixIcon:(0,l.jsx)(g.Lz_,{}),children:ef.o.t("Published_1")}):null]}),o?(0,l.jsxs)("div",{className:eA["owner-container"],children:[(0,l.jsx)(ep.EZ,{size:"micro",src:null==o?void 0:o.avatar_url}),(0,l.jsx)("div",{children:null==o?void 0:o.nickname}),(0,l.jsxs)("div",{children:["@",null==o?void 0:o.user_unique_name]})]}):null,(0,l.jsx)("div",{className:eA.time,children:ef.o.t("project_ide_info_created_on",{time:s})})]})},{Title:ez}=ep.ZT,eO=()=>{var{loading:e,initialValue:t,projectInfo:n,updateProjectInfo:r,publishInfo:o,ownerInfo:a}=ev(),s=(0,m.aQ)(),c=(0,m.vp)(),{version:u}=(0,m.jo)(),{modalContextHolder:h,openModal:p}=(0,em.AZ)({onSuccess:()=>{r(),ep.FN.success(ef.o.t("project_ide_toast_edit_success"))}}),f=(0,S.Qb)(S.PL.EDIT_INFO,c||"",s||""),v=(0,d.useCallback)(()=>{p({initialValue:t})},[t]),b=null==o?void 0:o.has_published;return e?(0,l.jsx)(ep.Od.Title,{style:{width:24,height:24}}):(0,l.jsxs)("div",{className:eA["project-info"],children:[(0,l.jsxs)(ep.J2,{content:(0,l.jsx)(eL,{projectInfo:n,publishInfo:o,ownerInfo:a,spaceId:s}),children:[(0,l.jsx)(ep.EZ,{type:"bot",size:"small",src:null==n?void 0:n.icon_url}),b?(0,l.jsx)("div",{className:eA["check-icon"],children:(0,l.jsx)(g.Lz_,{color:"green"})}):null]}),(0,l.jsx)(ez,{ellipsis:{showTooltip:{opts:{content:null==n?void 0:n.name}}},className:eA.title,fontSize:"16px",style:{maxWidth:320},children:null==n?void 0:n.name}),f&&!u?(0,l.jsx)(ep.hU,{color:"secondary",icon:(0,l.jsx)(g.JAz,{}),onClick:v}):null,h]})},eB=n("120454"),eW=n("174470");n("297751"),n("616405");var eF=()=>{var e=(0,c.useNavigate)(),t=(0,m.aQ)(),n=(0,m.vp)(),{version:r}=(0,m.jo)(),{modalContextHolder:o,deleteIntelligence:a}=(0,em.wU)({onDeleteProjectSuccess:()=>{ep.FN.success(ef.o.t("project_ide_toast_delete_success")),e("/space/".concat(t,"/develop"))}}),{modalContextHolder:s,openModal:u}=(0,em.Z$)({onSuccess:()=>e("/space/".concat(t,"/develop"))}),{projectInfo:p,initialValue:f}=ev(),v=(0,S.kc)(n),b=(0,d.useCallback)(()=>{u({initialValue:(0,eB._)((0,L._)({},f),{to_space_id:t})})},[f,t]),y=(0,d.useCallback)(()=>{a({name:f.name||"",projectId:(null==p?void 0:p.id)||""})},[f,p]),_=(0,S.Qb)(S.PL.DELETE,n,t);return r?(0,l.jsx)(ep.Vp,{prefixIcon:(0,l.jsx)(g.SA_,{}),children:ef.o.t("app_ide_viewing_archive")}):(0,l.jsxs)("div",{className:"flex items-center justify-end grow gap-[8px] overflow-hidden",children:[s,v.length?(0,l.jsxs)(l.Fragment,{children:[o,(0,l.jsxs)(eH,{children:[(0,l.jsx)(h,{}),null]}),(0,l.jsx)(ep.iz,{layout:"vertical",className:"first:hidden"}),(0,l.jsx)(eW.PublishButton,{spaceId:t,projectId:n,hasPublished:!!Number(null==p?void 0:p.publish_time)}),(0,l.jsx)(ep.J2,{trigger:"click",className:"rounded-[8px]",content:(0,l.jsxs)(ep.v2,{children:[(0,l.jsx)(ep.v2.Item,{className:"min-w-[190px] h-[32px] rounded-[4px]",onClick:b,children:ef.o.t("project_ide_duplicate")}),_?(0,l.jsx)(ep.v2.Item,{className:"min-w-[190px] h-[32px] rounded-[4px]",onClick:y,children:ef.o.t("project_ide_delete_project")}):(0,l.jsx)(ep.u,{position:"left",content:ef.o.t("project_delete_permission_tooltips"),children:(0,l.jsx)(ep.v2.Item,{disabled:!0,className:"min-w-[190px] h-[32px] rounded-[4px]",onClick:y,children:ef.o.t("project_ide_delete_project")})})]}),children:(0,l.jsx)(ep.hU,{icon:(0,l.jsx)(g.NsR,{}),color:"secondary"})})]}):(0,l.jsx)(ep.zx,{onClick:b,children:ef.o.t("project_ide_create_duplicate")})]})};function eH(e){var{children:t}=e;return t}var eU=()=>{var e=(0,c.useNavigate)(),t=(0,m.aQ)(),n=(0,d.useCallback)(()=>{e("/space/".concat(t,"/develop"))},[t,e]);return(0,l.jsx)(ep.hU,{color:"secondary",icon:(0,l.jsx)(g.$1i,{}),onClick:n})},eV=n("11549"),eK={};eK.styleTagTransform=eM(),eK.setAttributes=eE(),eK.insert=eC().bind(null,"head"),eK.domAPI=eS(),eK.insertStyleElement=eI(),ew()(eV.Z,eK);var eq=eV.Z&&eV.Z.locals?eV.Z.locals:void 0,eZ=()=>(0,l.jsx)("div",{className:eq.container,children:(0,l.jsxs)(ep.X2,{className:eq["top-bar"],children:[(0,l.jsxs)(ep.JX,{span:8,className:eq["left-col"],children:[(0,l.jsx)(eU,{}),(0,l.jsx)(eO,{})]}),(0,l.jsx)(ep.JX,{span:8,className:eq["middle-col"],children:(0,l.jsx)(u,{})}),(0,l.jsx)(ep.JX,{span:8,className:eq["right-col"],children:(0,l.jsx)(eF,{})})]})}),eY=n("252237"),eX=n.n(eY),eQ=n("450562"),eG=n("189284"),eJ=n("909776"),e$=n("833047"),e0=n("610382"),e1=n("529223"),e2=e=>{var t,{projectId:n}=e,r=(0,x.S4)();return t=(0,T._)(function*(e){var{scene:t,resource:o}=e;try{console.log("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t,">>>"),o),yield r({scene:t,res_id:null==o?void 0:o.id,res_type:e1.ResType.Plugin,project_id:n,res_name:(null==o?void 0:o.name)||""})}catch(e){console.error("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t," error>>>"),e)}}),function(e){return t.apply(this,arguments)}},e4=()=>{var e,t,n,r,o=(0,x.Un)(e=>e.refetch),a=(0,m.aQ)(),s=(0,m.vp)(),c=(0,x.j2)(),[u,h]=(0,d.useState)(!1);var p=(0,d.useCallback)((e=(0,T._)(function*(e){try{console.log("[ResourceFolder]on change name>>>",e);var t=yield R.Js.UpdatePluginMeta({plugin_id:e.id,name:e.name});console.log("[ResourceFolder]rename plugin response>>>",t)}catch(e){console.log("[ResourceFolder]rename plugin error>>>",e)}finally{o()}}),function(t){return e.apply(this,arguments)}),[o]);var f=(0,d.useCallback)((t=(0,T._)(function*(e){try{console.log("[ResourceFolder]on delete>>>",e);var t,n=yield R.Js.DelPlugin({plugin_id:null===(t=e.filter(e=>e.type===x.LC.Plugin))||void 0===t?void 0:t[0].res_id});ep.FN.success(ef.o.t("project_plugin_delete_success_toast")),o(),console.log("[ResourceFolder]delete plugin response>>>",n)}catch(e){console.log("[ResourceFolder]delete plugin error>>>",e)}}),function(e){return t.apply(this,arguments)}),[o,a]);var{node:v,open:g,close:b}=(0,e0.qz)({from:e$.tx.ProjectIde,pluginApiList:[],projectId:s,showCopyPlugin:!0,showButton:!1,hideCreateBtn:!0,onCopyPluginCallback:e=>{var{pluginID:t,name:n}=e;t&&(y({scene:eJ.K2.CopyResourceFromLibrary,resource:{id:t,res_id:t,name:null!=n?n:""}}),b())},onCreateSuccess:(n=(0,T._)(function*(e){if(!!(null==e?void 0:e.pluginId))yield null==o?void 0:o(),c({resourceType:x.LC.Plugin,resourceId:null==e?void 0:e.pluginId}),b()}),function(e){return n.apply(this,arguments)}),isShowStorePlugin:!1}),y=e2({projectId:s}),_=e=>{var{label:t}=e;return t?t.length>30?ef.o.t("project_resource_sidebar_warning_length_exceeds"):RegExp("^[\\w\\s\\u4e00-\\u9fa5]+$","u").test(t)?"":ef.o.t("create_plugin_modal_nameerror_cn"):ef.o.t("create_plugin_modal_name1_error")};return{onChangeName:p,onAction:(e,t)=>{switch(console.log("on action>>>",e,t),e){case x.lW.ImportLibraryResource:return g();case x.lW.DuplicateResource:return y({scene:eJ.K2.CopyProjectResource,resource:t});case x.lW.MoveToLibrary:return y({scene:eJ.K2.MoveResourceToLibrary,resource:t});case x.lW.CopyToLibrary:return y({scene:eJ.K2.CopyResourceToLibrary,resource:t});default:console.warn("[PluginResource]unsupported action>>>",e)}},onDelete:f,onCustomCreate:(e,t)=>{console.log("[ResourceFolder]on custom create>>>",e,t),h(!0)},modals:[(0,l.jsx)(e0.rm,{projectId:s,isCreate:!0,visible:u,onSuccess:(r=(0,T._)(function*(e){yield null==o?void 0:o(),c({resourceType:x.LC.Plugin,resourceId:e})}),function(e){return r.apply(this,arguments)}),onCancel:()=>{h(!1)}}),v],validateConfig:{customValidator:e=>_(e)||""}}},e6=n("328591"),e5=n("402635"),e3=e=>{var t,{projectId:n}=e,r=(0,x.S4)();return t=(0,T._)(function*(e){var{scene:t,resource:o}=e;try{console.log("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t,">>>"),o),yield r({scene:t,res_id:null==o?void 0:o.id,res_type:null==o?void 0:o.res_type,project_id:n,res_name:(null==o?void 0:o.name)||""})}catch(e){console.error("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t," error>>>"),e)}}),function(e){return t.apply(this,arguments)}},e8=()=>{var e,t,n,r=(0,x.Un)(e=>e.refetch),o=(0,m.aQ)(),a=(0,m.vp)(),s=(0,m.d0)(),{modal:l,open:c,close:u}=(0,e6.Eb)({projectID:a,onFinish:(e,t,n)=>{r(),u(),s("/knowledge/".concat(e,"?type=").concat(t).concat(n?"&module=upload":""))}});var h=(e=(0,T._)(function*(e,t,n){try{yield R.MJ.UpdateDataset({dataset_id:e,name:t,status:n})}catch(e){console.log("[ResourceFolder]update knowledge error>>>",e)}finally{r()}}),function(t,n,r){return e.apply(this,arguments)});var p=(t=(0,T._)(function*(e){try{yield R.MJ.UpdateDataset({dataset_id:e.id,name:e.name})}catch(e){console.log("[ResourceFolder]rename knowledge error>>>",e)}finally{r()}}),function(e){return t.apply(this,arguments)});var f=(0,d.useCallback)((n=(0,T._)(function*(e){try{var t;yield R.MJ.DeleteDataset({dataset_id:null===(t=e.filter(e=>e.type===x.LC.Knowledge))||void 0===t?void 0:t[0].res_id}),ep.FN.success(ef.o.t("Delete_success")),r()}catch(e){ep.FN.error(ef.o.t("Delete_failed"))}}),function(e){return n.apply(this,arguments)}),[r,o]),v=e3({projectId:a});return{onChangeName:p,onAction:(e,t)=>{switch(e){case x.lW.DuplicateResource:return v({scene:eJ.K2.CopyProjectResource,resource:t});case x.lW.MoveToLibrary:return v({scene:eJ.K2.MoveResourceToLibrary,resource:t});case x.lW.CopyToLibrary:return v({scene:eJ.K2.CopyResourceToLibrary,resource:t});case x.lW.DisableKnowledge:(null==t?void 0:t.id)&&h(t.id,t.name,e5._z.DatasetForbid);break;case x.lW.EnableKnowledge:(null==t?void 0:t.id)&&h(t.id,t.name,e5._z.DatasetReady)}},onDelete:f,onCustomCreate:()=>{c()},modals:[l]}},e9=n("695673"),e7=n("299464"),te=n("775699"),tt=e=>{var{label:t,onClick:n,selected:r}=e;return(0,l.jsxs)("div",{onClick:n,className:eX()(["flex items-center gap-[8px] px-[12px]","px-[12px] py-[6px] rounded-[8px]","cursor-pointer","hover:text-[var(--light-usage-text-color-text-0,#1c1f23)]","hover:bg-[var(--light-usage-fill-color-fill-0,rgba(46,50,56,5%))]",r&&"text-[var(--light-usage-text-color-text-0,#1c1d23)] bg-[var(--light-usage-fill-color-fill-0,rgba(46,47,56,5%))]"]),children:[(0,l.jsx)(g.Iqn,{}),t]})},tn=e=>{var t,n,{onClose:r}=e,[o,a]=(0,d.useState)("knowledge"),s=(0,m.vp)(),c=(0,m.aQ)(),u=(0,x.Un)(e=>e.refetch),h=e3({projectId:s});var{renderContent:p,renderSearch:f}=(0,e6.ey)({showFilters:["scope-type","search-type"],datasetList:[],onDatasetListChange:(t=(0,T._)(function*(e){e[0].dataset_id&&e[0].name&&(yield h({scene:eJ.K2.CopyResourceFromLibrary,resource:{id:e[0].dataset_id,res_id:e[0].dataset_id,name:e[0].name,res_type:eJ.b0.Knowledge}}),u(),null==r||r())}),function(e){return t.apply(this,arguments)}),canCreate:!1,defaultType:e9.AT.ALL});var{renderContent:v,renderFilter:g,renderInput:b}=(0,e7.a8)({visible:!0,onClose:()=>void 0,onAddDatabase:(n=(0,T._)(function*(e){yield h({scene:eJ.K2.CopyResourceFromLibrary,resource:{id:e,res_id:e,name:"",res_type:eJ.b0.Database}}),u(),null==r||r()}),function(e){return n.apply(this,arguments)}),onClickDatabase:()=>void 0,enterFrom:"project",spaceId:c});return(0,l.jsx)(te.tz,{keepDOM:!1,visible:!0,onCancel:r,tabs:{tabsProps:{lazyRender:!0,activeKey:o,onChange:e=>a(e)},tabPanes:[{tabPaneProps:{tab:ef.o.t("resource_type_knowledge"),itemKey:"knowledge"},content:(0,l.jsxs)("div",{className:"w-full h-full flex",children:[(0,l.jsxs)("div",{className:"w-[218px] pt-[16px] px-[12px] shrink-0 flex flex-col gap-[12px]",children:[f(),(0,l.jsx)(tt,{label:ef.o.t("project_resource_modal_library_resources",{resource:ef.o.t("resource_type_knowledge")}),selected:!0})]}),(0,l.jsx)("div",{className:"grow-[1] bg-[white] pt-[16px] px-[12px]",children:p()})]})},{tabPaneProps:{tab:ef.o.t("resource_type_database"),itemKey:"database"},content:(0,l.jsxs)("div",{className:"w-full h-full flex",children:[(0,l.jsxs)("div",{className:"w-[218px] pt-[16px] px-[12px] shrink-0 flex flex-col gap-[12px]",children:[b(),(0,l.jsx)(tt,{label:ef.o.t("project_resource_modal_library_resources",{resource:ef.o.t("resource_type_database")}),selected:!0})]}),(0,l.jsxs)("div",{className:"grow-[1] bg-[white] pt-[16px] px-[12px] flex flex-col",children:[g(),v()]})]})}]}})},tr=()=>{var[e,t]=(0,d.useState)(!1),n=()=>{t(!1)};return{modal:e?(0,l.jsx)(tn,{onClose:n}):null,open:()=>{t(!0)},close:n}},ti=()=>{var e,t,n=(0,x.Un)(e=>e.refetch),r=(0,m.aQ)(),o=(0,m.vp)(),a=(0,m.d0)(),{modal:s,open:l,close:c}=(0,e7.Gx)({projectID:o,enterFrom:"project",onFinish:e=>{n(),c(),a("/database/".concat(e,"?page_modal=normal&from=create"))}});var u=(e=(0,T._)(function*(e){try{console.log("[ResourceFolder]on change name>>>",e);var t=yield R.v6.UpdateDatabase({id:e.id,table_name:e.name});console.log("[ResourceFolder]rename database response>>>",t)}catch(e){console.log("[ResourceFolder]rename database error>>>",e)}finally{n()}}),function(t){return e.apply(this,arguments)});var h=(0,d.useCallback)((t=(0,T._)(function*(e){try{console.log("[ResourceFolder]on delete>>>",e);var t,r=yield R.v6.DeleteDatabase({id:null===(t=e.filter(e=>e.type===x.LC.Database))||void 0===t?void 0:t[0].res_id});ep.FN.success(ef.o.t("Delete_success")),n(),console.log("[ResourceFolder]delete database response>>>",r)}catch(e){console.log("[ResourceFolder]delete database error>>>",e),ep.FN.error(ef.o.t("Delete_failed"))}}),function(e){return t.apply(this,arguments)}),[n,r]),p=e3({projectId:o});return{onChangeName:u,onAction:(e,t)=>{switch(console.log("on action>>>",e,t),e){case x.lW.ImportLibraryResource:return;case x.lW.DuplicateResource:return p({scene:eJ.K2.CopyProjectResource,resource:t});case x.lW.MoveToLibrary:return p({scene:eJ.K2.MoveResourceToLibrary,resource:t});case x.lW.CopyToLibrary:return p({scene:eJ.K2.CopyResourceToLibrary,resource:t});default:console.warn("[DatabaseResource]unsupported action>>>",e)}},onDelete:h,onCustomCreate:(e,t)=>{console.log("[ResourceFolder]on custom create>>>",e,t),l()},modals:[s]}},to=()=>{var e=(0,d.useMemo)(()=>[{icon:(0,l.jsx)(g.Guk,{}),label:ef.o.t("project_resource_sidebar_create_new_resource",{resource:ef.o.t("performance_knowledge")}),subType:x.LC.Knowledge,tooltip:null},{icon:(0,l.jsx)(g.Dzy,{}),label:ef.o.t("project_resource_sidebar_create_new_resource",{resource:ef.o.t("review_bot_database")}),subType:x.LC.Database,tooltip:null}],[]),{modal:t,open:n}=tr(),r=e8(),o=ti();return{onCustomCreate(e,t){var n,a;t===x.LC.Knowledge&&(null===(n=r.onCustomCreate)||void 0===n||n.call(r,e,t)),t===x.LC.Database&&(null===(a=o.onCustomCreate)||void 0===a||a.call(o,e,t))},onChangeName(e){var t,n,a,s;(null===(t=e.resource)||void 0===t?void 0:t.res_type)===eJ.b0.Knowledge&&(null===(a=r.onChangeName)||void 0===a||a.call(r,e)),(null===(n=e.resource)||void 0===n?void 0:n.res_type)===eJ.b0.Database&&(null===(s=o.onChangeName)||void 0===s||s.call(o,e))},onAction(e,t){if(e===x.lW.ImportLibraryResource)n();else{var a,s;(null==t?void 0:t.res_type)===eJ.b0.Knowledge&&(null===(a=r.onAction)||void 0===a||a.call(r,e,t)),(null==t?void 0:t.res_type)===eJ.b0.Database&&(null===(s=o.onAction)||void 0===s||s.call(o,e,t))}},onDelete(e){var t,n,a=e.filter(e=>(null==e?void 0:e.res_type)===eJ.b0.Knowledge),s=e.filter(e=>(null==e?void 0:e.res_type)===eJ.b0.Database);a.length&&(null===(t=r.onDelete)||void 0===t||t.call(r,a)),s.length&&(null===(n=o.onDelete)||void 0===n||n.call(o,s))},createResourceConfig:e,modals:[r.modals,o.modals,t],validateConfig:{customValidator:e=>e.label?/^[^"'`\\]+$/.test(e.label)?(0,x.nU)(e):ef.o.t("dataset-name-has-wrong-word-tooltip"):ef.o.t("dataset-name-empty-tooltip")}}},ta=n("280053"),ts={[ta.a5.Text]:(0,l.jsx)(g.da8,{}),[ta.a5.Table]:(0,l.jsx)(g.E4X,{}),[ta.a5.Image]:(0,l.jsx)(g.Q2$,{})},tl=e=>{var{idPrefix:t="fixed-sidebar"}=e,{onCustomCreate:n,onDelete:r,onChangeName:o,onAction:a,createResourceConfig:s,iconRender:c,modals:u}=(0,v.qn)(),{onCustomCreate:h,onDelete:p,onChangeName:f,onAction:b,validateConfig:y,modals:_}=e4(),{onCustomCreate:w,onDelete:k,onChangeName:C,onAction:j,createResourceConfig:E,modals:T,validateConfig:I}=to(),P=(0,m.aQ)(),M=(0,m.vp)(),{version:R}=(0,m.jo)(),D=(0,S.Qb)(S.PL.CREATE_RESOURCE,M,P);R&&(D=!1);var A=(0,S.kc)(M),N=(0,d.useMemo)(()=>{var e;return(null!==(e=null==A?void 0:A.length)&&void 0!==e?e:0)===0||!!R},[A,R]),{workflowResource:L,pluginResource:z,dataResource:O,initLoaded:B}=(0,x.rA)();return(0,l.jsxs)("div",{children:[(0,l.jsx)(x.dg,{id:"".concat(t,"_").concat(x.ai.Workflow),groupType:x.ai.Workflow,defaultResourceType:x.LC.Workflow,resourceTree:L,canCreate:D,initLoaded:B,onChangeName:o,onCustomCreate:n,onDelete:r,onAction:a,createResourceConfig:s,iconRender:c,hideMoreBtn:N}),(0,l.jsx)(x.dg,{id:"".concat(t,"_").concat(x.ai.Plugin),groupType:x.ai.Plugin,defaultResourceType:x.LC.Plugin,resourceTree:z,canCreate:D,initLoaded:B,onChangeName:f,onCustomCreate:h,onDelete:p,onAction:b,iconRender:()=>(0,l.jsx)(g.QWX,{}),hideMoreBtn:N,validateConfig:y}),(0,l.jsx)(x.dg,{id:"".concat(t,"_").concat(x.ai.Data),groupType:x.ai.Data,resourceTree:O,canCreate:D,initLoaded:B,createResourceConfig:E,onChangeName:C,onDelete:k,onAction:j,onCustomCreate:w,hideMoreBtn:N,validateConfig:I,iconRender:e=>{var t,{resource:n}=e;return(console.log(n),n.id===x.Vx)?(0,l.jsx)(g.pFl,{}):n.type===x.LC.Database?(0,l.jsx)(g.Dzy,{}):n.type===x.LC.Knowledge?(0,l.jsxs)("div",{className:"flex items-center",children:[ts[null===(t=n.biz_extend)||void 0===t?void 0:t.format_type],3===n.biz_res_status?(0,l.jsx)("span",{className:"ml-[3px]",children:"已禁用"}):null]}):(0,l.jsx)(l.Fragment,{})}}),u,_,T]})},tc=n("362845"),td={};td.styleTagTransform=eM(),td.setAttributes=eE(),td.insert=eC().bind(null,"head"),td.domAPI=eS(),td.insertStyleElement=eI(),ew()(tc.Z,td);var tu=tc.Z&&tc.Z.locals?tc.Z.locals:void 0,th=(0,d.lazy)(()=>n.e("9905").then(n.bind(n,163206)).then(e=>({default:e.ResourceTreeModal}))),tp=(0,eQ._Uw)(e=>{var{hideExpand:t,idPrefix:n}=e,r=(0,m.XO)(),{workflowResource:o}=(0,x.rA)(),[a,s]=(0,d.useState)(!1),[c]=(0,eG.V)();return(0,l.jsxs)("div",{className:tu["primary-sidebar"],children:[(0,l.jsxs)("div",{className:eX()(tu["primary-sidebar-header"],"h-[".concat(44,"px]")),children:[(0,l.jsxs)("div",{className:tu.title,children:[ef.o.t("project_resource_sidebar_title"),c["bot.automation.dependency_tree"]?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ep.zx,{size:"small",icon:(0,l.jsx)(g.CfL,{}),color:"primary",disabled:!(null==o?void 0:o.length),onClick:()=>s(!0),children:ef.o.t("reference_graph_entry_button")}),a?(0,l.jsx)(d.Suspense,{fallback:null,children:(0,l.jsx)(th,{modalVisible:a,setModalVisible:s})}):null]}):null]}),t?null:(0,l.jsx)(ep.hU,{"data-testid":"project-expand-button",icon:(0,l.jsx)(g.m7o,{className:"coz-fg-primary"}),color:"secondary",size:"small",onClick:()=>{r.view.primarySidebar.changeVisible(!1)}})]}),(0,l.jsx)("div",{className:tu["resource-list-wrapper"],style:{height:"calc(100% - ".concat(44,"px)")},children:(0,l.jsx)(tl,{idPrefix:n})})]})}),tf=n("746131"),tm={};tm.styleTagTransform=eM(),tm.setAttributes=eE(),tm.insert=eC().bind(null,"head"),tm.domAPI=eS(),tm.insertStyleElement=eI(),ew()(tf.Z,tm);var tv=tf.Z&&tf.Z.locals?tf.Z.locals:void 0,tg=e=>{var{commandRegistry:t,title:n,widget:r,uiState:o,registry:a}=e,[s,c]=(0,d.useState)(!1),u=(0,d.useMemo)(()=>(null==a?void 0:a.renderIcon)&&"function"==typeof(null==a?void 0:a.renderIcon)?a.renderIcon(r.context):null,[a]),h=(0,d.useMemo)(()=>{if(s)return(0,l.jsx)(g.syE,{className:"coz-fg-secondary",style:{fontSize:16},onClick:e=>{e.stopPropagation(),t.executeCommand(m.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,[null==r?void 0:r.title])}});if(n){if("saving"===o)return(0,l.jsx)(ep.gb,{size:"mini",loading:!0});else if("error"===o)return(0,l.jsx)(g.wR2,{className:"text-lg coz-fg-hglt-red"})}else;return null},[o,r,s,t,n]),p=(0,d.useCallback)(()=>{c(!0)},[]),f=(0,d.useCallback)(()=>{c(!1)},[]);return(0,l.jsx)("div",{className:tv["title-container"],onMouseOver:p,onMouseLeave:f,children:"loading"!==o&&n?(0,l.jsxs)("div",{className:tv["widget-title"],children:[(0,l.jsxs)("div",{className:tv["title-label"],children:[(0,l.jsx)("div",{className:tv["label-icon"],children:u}),(0,l.jsx)("div",{className:tv["label-text"],children:(0,l.jsx)(ep.ZT.Text,{ellipsis:{showTooltip:!0},children:n})})]}),(0,l.jsx)("div",{className:eX()(tv["close-icon"],m.xO),children:h})]}):(0,l.jsxs)("div",{className:tv["widget-title"],children:[(0,l.jsx)("div",{className:tv["title-label"],children:(0,l.jsx)(ep.Od.Title,{style:{width:"100px"}})}),(0,l.jsx)("div",{className:eX()(tv["close-icon"],m.xO),children:h})]})})},tb=e=>(0,l.jsx)(tg,(0,L._)({},e));n.p,n.p,n.p;var ty=n.p+"static/image/cn-workflow-frame.71d4a119.png";n.p;var t_=n.p+"static/image/cn-knowledge-frame.1e7b48d8.png",tw=n("618461"),tx={};tx.styleTagTransform=eM(),tx.setAttributes=eE(),tx.insert=eC().bind(null,"head"),tx.domAPI=eS(),tx.insertStyleElement=eI(),ew()(tw.Z,tx);var tS=tw.Z&&tw.Z.locals?tw.Z.locals:void 0,tk=()=>{var e=(0,m.XO)(),t=(0,m.eo)(),{keybinding:n}=(0,m.XU)(m.mY.Default.VIEW_FULL_SCREEN),r=(0,m.Lj)(t.currentURI,t.tabBar),[o,a]=(0,d.useState)(!1),[s,c]=(0,d.useState)(e.view.isFullScreenMode);(0,d.useEffect)(()=>{var t=e.view.onFullScreenModeChange(e=>{c(e)});return()=>{t.dispose()}},[]);var u=(0,d.useMemo)(()=>s?(0,l.jsx)(g.qSn,{}):(0,l.jsx)(g.ltt,{}),[s]),h=(0,d.useMemo)(()=>(0,l.jsxs)("div",{className:tS.shortcut,children:[(0,l.jsx)("div",{className:tS.label,children:s?ef.o.t("project_ide_restore"):ef.o.t("project_ide_maximize")}),(0,l.jsx)("div",{className:tS.keybinding,children:n})]}),[s,n]);return"left"===r?null:(0,l.jsx)(ep.u,{content:h,position:"bottom",trigger:"custom",visible:o,children:(0,l.jsx)(ep.hU,{className:tS["icon-button"],icon:u,color:"secondary",onClick:()=>{e.view.switchFullScreenMode(),a(!1)},onMouseOver:()=>a(!0),onMouseOut:()=>a(!1)})})},tC=n("260776"),tj={};tj.styleTagTransform=eM(),tj.setAttributes=eE(),tj.insert=eC().bind(null,"head"),tj.domAPI=eS(),tj.insertStyleElement=eI(),ew()(tC.Z,tj);var tE=tC.Z&&tC.Z.locals?tC.Z.locals:void 0,tT=()=>{var e=(0,m.XO)(),t=(0,m.eo)(),n=(0,m.Lj)(t.currentURI,t.tabBar),{pathname:r}=(0,c.useLocation)(),[o,a]=(0,d.useState)(e.view.primarySidebar.getVisible()),s=(0,x.Un)(e=>e.canClosePopover),[u,h]=(0,d.useState)(!1),p=(0,d.useRef)(),f=(0,d.useRef)(),v=()=>{h(!0),clearTimeout(p.current),f.current=!1},b=()=>{if(f.current=!0,!!s)p.current=setTimeout(()=>{h(!1)},100)};(0,d.useEffect)(()=>{s&&f.current&&h(!1)},[s]),(0,d.useLayoutEffect)(()=>{a(e.view.primarySidebar.getVisible())},[r]),(0,d.useEffect)(()=>{var t=e.view.onSidebarVisibleChange(e=>{a(e)});return()=>{t.dispose()}},[]);var y=(0,d.useCallback)(()=>{e.view.primarySidebar.changeVisible(!0),h(!1)},[]);return"right"===n?null:o?null:(0,l.jsx)(ep.J2,{motion:!1,visible:u,trigger:"custom",zIndex:1e3,style:{background:"transparent",border:"none",boxShadow:"none",padding:0},content:(0,l.jsx)("div",{onMouseEnter:v,onMouseLeave:b,className:tE["sidebar-wrapper"],children:(0,l.jsx)(tp,{hideExpand:!0,idPrefix:"popover-sidebar"})}),children:(0,l.jsx)(ep.hU,{className:tE["icon-button"],icon:(0,l.jsx)(g.m7o,{style:{rotate:"180deg"}}),color:"secondary",onClick:y,onMouseEnter:v,onMouseLeave:b})})},tI=n("130493"),tP={};tP.styleTagTransform=eM(),tP.setAttributes=eE(),tP.insert=eC().bind(null,"head"),tP.domAPI=eS(),tP.insertStyleElement=eI(),ew()(tI.Z,tP);var tM=tI.Z&&tI.Z.locals?tI.Z.locals:void 0,tR=e=>{var{item:t}=e,{key:n,label:r,keybinding:o}=t;return(0,l.jsxs)("div",{className:tM["shortcut-item"],children:[(0,l.jsx)("div",{className:tM.label,children:r}),(0,l.jsx)("div",{className:tM.keybinding,children:o.map(e=>e.map(e=>(0,l.jsx)("div",{className:tM["keybinding-block"],children:e},e)))})]},n)},tD=n("676466"),tA={};tA.styleTagTransform=eM(),tA.setAttributes=eE(),tA.insert=eC().bind(null,"head"),tA.domAPI=eS(),tA.insertStyleElement=eI(),ew()(tD.Z,tA);var tN=tD.Z&&tD.Z.locals?tD.Z.locals:void 0,tL=[m.mY.Default.VIEW_CLOSE_ALL_WIDGET,m.mY.Default.VIEW_CLOSE_CURRENT_WIDGET,m.mY.Default.VIEW_CLOSE_OTHER_WIDGET],tz=()=>{var e=(0,m.RX)(m.L),t=(0,m.RX)(m.Ho),n=e.shortcutsHandlers.filter(e=>tL.includes(e.commandId)).map(n=>{var r;return{key:n.commandId,label:(null===(r=t.getCommand(n.commandId))||void 0===r?void 0:r.label)||n.commandId,keybinding:e.getShortcutByCommandId(n.commandId)}}),r=(0,d.useCallback)(()=>{window.open("/docs/guides/build_project_in_projectide")},[]);(0,d.useCallback)(()=>{window.open("/docs/guides/build_ui_interface")},[]);var o=(0,d.useCallback)(()=>{window.open("/docs/guides/add_resources_to_project")},[]);return(0,l.jsxs)("div",{className:tN["default-container"],children:[(0,l.jsx)("div",{className:tN["icon-expand"],children:(0,l.jsx)(tT,{})}),(0,l.jsx)("div",{className:tN["full-screen"],children:(0,l.jsx)(tk,{})}),(0,l.jsx)("div",{className:tN.title,children:ef.o.t("project_ide_welcome_title")}),(0,l.jsx)("div",{className:tN["sub-title"],children:ef.o.t("project_ide_welcome_describe")}),(0,l.jsxs)("div",{className:tN.gallery,children:[(0,l.jsxs)("div",{className:tN["gallery-block"],children:[(0,l.jsx)(ep.Ee,{preview:!1,src:ty,width:320,height:160}),(0,l.jsx)("div",{className:tN["gallery-title"],children:ef.o.t("project_ide_welcome_workflow_title")}),(0,l.jsx)("div",{className:tN["gallery-description"],children:ef.o.t("project_ide_welcome_workflow_describe")}),(0,l.jsx)(ep.zx,{className:tN["doc-search"],icon:(0,l.jsx)(g.da8,{}),color:"primary",onClick:r,children:ef.o.t("project_ide_view_document")})]}),null,(0,l.jsxs)("div",{className:tN["gallery-block"],children:[(0,l.jsx)(ep.Ee,{preview:!1,src:t_,width:320,height:160}),(0,l.jsx)("div",{className:tN["gallery-title"],children:ef.o.t("project_ide_welcome_db_title")}),(0,l.jsx)("div",{className:tN["gallery-description"],children:ef.o.t("project_ide_welcome_db_describ")}),(0,l.jsx)(ep.zx,{className:tN["doc-search"],icon:(0,l.jsx)(g.da8,{}),color:"primary",onClick:o,children:ef.o.t("project_ide_view_document")})]})]}),(0,l.jsx)("div",{className:tN["shortcuts-list"],children:n.map(e=>(0,l.jsx)(tR,{item:e},e.key))})]})},tO=e=>{var{widget:t}=e,{keybinding:n}=(0,m.XU)(m.yJ.RELOAD),[r,o]=(0,d.useState)(!1),a=(0,d.useMemo)(()=>(0,l.jsxs)("div",{className:tS.shortcut,children:[(0,l.jsx)("div",{className:tS.label,children:ef.o.t("refresh_project_tags")}),(0,l.jsx)("div",{className:tS.keybinding,children:n})]}),[n]);return(0,l.jsx)(ep.u,{content:a,position:"bottom",trigger:"custom",visible:r,children:(0,l.jsx)(ep.hU,{className:tS["icon-button"],icon:(0,l.jsx)(g.mxP,{}),color:"secondary",onClick:()=>{t.refresh(),t.context.widget.setUIState("loading")},onMouseOver:()=>o(!0),onMouseOut:()=>o(!1)})})},tB=e=>{var{widget:t}=e;return(0,l.jsxs)("div",{style:{display:"flex"},children:[(0,l.jsx)(tO,{widget:t}),(0,l.jsx)(tk,{})]})},tW=n("184983"),tF={};tF.styleTagTransform=eM(),tF.setAttributes=eE(),tF.insert=eC().bind(null,"head"),tF.domAPI=eS(),tF.insertStyleElement=eI(),ew()(tW.Z,tF);var tH=tW.Z&&tW.Z.locals?tW.Z.locals:void 0,tU=e=>{var{scene:t,resourceName:n}=e,r=(0,d.useMemo)(()=>{switch(t){case eJ.K2.CopyResourceFromLibrary:return ef.o.t("resource_process_modal_text_copying_resource_to_project",{resourceName:n});case eJ.K2.MoveResourceToLibrary:return ef.o.t("resource_process_modal_text_moving_resource_to_library",{resourceName:n});case eJ.K2.CopyResourceToLibrary:return ef.o.t("resource_process_modal_text_copying_resource_to_library",{resourceName:n});case eJ.K2.CopyProjectResource:return ef.o.t("project_toast_copying_resource",{resourceName:n});default:return""}},[t,n]),o=(0,d.useMemo)(()=>t===eJ.K2.MoveResourceToLibrary?ef.o.t("resource_process_modal_text_moving_process_interrupt_warning"):ef.o.t("resource_process_modal_text_copying_process_interrupt_warning"),[t]);return(0,l.jsxs)("div",{className:tH["description-container"],children:[(0,l.jsx)(ep.gb,{loading:!0,wrapperClassName:tH.spin}),(0,l.jsx)("div",{children:r}),(0,l.jsx)("div",{children:o})]})},tV=()=>{var[e,t]=(0,d.useState)(!1),[n,r]=(0,d.useState)(void 0),[o,a]=(0,d.useState)(!1),[s,c]=(0,d.useState)(""),u=(0,m.RX)(m.Z7),h=(0,d.useCallback)(()=>{u.onCloseResourceModal()},[]),p=(0,d.useCallback)(()=>{o&&u.retry()},[o]),f=(0,d.useMemo)(()=>{switch(n){case eJ.K2.CopyResourceFromLibrary:return ef.o.t("resource_process_modal_title_import_resource_from_library");case eJ.K2.MoveResourceToLibrary:return ef.o.t("resource_process_modal_title_move_resource_to_library");case eJ.K2.CopyResourceToLibrary:return ef.o.t("resource_process_modal_title_copy_resource_to_library");case eJ.K2.CopyProjectResource:return ef.o.t("workflow_add_list_copy");default:return""}},[n]),v=(0,d.useMemo)(()=>{if("string"==typeof o&&"no_task_id"!==o)return o;switch(n){case eJ.K2.CopyResourceFromLibrary:return ef.o.t("resource_toast_copy_to_project_fail");case eJ.K2.MoveResourceToLibrary:return ef.o.t("resource_toast_move_to_library_fail");case eJ.K2.CopyResourceToLibrary:return ef.o.t("resource_toast_copy_to_library_fail");case eJ.K2.CopyProjectResource:return ef.o.t("project_toast_copy_failed");default:return""}},[n,o]),b=(0,d.useMemo)(()=>o?(0,l.jsxs)("div",{className:tH["error-container"],children:[(0,l.jsx)(g.U6C,{className:"coz-fg-hglt-red",fontSize:22}),v]}):(0,l.jsx)(tU,{scene:n,resourceName:s}),[o,v,s,n]),y=(0,d.useMemo)(()=>"",[o]);(0,d.useEffect)(()=>{var e=u.onModalVisibleChange(e=>{var{type:n,visible:o=!0,scene:s,resourceName:l}=e;n===m.w8.RESOURCE&&(t(!!o),r(s),c(l||""),a(!1))}),n=u.onError(e=>{a(e)});return()=>{e.dispose(),n.dispose()}},[]);var _=(0,d.useMemo)(()=>o?ef.o.t("resource_process_modal_cancel_button"):void 0,[o]);return(0,l.jsx)(ep.u_,{visible:e,width:384,type:"dialog",title:f,okText:y,onOk:p,cancelText:_,onCancel:h,maskClosable:!1,children:(0,l.jsx)("div",{className:tH.content,children:b})})},tK=n("626496"),tq={};tq.styleTagTransform=eM(),tq.setAttributes=eE(),tq.insert=eC().bind(null,"head"),tq.domAPI=eS(),tq.insertStyleElement=eI(),ew()(tK.Z,tq);var tZ=tK.Z&&tK.Z.locals?tK.Z.locals:void 0,tY=()=>{var e=(0,m.RX)(m.Z7),t=(0,m.RX)(m.un),n=(0,m.RX)(m.s1),r=(0,d.useRef)(),[o,a]=(0,d.useState)(!1),s=(0,d.useCallback)(()=>{(r.current||[]).forEach(e=>{var t;null==e||null===(t=e.owner)||void 0===t||t.close()}),a(!1)},[]),c=(0,d.useCallback)(()=>{a(!1)},[]);return(0,d.useEffect)(()=>{var o=t.onBeforeUnload(e=>{if(n.getOpenTitles().some(e=>e.saving))return e.preventDefault(),e.stopPropagation(),e.returnValue="",""}),s=e.onModalVisibleChange(e=>{var{type:t,options:n,visible:o=!0}=e;t===m.w8.CLOSE_CONFIRM&&(a(!!o),r.current=n)});return()=>{o.dispose(),s.dispose()}},[]),(0,l.jsx)(ep.u_,{visible:o,type:"dialog",title:ef.o.t("project_ide_unsaved_changes"),okText:ef.o.t("project_ide_quit"),okButtonColor:"red",cancelText:ef.o.t("project_ide_cancel"),onOk:s,onCancel:c,maskClosable:!1,children:(0,l.jsx)("div",{className:tZ.content,children:ef.o.t("project_ide_unsaved_describe")})})},tX=()=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tV,{}),(0,l.jsx)(tY,{})]}),tQ=n("110808"),tG={};tG.styleTagTransform=eM(),tG.setAttributes=eE(),tG.insert=eC().bind(null,"head"),tG.domAPI=eS(),tG.insertStyleElement=eI(),ew()(tQ.Z,tG);var tJ=tQ.Z&&tQ.Z.locals?tQ.Z.locals:void 0;new m.ov("".concat(m.OG,":///session"));var t$=new m.ov("".concat(m.OG,":///variables")),t0=()=>{var e=(0,m.d0)(),t=(0,m.eo)(),n=(0,m.VM)(),[r,o]=(0,d.useState)(!0);(0,d.useCallback)(()=>{e("/session")},[]);var a=(0,d.useCallback)(()=>{e("/variables")},[]);return(0,l.jsxs)("div",{className:tJ["config-container"],children:[(0,l.jsxs)("div",{className:eX()(tJ["primary-sidebar-header"],"h-[".concat(44,"px]")),children:[(0,l.jsx)("div",{className:tJ.title,children:ef.o.t("wf_chatflow_143")}),(0,l.jsx)(ep.hU,{icon:r?(0,l.jsx)(g.Wdl,{className:"coz-fg-primary"}):(0,l.jsx)(g.uDC,{className:"coz-fg-primary"}),color:"secondary",size:"small",onClick:()=>{t&&t.toggleSubWidget(m.KO),o(!r)}})]}),null,(0,l.jsxs)("div",{className:eX()(tJ.item,(0,m.fZ)(null==n?void 0:n.uri,t$)&&tJ.activate),onClick:a,children:[(0,l.jsx)(g.pFl,{className:"coz-fg-plus",style:{marginRight:4}}),ef.o.t("dataide002")]})]})},t1=n("794800"),t2=()=>(0,l.jsx)(ep.ub,{size:"full_screen",icon:(0,l.jsx)(t1.JD,{}),title:"An error occurred",description:"Please try again later."}),t4=n("307765"),t6=[t4.z.Database,t4.z.Dataset,t4.z.Plugin,t4.z.Workflow],t5=e=>{var{spaceId:t,projectId:n}=e,[r,o]=(0,d.useState)(!1),a=(0,m.d0)(),s=(0,m.RX)(m.T_),l=(0,m.RX)(m.cw),{version:c}=(0,m.jo)(),[u]=(0,eG.V)(),h=(0,m.qj)(window.location.pathname);if(r)throw Error("project ide global handler error");var p=(0,x.Un)(e=>e.fetchResource),f=(0,x.Un)(e=>e.refetch),[v,g]=(0,d.useState)(""),[b,y]=(0,d.useState)(""),_=(0,m.CW)("/".concat(x.LC.Workflow,"/").concat(v));return(0,d.useEffect)(()=>{if(!!v)f(e=>{var t,n,r,o=(null==e?void 0:null===(t=e.find(e=>e.groupType===x.ai.Workflow))||void 0===t?void 0:t.resourceList)||[],a=null==o?void 0:null===(n=o.find(e=>e.id===v))||void 0===n?void 0:n.name;a&&_&&(null===(r=_.context.widget)||void 0===r||r.setTitle(a))})},[v,_,b]),(0,m.q9)(e=>{if(!u["bot.automation.project_multi_tab"]||!t6.includes(e.bizType))return;var t,n,r,o=e.operateType===t4.X.Update,a=(null==e?void 0:null===(t=e.extra)||void 0===t?void 0:t.Scene)==="RollbackProject";if(o&&a){window.location.reload();return}var s=e.operateType===t4.X.Create,l=(null==e?void 0:null===(n=e.extra)||void 0===n?void 0:n.methodName)==="CreateWorkflow",c=(null==e?void 0:null===(r=e.extra)||void 0===r?void 0:r.methodName)==="EncapsulateWorkflow";if(s&&(l||c)){f();return}if(!!(null==e?void 0:e.resId))g(null==e?void 0:e.resId),y(new Date().getTime().toString())}),(0,d.useEffect)(()=>{p(t,n,c,e=>{var t,n=(null===(t=(e||[]).find(e=>e.groupType===x.ai.Workflow))||void 0===t?void 0:t.resourceList)||[],r=null==n?void 0:n[0];!h&&l.openFirstWorkflow&&r&&(a("/workflow/".concat(r.id)),l.openFirstWorkflow=!1)})},[t,n]),(0,d.useEffect)(()=>{var e=s.onError(()=>{o(!0)});return()=>{null==e||e.dispose()}},[]),null},t3=n("59955"),t8=()=>{var{projectInfo:e}=ev();return(0,l.jsx)(t3.q,{children:(0,l.jsx)("title",{children:ef.o.t("project_ide_tab_title",{project_name:null==e?void 0:e.name})})})},t9=n("740552"),t7={};t7.styleTagTransform=eM(),t7.setAttributes=eE(),t7.insert=eC().bind(null,"head"),t7.domAPI=eS(),t7.insertStyleElement=eI(),ew()(t9.Z,t7);var ne=t9.Z&&t9.Z.locals?t9.Z.locals:void 0,nt=()=>{var[e,t]=(0,d.useState)(!1),n=(0,m.RX)(el);return((0,d.useEffect)(()=>{var e=n.onStarted(()=>{t(!0)});return()=>e.dispose()},[n]),e)?null:(0,l.jsx)("div",{className:ne["global-loading"],children:(0,l.jsx)(ep.yC,{})})},nn=()=>{var{projectInfo:e}=ev();return(0,l.jsx)(f,{projectInfo:e})},nr=n("981071"),ni={};ni.styleTagTransform=eM(),ni.setAttributes=eE(),ni.insert=eC().bind(null,"head"),ni.domAPI=eS(),ni.insertStyleElement=eI(),ew()(nr.Z,ni),nr.Z&&nr.Z.locals&&nr.Z.locals;var no=n("998486"),na={};na.styleTagTransform=eM(),na.setAttributes=eE(),na.insert=eC().bind(null,"head"),na.domAPI=eS(),na.insertStyleElement=eI(),ew()(no.Z,na),no.Z&&no.Z.locals&&no.Z.locals;var ns=(0,d.memo)(e=>{var{spaceId:t,projectId:n,version:r}=e,o=(0,c.useNavigate)(),a=(0,S.Qb)(S.PL.View,n,t),s=(0,d.useMemo)(()=>({view:{widgetRegistries:[v.Q4,w,y,b,_],secondarySidebar:p,topBar:eZ,primarySideBar:tp,configuration:t0,widgetTitleRender:tb,widgetDefaultRender:tz,widgetFallbackRender:e=>{var{widget:t}=e;return(0,l.jsx)(t2,{})},preToolbar:()=>(0,l.jsx)(tT,{}),toolbar:e=>(0,l.jsx)(tB,{widget:e}),uiBuilder:()=>(0,l.jsx)(nn,{})}}),[]),u=(0,d.useMemo)(()=>[ec({spaceId:t,projectId:n,navigate:o,version:r}),(0,x.X5)()],[t,n,r,o]);if(!a)throw Error("can not view");return(0,l.jsx)(m.X9,{spaceId:t,projectId:n,version:r,children:(0,l.jsxs)(m.Xe,{presetOptions:s,plugins:u,children:[(0,l.jsx)(t8,{}),(0,l.jsx)(tX,{}),(0,l.jsx)(t5,{spaceId:t,projectId:n}),(0,l.jsx)(nt,{})]})})})},297751:function(e,t,n){"use strict";n.d(t,{vp:()=>g,zF:()=>b,TH:()=>v});var r=n("808549"),o=n("120454"),a=n("473980"),s=n("151064"),l=n("455069"),c=n("529801"),d=n("659596"),u=n("392300"),h=n("416290"),p=(0,l.createContext)({showText:!0,setItems:u.Z}),f=(e,t)=>{var{showText:n,setItems:a}=(0,l.useContext)(p),s=(0,h.Z)(t);return(0,l.useEffect)(()=>{a(t=>{var n;return(0,o._)((0,r._)({},t),{[e]:{width:null!==(n=null==s?void 0:s.width)&&void 0!==n?n:0}})})},[null==s?void 0:s.width]),(0,l.useEffect)(()=>()=>{a(t=>(0,c.Z)(t,e))},[]),n},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[n,r]=(0,l.useState)(),o=(0,h.Z)(e),a=Object.getOwnPropertySymbols(n||{}).reduce((e,r,o)=>{var a,s;return e+(null!==(s=null==n?void 0:null===(a=n[r])||void 0===a?void 0:a.width)&&void 0!==s?s:0)+(o>0?t:0)},0),s=!!(null==o?void 0:o.width)&&o.width>=a;return(0,l.useMemo)(()=>({showText:s,setItems:r}),[s])},v=e=>{var{children:t,gap:n=12}=e,r=(0,l.useRef)(null),o=m(r,n);return(0,s.jsx)("div",{ref:r,className:"flex items-center justify-end flex-1 overflow-hidden",style:{gap:n},children:(0,s.jsx)(p.Provider,{value:o,children:t})})},g=(0,l.forwardRef)((e,t)=>{var{itemKey:n,text:u}=e,h=(0,a._)(e,["itemKey","text"]),p=(0,l.useRef)(null),m=f(n,p);return(0,s.jsxs)("span",{ref:t,children:[(0,s.jsx)("div",{className:m?"":"fixed left-[-999px]",ref:p,children:(0,s.jsx)(d.zx,(0,o._)((0,r._)({size:"default",color:"secondary"},m?h:(0,c.Z)(h,"data-testid")),{children:u}))}),!m&&(0,s.jsx)(d.u,{content:u,children:(0,s.jsx)(d.hU,(0,r._)({size:"default",color:"secondary"},h))})]})}),b=(0,l.forwardRef)((e,t)=>{var{itemKey:n,fullContent:r,collapsedContent:o,collapsedTooltip:a}=e,c=(0,l.useRef)(null),u=f(n,c);return(0,s.jsxs)("span",{ref:t,children:[(0,s.jsx)("div",{className:u?"":"fixed left-[-999px]",ref:c,children:r}),!u&&(0,s.jsx)(d.u,{trigger:a?"hover":"custom",content:a,children:(0,s.jsx)("span",{children:o})})]})})},616405:function(e,t,n){"use strict";n.d(t,{kt:()=>u});var r=n("151064"),o=n("336205");n.p;var a=n("122206");a.g.Unknown,o.o.t("coze_premium_credits_cycle_4"),a.g.Never,o.o.t("coze_premium_credits_cycle_4"),a.g.Day,o.o.t("coze_premium_credits_cycle_1"),a.g.Week,o.o.t("coze_premium_credits_cycle_2"),a.g.Month,o.o.t("coze_premium_credits_cycle_3");var s=n("252237"),l=n.n(s),c=n("873183"),d=n("659596");function u(e){var{className:t,monetizeConfig:n,supportPlatforms:a}=e,s=a.map(e=>e.name).join(", ");return(0,r.jsxs)("div",{className:l()("flex justify-end items-center gap-[12px]",t),children:[(0,r.jsxs)("div",{className:"flex items-center gap-[4px]",children:[(0,r.jsx)("span",{className:"font-medium coz-fg-plus",children:"".concat(o.o.t("monetization"),": ").concat(n.is_enable?o.o.t("monetization_publish_on"):o.o.t("monetization_publish_off"))}),(0,r.jsx)(d.u,{content:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("div",{children:n.is_enable?o.o.t("monetization_on_des"):o.o.t("monetization_off_des")}),n.is_enable?(0,r.jsx)("div",{className:"mt-[8px] pt-[8px] border-0 border-t border-solid coz-stroke-primary",children:"".concat(o.o.t("free_chat_allowance")," : ").concat(n.free_chat_allowance_count)}):null]}),children:(0,r.jsx)(c.L03,{className:"w-[16px] h-[16px] coz-fg-secondary"})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-[4px]",children:[(0,r.jsxs)("span",{className:"font-normal coz-fg-tertiary",children:[o.o.t("monetization_support"),":"]}),(0,r.jsx)("span",{className:"flex items-center gap-[4px]",children:a.map(e=>(0,r.jsx)(d.qE,{className:"h-[16px] w-[16px] rounded-[4px]",size:"extra-extra-small",shape:"square",src:e.icon},e.id))}),(0,r.jsx)(d.u,{content:"".concat(o.o.t("monetization_support_tips"),": ").concat(s),children:(0,r.jsx)(c.L03,{className:"w-[16px] h-[16px] coz-fg-secondary"})})]})]})}},319276:function(e,t,n){"use strict";n.d(t,{a2:function(){return o},bQ:function(){return a},pl:function(){return r}});var r="https://lf3-static.bytednsdoc.com/obj/eden-cn/rkzild_lgvj/ljhwZthlaukjlkulzlp/",o="undefined"!=typeof location?location.origin:"https://api.xxx.com",a=e=>""},76313:function(e,t,n){"use strict";n.d(t,{N:()=>l});var r=n("825955"),o=n("455069"),a=n("735114"),s=n("382534"),l=e=>{var{type:t,intelligenceId:n,spaceId:l,enable:c}=e,[d,u]=(0,o.useState)(!1),h=(0,a.Z)((0,r._)(function*(){var e,r;return null===(r=(yield s.sD.PublishIntelligenceList({space_id:l,intelligence_type:t,intelligence_ids:[n],size:1},{__disableErrorToast:!0})).data)||void 0===r?void 0:null===(e=r.intelligences)||void 0===e?void 0:e[0]}),{manual:!0,ready:c,pollingInterval:6e4,pollingErrorRetryCount:3,onSuccess:e=>{e&&h.cancel()},onFinally:()=>{u(!0)}});return(0,o.useEffect)(()=>(u(!1),h.run(),h.cancel),[t,n,l,c]),{inited:d,ready:!!h.data}}},174470:function(e,t,n){"use strict";n.r(t),n.d(t,{usePublishStatus:()=>tJ,useBizConnectorAnchor:()=>eW,PublishButton:()=>t0,ProjectPublish:()=>tX});var r,o,a,s,l,c,d,u,h,p=n("151064"),f=n("455069"),m=n("664319"),v=n("297158"),g=n("659596"),b=n("157728"),y=n("808549"),_=n("120454"),w=n("479910"),x=n("598208"),S=n("61111"),k="10000129",C={connectorList:[],connectorUnionMap:{},selectedConnectorIds:[],showPublishResult:!1,lastVersionNumber:"",versionNumber:"",versionDescription:"",connectorPublishConfig:{},socialPlatformChatflow:{},templateConfigured:!0,connectors:{},unions:{},publishRecordDetail:{},pageLoading:!1},j=(0,x.Ue)()((0,w.mW)((e,t)=>{var n;return(0,_._)((0,y._)({},C),{reset:()=>{e(C)},setMonetizeConfig:t=>e({monetizeConfig:t}),setConnectorList:t=>{e({connectorList:t})},setSelectedConnectorIds:t=>{e({selectedConnectorIds:t})},updateSelectedConnectorIds:t=>{e(e=>({selectedConnectorIds:t(e.selectedConnectorIds)}))},setShowPublishResult:t=>{e({showPublishResult:t})},setProjectPublishInfo:(n=e,(e,t)=>{(null==t?void 0:t.replace)?n(e):n(t=>(0,y._)({},t,e))}),setProjectPublishInfoByImmer:n=>{e({connectorPublishConfig:(0,S.Uy)(t().connectorPublishConfig,n)},!1,"setProjectPublishInfoByImmer")},setPublishRecordDetail:t=>e(e=>({publishRecordDetail:(0,y._)({},e.publishRecordDetail,t)})),resetProjectPublishInfo:()=>{e(C)},exportDraft:e=>{var{versionNumber:n,versionDescription:r,selectedConnectorIds:o,connectorPublishConfig:a,unions:s,socialPlatformChatflow:l}=t();return{projectId:e,versionNumber:n,versionDescription:r,selectedConnectorIds:o,unions:s,sdkConfig:a["999"],socialPlatformConfig:l}}})},{enabled:!1,name:"botStudio.projectPublishStore"})),E=n("298203"),T="coz_project_publish_draft",I=n("825955");var P=((r={})[r.NoBindRequired=1]="NoBindRequired",r[r.AuthBind=2]="AuthBind",r[r.KvBind=3]="KvBind",r[r.KvAuthBind=4]="KvAuthBind",r[r.ApiBind=5]="ApiBind",r[r.WebSDKBind=6]="WebSDKBind",r[r.StoreBind=7]="StoreBind",r[r.AuthAndConfig=8]="AuthAndConfig",r[r.TemplateBind=9]="TemplateBind",r);var M=((o={})[o.APIOrSDK=1]="APIOrSDK",o[o.SocialPlatform=2]="SocialPlatform",o[o.Coze=3]="Coze",o[o.MiniProgram=4]="MiniProgram",o[o.CozeSpaceExtensionLibrary=5]="CozeSpaceExtensionLibrary",o);var R=((a={})[a.Normal=0]="Normal",a[a.InReview=1]="InReview",a[a.Offline=2]="Offline",a),D=n("382534"),A=e=>e.replace(/(\d+)\.(\d+)\.(\d+)/g,(e,t,n,r)=>{var o=parseInt(String(r),10)+1;return"".concat(t,".").concat(n,".").concat(o)}),N=e=>{var{lastPublishVersionNumber:t,draftVersionNumber:n,defaultVersionNumber:r}=e;return t&&!n?A(t):n?n:r};var L=((s={})[s.Configured=1]="Configured",s[s.NotConfigured=2]="NotConfigured",s[s.Disconnected=3]="Disconnected",s[s.Configuring=4]="Configuring",s[s.NeedReconfiguring=5]="NeedReconfiguring",s);var z=((l={})[l.Default=0]="Default",l[l.Auditing=1]="Auditing",l[l.Success=2]="Success",l[l.Failed=3]="Failed",l[l.Disable=4]="Disable",l);var O=((c={})[c.Packing=0]="Packing",c[c.PackFailed=1]="PackFailed",c[c.Auditing=2]="Auditing",c[c.AuditNotPass=3]="AuditNotPass",c[c.ConnectorPublishing=4]="ConnectorPublishing",c[c.PublishDone=5]="PublishDone",c),B=e=>{var{bind_type:t,config_status:n}=e;return[P.KvBind,P.AuthBind,P.KvAuthBind,P.TemplateBind].includes(t)&&n===L.NotConfigured},W=e=>{var{allow_publish:t}=e,n=B(e);return n||!t};function F(){return(F=(0,I._)(function*(e,t,n){var{setProjectPublishInfo:r,setSelectedConnectorIds:o,setMonetizeConfig:a}=j.getState();r({pageLoading:!0});try{var s,l,c=function(e){var t=h.find(t=>t.id===e);if(!t||W(t))return"continue";t.connector_union_id?g.push(t.connector_union_id):g.push(t.id),b[t.id]=t.bind_info},[d,u]=yield Promise.all([D.sD.PublishConnectorList({project_id:e}),Promise.resolve(void 0)]),{connector_list:h=[],last_publish_info:p={},connector_union_info_map:f={}}=null!==(I=d.data)&&void 0!==I?I:{},{connector_ids:m=[],connector_publish_config:v={}}=p,g=[],b={};for(var y of m)c(y);var _={};for(var[w,x]of Object.entries(f))_[w]=null!==(R=null===(P=x.connector_options.find(e=>m.includes(e.connector_id)))||void 0===P?void 0:P.connector_id)&&void 0!==R?R:x.connector_options[0].connector_id;if(null==n?void 0:null===(C=n.socialPlatformConfig)||void 0===C?void 0:null===(k=C.selected_workflows)||void 0===k?void 0:k[0].workflow_id)A=n.socialPlatformConfig;else for(var S of h){if(!!g.includes(S.id)&&S.connector_classification===M.SocialPlatform){var k,C,E,T,I,P,R,A,L,z=v[S.id];if(null==z?void 0:null===(L=z.selected_workflows)||void 0===L?void 0:L[0].workflow_id){A=z;break}}}(null==n?void 0:null===(T=n.sdkConfig)||void 0===T?void 0:null===(E=T.selected_workflows)||void 0===E?void 0:E[0].workflow_id)&&(v["999"]=n.sdkConfig),o(null!==(s=null==n?void 0:n.selectedConnectorIds)&&void 0!==s?s:g);var O=p.version_number,B=N({lastPublishVersionNumber:O,draftVersionNumber:null==n?void 0:n.versionNumber,defaultVersionNumber:"v0.0.1"});r({lastVersionNumber:O,versionNumber:B,versionDescription:null==n?void 0:n.versionDescription,connectorPublishConfig:v,connectorList:h,connectorUnionMap:f,connectors:b,unions:null!==(l=null==n?void 0:n.unions)&&void 0!==l?l:_,socialPlatformChatflow:A}),a(null==u?void 0:u.data)}catch(e){t(e)}finally{r({pageLoading:!1})}})).apply(this,arguments)}var H=n("59955"),U=n("735114"),V=n("336205"),K=n("873183");function q(e){var t,n,r=e.publish_status===O.PackFailed||e.publish_status===O.AuditNotPass,o=null!==(n=null===(t=e.connector_publish_result)||void 0===t?void 0:t.every(e=>e.connector_publish_status===z.Auditing||e.connector_publish_status===z.Failed||e.connector_publish_status===z.Success))&&void 0!==n&&n;return r||o}var Z=(0,f.createContext)({getContainerRef:()=>null,publishHeaderHeight:0,setPublishHeaderHeight:()=>0}),Y=()=>(0,f.useContext)(Z);function X(){var e,t,n=(0,b.useNavigate)(),r=(0,g.XQ)(),{space_id:o="",project_id:a=""}=(0,b.useParams)(),s=()=>n("/space/".concat(o,"/project-ide/").concat(a)),{connectorList:l,showPublishResult:c,setShowPublishResult:d,versionDescription:u,versionNumber:h,connectors:v,unions:y,connectorPublishConfig:_,socialPlatformChatflow:w,selectedConnectorIds:x,setPublishRecordDetail:S}=j((0,m.N)(e=>({connectorList:e.connectorList,showPublishResult:e.showPublishResult,setShowPublishResult:e.setShowPublishResult,versionNumber:e.versionNumber,versionDescription:e.versionDescription,connectors:e.connectors,unions:e.unions,connectorPublishConfig:e.connectorPublishConfig,socialPlatformChatflow:e.socialPlatformChatflow,selectedConnectorIds:e.selectedConnectorIds,setPublishRecordDetail:e.setPublishRecordDetail}))),[k,C]=(0,f.useState)(!1),{publishHeaderHeight:E,setPublishHeaderHeight:T}=Y();var{run:P,cancel:R}=(0,U.Z)((e=(0,I._)(function*(e){return yield D.sD.GetPublishRecordDetail(e)}),function(t){return e.apply(this,arguments)}),{pollingInterval:3e3,pollingWhenHidden:!1,pollingErrorRetryCount:3,manual:!0,onSuccess:e=>{(null==e?void 0:e.data)?(S(e.data),q(e.data)&&R(),!c&&d(!0)):R()},onError:()=>{R()}});var A=(t=(0,I._)(function*(){if(c)s();else try{if(C(!0),yield r.validate(),!x.length){g.FN.error(V.o.t("publish_tooltip_select_platform"));return}var e={},t={};x.forEach(n=>{var r,o,a,s=null!==(o=y[n])&&void 0!==o?o:n;e[s]=null!==(a=v[s])&&void 0!==a?a:{},(null===(r=l.find(e=>e.id===s))||void 0===r?void 0:r.connector_classification)===M.SocialPlatform?t[s]=w:_[s]&&(t[s]=_[s])});var{data:n}=yield D.sD.PublishProject({project_id:a,version_number:h,description:u,connectors:e,connector_publish_config:t});S({publish_monetization_result:null==n?void 0:n.publish_monetization_result}),(null==n?void 0:n.publish_record_id)&&P({publish_record_id:n.publish_record_id,project_id:a})}catch(e){"string"==typeof Object.values(e)[0]&&g.FN.error(Object.values(e)[0])}finally{C(!1)}}),function(){return t.apply(this,arguments)});return(0,p.jsxs)("div",{className:"sticky top-0 z-[100] coz-bg-primary overflow-y-hidden",style:{height:E},children:[(0,p.jsx)(H.q,{children:(0,p.jsx)("title",{children:V.o.t("Publish")})}),(0,p.jsxs)("div",{className:"flex p-[16px] justify-between items-center coz-stroke-primary border-b border-x-0 border-t-0 border-solid pl-2",children:[(0,p.jsxs)("div",{className:"flex items-center",children:[(0,p.jsx)(g.hU,{icon:(0,p.jsx)(K.$1i,{className:"h-[18px] w-[18px]"}),color:"secondary",iconSize:"large",onClick:s}),(0,p.jsx)("span",{className:"ml-[8px] font-medium text-[20px]",children:V.o.t("Publish")})]}),(0,p.jsx)(g.zx,{onClick:A,loading:k,"data-testid":"project.publish",children:c?V.o.t("bot_publish_success_back"):V.o.t("Publish")})]}),(0,p.jsx)(g.jL,{type:"info",description:V.o.t("project_release_notify"),onClose:()=>{T(65)}})]})}var Q=n("252237"),G=n.n(Q),J=n("28260"),$=n("189284"),ee=n("76313");var et=((d={})[d.Plugin=1]="Plugin",d[d.Workflow=2]="Workflow",d[d.Imageflow=3]="Imageflow",d[d.Knowledge=4]="Knowledge",d[d.UI=5]="UI",d[d.Prompt=6]="Prompt",d[d.Database=7]="Database",d[d.Variable=8]="Variable",d),en=n("319276"),er=n("193893"),ei=n("407821"),eo=n.n(ei),ea=n("472772"),es=n.n(ea),el=n("395245"),ec=n.n(el),ed=n("297998"),eu=n.n(ed),eh=n("646576"),ep=n.n(eh),ef=n("606121"),em=n.n(ef),ev=n("727683"),eg={};eg.styleTagTransform=em(),eg.setAttributes=eu(),eg.insert=ec().bind(null,"head"),eg.domAPI=es(),eg.insertStyleElement=ep(),eo()(ev.Z,eg);var eb=ev.Z&&ev.Z.locals?ev.Z.locals:void 0;function ey(e){var{index:t}=e;return(0,p.jsx)("div",{className:"w-[20px] h-[20px] rounded-full inline-flex items-center justify-center mr-[4px] coz-mg-primary",children:(0,p.jsx)("span",{className:"font-medium coz-fg-secondary",children:t})})}function e_(){var[e,t]=(0,f.useState)(!1),[n,r]=(0,f.useState)(""),o=()=>t(!1);return{node:(0,p.jsxs)(g.u_,{title:V.o.t("app_publish_sdk_title"),closable:!0,visible:e,width:640,onCancel:o,footer:(0,p.jsx)(g.zx,{onClick:o,children:V.o.t("app_publish_sdk_confirm")}),zIndex:2e3,children:[(0,p.jsxs)(g.ZT.Paragraph,{className:"font-medium mb-[8px]",children:[(0,p.jsx)(ey,{index:1}),V.o.t("app_publish_sdk_step_1",{doc_link:(0,p.jsx)(g.ZT.Text,{link:{href:"/docs/developer_guides/oauth_apps",target:"_blank"},children:V.o.t("app_publish_sdk_step_1_doc")})})]}),(0,p.jsxs)(g.ZT.Paragraph,{className:"font-medium mb-[8px]",children:[(0,p.jsx)(ey,{index:2}),V.o.t("app_publish_sdk_step_2")]}),(0,p.jsx)(er.HK,{className:eb["web-sdk-guide"],markDown:n}),(0,p.jsxs)(g.ZT.Paragraph,{className:"font-medium mb-[8px]",children:[(0,p.jsx)(ey,{index:3}),V.o.t("app_publish_sdk_step_3")]})]}),show:e=>{r(function(e){var{projectId:t,workflowId:n,version:r=""}=e;return"```html\n\n${'```'}`;\n}\n\nfunction ListIndex({ index }: { index: number }) {\n return (\n
\n {index}\n
\n );\n}\n\nexport function useWebSdkGuideModal() {\n const [visible, setVisible] = useState(false);\n const [scriptTagMd, setScriptTagMd] = useState('');\n\n const show = (params: WebSdkGuideParams) => {\n const md = getWebSdkScriptTagMD(params);\n setScriptTagMd(md);\n setVisible(true);\n };\n const close = () => setVisible(false);\n\n const node = (\n {I18n.t('app_publish_sdk_confirm')}\n }\n // z-index requires a Popover greater than publish-status.\n zIndex={2000}\n >\n \n \n {I18n.t('app_publish_sdk_step_1', {\n doc_link: (\n \n {I18n.t('app_publish_sdk_step_1_doc')}\n \n ),\n })}\n \n \n \n {I18n.t('app_publish_sdk_step_2')}\n \n \n \n \n {I18n.t('app_publish_sdk_step_3')}\n \n \n );\n\n return { node, show };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Tag, type TagProps, Typography } from '@coze-arch/coze-design';\n\nexport interface PublishStepTitleProps {\n title: string;\n tag?: string;\n color?: TagProps['color'];\n}\n\nexport function PublishStepTitle({ title, tag, color }: PublishStepTitleProps) {\n return (\n
\n \n {title}\n \n {typeof tag === 'string' ? (\n \n {tag}\n \n ) : null}\n
\n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n IconCozCheckMarkCircle,\n IconCozClock,\n IconCozClockFill,\n IconCozCrossCircle,\n IconCozWarningCircle,\n type OriginIconProps,\n} from '@coze-arch/coze-design/icons';\nimport { type StepProps } from '@coze-arch/coze-design';\n\nexport interface PublishStepIconProps {\n status: StepProps['status'] | 'warn';\n}\n\nexport function PublishStepIcon({ status }: PublishStepIconProps) {\n const iconProps: Pick = {\n width: '16px',\n height: '16px',\n };\n switch (status) {\n case 'wait':\n return ;\n case 'process':\n return ;\n case 'finish':\n return (\n \n );\n case 'warn':\n return (\n \n );\n case 'error':\n return ;\n default:\n return null;\n }\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type publish,\n ConnectorPublishStatus,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';\nimport {\n CozAvatar,\n Tag,\n type TagProps,\n Typography,\n} from '@coze-arch/coze-design';\n\nimport {\n MINI_PROGRAM_DOUYIN_DOWNLOAD_CONNECTOR_ID,\n MINI_PROGRAM_WECHAT_DOWNLOAD_CONNECTOR_ID,\n WEB_SDK_CONNECTOR_ID,\n} from '@/utils/constants';\n\nfunction getMiniProgramGuideUrl(connectorId?: string) {\n switch (connectorId) {\n case MINI_PROGRAM_DOUYIN_DOWNLOAD_CONNECTOR_ID:\n return '/docs/guides/publish_app_to_douyin_microapp';\n case MINI_PROGRAM_WECHAT_DOWNLOAD_CONNECTOR_ID:\n return '/docs/guides/publish_app_to_wechat_mini_program';\n default:\n return '';\n }\n}\n\nexport interface ConnectorStatusProps {\n result: publish.ConnectorPublishResult;\n showTag?: boolean;\n onShowWebSdkGuide?: (workflowId: string) => void;\n}\n\nconst ConnectorTagMap: Record<\n ConnectorPublishStatus,\n (Pick & { text: I18nKeysNoOptionsType }) | null\n> = {\n [ConnectorPublishStatus.Default]: {\n color: 'brand',\n text: 'project_releasing',\n },\n [ConnectorPublishStatus.Auditing]: {\n color: 'brand',\n text: 'under_review',\n },\n [ConnectorPublishStatus.Failed]: {\n color: 'red',\n text: 'project_release_failed',\n },\n [ConnectorPublishStatus.Success]: {\n color: 'green',\n text: 'project_release_success',\n },\n [ConnectorPublishStatus.Disable]: null, // The corresponding state will not be returned to the front end and will not be adapted.\n};\n\nexport function ConnectorStatus({\n result,\n showTag,\n onShowWebSdkGuide,\n}: ConnectorStatusProps) {\n const tagConfig = ConnectorTagMap[result.connector_publish_status ?? 0];\n // When the Web SDK channel is successfully released, the installation instructions will be displayed\n const shouldShowWebSdkGuide =\n result.connector_id === WEB_SDK_CONNECTOR_ID &&\n result.connector_publish_status === ConnectorPublishStatus.Success;\n const workflowId =\n result.connector_publish_config?.selected_workflows?.[0]?.workflow_id;\n const showWebSdkGuide = () => onShowWebSdkGuide?.(workflowId ?? '');\n return (\n \n \n \n {result.connector_name}\n \n {showTag !== false && tagConfig ? (\n \n {I18n.t(tagConfig.text)}\n \n ) : null}\n
\n {result.connector_publish_status_msg ? (\n \n {result.connector_publish_status_msg}\n \n ) : null}\n {/* Web SDK Channel - Installation Guide */}\n {shouldShowWebSdkGuide ? (\n \n {I18n.t('project_release_guide')}\n \n ) : null}\n {/* Mini Program Channel - Download Code & Installation Guide */}\n {result.download_link ? (\n <>\n \n {I18n.t('project_release_download_code')}\n \n \n {I18n.t('project_release_guide')}\n \n \n ) : null}\n {result.share_link ? (\n \n {I18n.t('project_release_open_in_store')}\n \n ) : null}\n
\n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useParams } from 'react-router-dom';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\n\nimport {\n ConnectorPublishStatus,\n type PublishRecordDetail,\n PublishRecordStatus,\n ResourceType,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { IconCozPlugin, IconCozWorkflow } from '@coze-arch/coze-design/icons';\nimport {\n type StepProps,\n Steps,\n TagGroup,\n Typography,\n} from '@coze-arch/coze-design';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { type UITagProps } from '@coze-arch/bot-semi';\n\nimport { useWebSdkGuideModal } from '@/web-sdk-guide';\nimport { WEB_SDK_CONNECTOR_ID } from '@/utils/constants';\nimport { type ProjectPublishStore } from '@/store';\n\nimport { PublishStepTitle } from './components/publish-step-title';\nimport { PublishStepIcon } from './components/publish-step-icon';\nimport {\n ConnectorStatus,\n type ConnectorStatusProps,\n} from './components/connector-status';\n\nfunction getDefaultStepProps(title: string): StepProps {\n return {\n icon: ,\n title: ,\n };\n}\n\nfunction toPackStepProps(\n record: PublishRecordDetail,\n tagGroupRef: React.RefObject,\n maxTagCount?: number,\n): StepProps {\n const title = I18n.t('project_release_package');\n if (typeof record.publish_status !== 'number') {\n return getDefaultStepProps(title);\n }\n switch (record.publish_status) {\n case PublishRecordStatus.Packing: {\n return {\n icon: ,\n title: (\n \n ),\n };\n }\n case PublishRecordStatus.PackFailed: {\n const tags: UITagProps[] | undefined =\n record.publish_status_detail?.pack_failed_detail?.map(item => ({\n tagKey: item.entity_id,\n className: 'pack-status-tag',\n prefixIcon:\n item.entity_type === ResourceType.Workflow ? (\n \n ) : (\n \n ),\n children: item.entity_name,\n }));\n return {\n icon: ,\n title: (\n \n ),\n description: tags ? (\n
\n \n {I18n.t('project_release_pack_fail_reason')}\n \n \n
\n ) : null,\n };\n }\n default: {\n return {\n icon: ,\n title: (\n \n ),\n };\n }\n }\n}\n\nfunction PackStep(props: { record: PublishRecordDetail }) {\n const ref = useRef(null);\n const [maxTagCount, setMaxTagCount] = useState(undefined);\n const stepProps = toPackStepProps(props.record, ref, maxTagCount);\n\n /**\n * TagGroup only supports setting maxTagCount to control the number of display tags, not the number of display rows.\n * Here, the number of rows it is in is determined by iterating over the offsetTop of all Tags, and maxTagCount\n * Set to just enough to display the number of two rows.\n */\n useLayoutEffect(() => {\n if (!ref.current) {\n return;\n }\n const tags = ref.current.getElementsByClassName(\n 'pack-status-tag',\n ) as HTMLCollectionOf;\n if (tags.length <= 0) {\n return;\n }\n let top = -1;\n let rowCount = 0;\n for (let i = 0; i < tags.length; i++) {\n const tagTop = tags[i].offsetTop;\n if (top !== tagTop) {\n top = tagTop;\n rowCount++;\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers -- offsetTop The third change, the current Tag is in the third line\n if (rowCount >= 3) {\n setMaxTagCount(i);\n break;\n }\n }\n }\n }, [props.record.publish_status_detail?.pack_failed_detail]);\n\n return ;\n}\n\nfunction toAuditStepProps(record: PublishRecordDetail): StepProps {\n const title = I18n.t('project_release_coze_audit');\n if (typeof record.publish_status !== 'number') {\n return getDefaultStepProps(title);\n }\n switch (record.publish_status) {\n case PublishRecordStatus.Packing:\n case PublishRecordStatus.PackFailed: {\n return getDefaultStepProps(title);\n }\n case PublishRecordStatus.Auditing: {\n return {\n status: 'process',\n icon: ,\n title: (\n \n ),\n };\n }\n case PublishRecordStatus.AuditNotPass: {\n return {\n status: 'error',\n icon: ,\n title: (\n \n ),\n };\n }\n default: {\n return {\n status: 'finish',\n icon: ,\n title: (\n \n ),\n };\n }\n }\n}\n\nfunction getConnectorsPublishStatus(\n record: ProjectPublishStore['publishRecordDetail'],\n) {\n const connectorResults = record.connector_publish_result ?? [];\n if (connectorResults.length <= 0) {\n return 'wait';\n }\n const failedCount = connectorResults.filter(\n item => item.connector_publish_status === ConnectorPublishStatus.Failed,\n ).length;\n if (failedCount > 0) {\n // All channels failed with a red cross; some channels failed with a yellow exclamation mark\n return failedCount === connectorResults.length ? 'error' : 'warn';\n }\n const publishingCount = connectorResults.filter(\n item =>\n item.connector_publish_status === ConnectorPublishStatus.Default ||\n item.connector_publish_status === ConnectorPublishStatus.Auditing,\n ).length;\n if (publishingCount > 0) {\n // Some channels are in the release, showing the clock icon.\n return 'process';\n }\n return 'finish';\n}\n\nfunction toPublishStepProps(\n record: ProjectPublishStore['publishRecordDetail'],\n onShowWebSdkGuide: ConnectorStatusProps['onShowWebSdkGuide'],\n): StepProps {\n const title = I18n.t('project_release_channel');\n if (typeof record.publish_status !== 'number') {\n return getDefaultStepProps(title);\n }\n // The \"Channel Review and Publish\" step has not been reached, the default gray clock icon is displayed\n if (record.publish_status < PublishRecordStatus.ConnectorPublishing) {\n return {\n ...getDefaultStepProps(title),\n description: record.connector_publish_result?.map(item => (\n \n )),\n };\n }\n return {\n icon: ,\n title: (\n \n ),\n description: record.connector_publish_result?.map(item => (\n \n )),\n };\n}\n\nfunction PublishStep(props: { record: PublishRecordDetail }) {\n const { project_id = '' } = useParams();\n const { node, show: showWebSdkGuideModal } = useWebSdkGuideModal();\n const onShowWebSdkGuide = (workflowId: string) =>\n showWebSdkGuideModal({\n projectId: project_id,\n workflowId,\n version: props.record.connector_publish_result?.find(\n item => item.connector_id === WEB_SDK_CONNECTOR_ID,\n )?.connector_bind_info?.sdk_version,\n });\n const stepProps = toPublishStepProps(props.record, onShowWebSdkGuide);\n return (\n <>\n \n {node}\n \n );\n}\n\nexport interface ProjectPublishProgressProps {\n record: ProjectPublishStore['publishRecordDetail'];\n}\n\nexport function ProjectPublishProgress({\n record,\n}: ProjectPublishProgressProps) {\n return (\n \n \n \n \n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { NavLink } from 'react-router-dom';\nimport { type FC } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { IntelligenceType } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { useFlags } from '@coze-arch/bot-flags';\nimport { useIsPublishRecordReady } from '@coze-studio/publish-manage-hooks';\nimport { IconCozCheckMarkCircle } from '@coze-arch/coze-design/icons';\n\nimport { useProjectPublishStore } from '../store';\nimport { ProjectPublishProgress } from '../publish-progress';\n\nexport const PublishRecord: FC<{\n projectId: string;\n spaceId: string;\n}> = ({ projectId, spaceId }) => {\n const { publishRecordDetail } = useProjectPublishStore(\n useShallow(state => ({\n publishRecordDetail: state.publishRecordDetail,\n })),\n );\n\n const [FLAGS] = useFlags();\n\n const { ready, inited } = useIsPublishRecordReady({\n type: IntelligenceType.Project,\n spaceId,\n intelligenceId: projectId,\n // Support soon, so stay tuned.\n enable: FLAGS['bot.studio.publish_management'] && !IS_OPEN_SOURCE,\n });\n\n return (\n
\n
\n \n
\n {I18n.t('project_release_already_released')}\n
\n
\n {I18n.t('project_release_already_released_desc')}\n
\n {/* Support soon, so stay tuned. */}\n {FLAGS['bot.studio.publish_management'] && !IS_OPEN_SOURCE ? (\n
\n {I18n.t('release_management_detail1', {\n button: (\n {\n if (!ready) {\n e.preventDefault();\n }\n }}\n to={`/space/${spaceId}/publish/app/${projectId}`}\n >\n {I18n.t('release_management')}\n {ready || !inited\n ? null\n : `(${I18n.t('release_management_generating')})`}\n \n ),\n })}\n
\n ) : null}\n
\n\n
\n \n
\n
\n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable max-lines-per-function */\nimport { type RefObject, useEffect, useRef, useState } from 'react';\n\nimport { useDebounceFn } from 'ahooks';\nimport { ConnectorClassification } from '@coze-arch/idl/intelligence_api';\n\nimport { usePublishContainer } from '../../context/publish-container-context';\n\nexport type ConnectorRefMap = Record<\n ConnectorClassification,\n RefObject\n>;\n\nconst useConnectorRefMap = (): ConnectorRefMap => ({\n [ConnectorClassification.APIOrSDK]: useRef(null),\n [ConnectorClassification.MiniProgram]: useRef(null),\n [ConnectorClassification.SocialPlatform]: useRef(null),\n [ConnectorClassification.Coze]: useRef(null),\n [ConnectorClassification.CozeSpaceExtensionLibrary]:\n useRef(null),\n});\n\nconst getActiveConnectorTarget = ({\n containerScrollTop,\n connectorRefMap,\n connectorBarHeight,\n publishHeaderHeight,\n}: {\n containerScrollTop: number;\n connectorBarHeight: number;\n connectorRefMap: ConnectorRefMap;\n publishHeaderHeight: number;\n}) => {\n const connectorTargetLis = Object.entries(connectorRefMap)\n .map(([, ref]) => ref.current)\n .filter((element): element is HTMLDivElement => Boolean(element));\n\n const offsetTopList = connectorTargetLis.map(target => ({\n offsetTop:\n target.offsetTop -\n containerScrollTop -\n publishHeaderHeight -\n connectorBarHeight,\n target,\n }));\n\n const sortedTopList = offsetTopList.sort(\n (prev, cur) => prev.offsetTop - cur.offsetTop,\n );\n const preActiveConnectorList = sortedTopList.filter(\n item => item.offsetTop <= 0,\n );\n const activeConnector = preActiveConnectorList.length\n ? preActiveConnectorList.at(-1)\n : sortedTopList.at(0);\n\n return activeConnector?.target;\n};\n/** experience point */\nconst LOCK_TIME = 300;\n\nexport const useConnectorScroll = () => {\n const [activeConnectorTarget, setActiveConnectorTarget] =\n useState();\n const connectorBarRef = useRef(null);\n\n const { getContainerRef } = usePublishContainer();\n\n const connectorRefMap = useConnectorRefMap();\n\n const { publishHeaderHeight } = usePublishContainer();\n\n const [animationStateMap, setAnimationMap] = useState<\n Record\n >({\n [ConnectorClassification.APIOrSDK]: false,\n [ConnectorClassification.MiniProgram]: false,\n [ConnectorClassification.SocialPlatform]: false,\n [ConnectorClassification.Coze]: false,\n [ConnectorClassification.CozeSpaceExtensionLibrary]: false,\n });\n\n /**\n * All three conditions need to be met simultaneously\n * 1. As the page scrolls to different anchors, the tab bar activates the button for the corresponding area\n * 2. Click the tab bar, activate the corresponding button, and scroll directly to the corresponding area of the page\n * 3. When the page height is insufficient to scroll, click the tab bar to activate the corresponding button\n *\n * Since the scroll is a smooth effect, conditions 2 and 3 will conflict, and the lock needs to be performed when the user clicks the tab bar to scroll.\n * Condition 1 does not fire when locked\n * Need to give condition 3 an unlocking mechanism with a bottom line\n */\n const manualScrollLockRef = useRef(false);\n\n const manualScrollLock = () => {\n manualScrollLockRef.current = true;\n };\n\n const manualScrollUnLock = () => {\n manualScrollLockRef.current = false;\n };\n\n /** Unlock after LOCK_TIME */\n const manualScrollUnLockDebounce = useDebounceFn(manualScrollUnLock, {\n wait: LOCK_TIME,\n });\n\n /** The bottom unlocking mechanism, if the user clicks the tab bar but does not unlock the LOCK_TIME should also be unlocked */\n const baseUnLockDebounce = useDebounceFn(manualScrollUnLock, {\n wait: LOCK_TIME,\n });\n\n useEffect(() => {\n const containerTarget = getContainerRef()?.current;\n const connectorBarTarget = connectorBarRef.current;\n if (!containerTarget || !connectorBarTarget) {\n return;\n }\n const changeActiveConnectorTarget = () => {\n if (manualScrollLockRef.current) {\n return;\n }\n setActiveConnectorTarget(\n getActiveConnectorTarget({\n containerScrollTop: containerTarget.scrollTop,\n connectorRefMap,\n connectorBarHeight: connectorBarTarget.offsetHeight,\n publishHeaderHeight,\n }),\n );\n };\n\n changeActiveConnectorTarget();\n\n const onScroll = () => {\n // If the page scrolls, no safety net mechanism is required\n baseUnLockDebounce.cancel();\n manualScrollUnLockDebounce.run();\n changeActiveConnectorTarget();\n };\n\n containerTarget.addEventListener('scroll', onScroll);\n return () => {\n containerTarget.removeEventListener('scroll', onScroll);\n };\n }, [getContainerRef, connectorRefMap, publishHeaderHeight]);\n\n const startAnimation = (classification: ConnectorClassification) => {\n setAnimationMap(prev => ({ ...prev, [classification]: true }));\n };\n\n const closeAnimation = (classification: ConnectorClassification) => {\n setAnimationMap(prev => ({ ...prev, [classification]: false }));\n };\n\n const scrollToConnector = (classification: ConnectorClassification) => {\n const barTarget = connectorBarRef.current;\n const containerTarget = getContainerRef()?.current;\n const connectorTarget = connectorRefMap[classification].current;\n if (!barTarget || !containerTarget || !connectorTarget) {\n return;\n }\n\n containerTarget.scrollTo({\n behavior: 'smooth',\n top:\n connectorTarget.offsetTop -\n publishHeaderHeight -\n barTarget.offsetHeight,\n });\n startAnimation(classification);\n setActiveConnectorTarget(connectorTarget);\n manualScrollLock();\n baseUnLockDebounce.run();\n };\n\n return {\n connectorRefMap,\n activeConnectorTarget,\n connectorBarRef,\n scrollToConnector,\n closeAnimation,\n animationStateMap,\n };\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod';\nimport { produce } from 'immer';\nimport { typeSafeJSONParse } from '@coze-arch/bot-utils';\n\nconst publishAnchorDataSchema = z.object({\n projectId: z.string(),\n connectorIdBeforeRedirect: z.string(),\n});\n\nconst publishAnchorSchema = z.record(publishAnchorDataSchema);\n\ntype PublishAnchorData = z.infer;\n\ntype PublishAnchorType = z.infer;\n\nclass PublishAnchorService {\n private PUBLISH_ANCHOR_KEY = 'coz_project_publish_anchor';\n anchorValues: PublishAnchorType = {};\n\n private load = () => {\n try {\n const stringifyLocalData = localStorage.getItem(this.PUBLISH_ANCHOR_KEY);\n const localData = typeSafeJSONParse(stringifyLocalData);\n const validData = publishAnchorSchema.parse(localData);\n // Using zod to type-check localData\n this.anchorValues = validData;\n } catch {\n this.anchorValues = {};\n }\n };\n\n private save = () => {\n localStorage.setItem(\n this.PUBLISH_ANCHOR_KEY,\n JSON.stringify(this.anchorValues),\n );\n };\n\n setAnchor: (params: {\n userId: string;\n projectId: string;\n connectorId: string;\n }) => void = ({ userId, projectId, connectorId }) => {\n this.anchorValues = produce(this.anchorValues, draft => {\n draft[userId] = {\n projectId,\n connectorIdBeforeRedirect: connectorId,\n };\n });\n this.save();\n };\n getAnchor: (params: {\n userId: string;\n projectId: string;\n }) => PublishAnchorData | undefined = ({ userId, projectId }) => {\n const userData = this.anchorValues[userId];\n if (userData?.projectId === projectId) {\n return userData;\n }\n };\n\n removeAnchor: (params: { userId: string; projectId: string }) => void = ({\n userId,\n projectId,\n }) => {\n const hasAnchor = Boolean(this.getAnchor({ userId, projectId }));\n if (!hasAnchor) {\n return;\n }\n delete this.anchorValues[userId];\n this.save();\n };\n\n clearAll = () => {\n localStorage.removeItem(this.PUBLISH_ANCHOR_KEY);\n this.anchorValues = {};\n };\n\n constructor() {\n this.load();\n }\n}\n\nexport const publishAnchorService = new PublishAnchorService();\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useUserInfo } from '@coze-arch/foundation-sdk';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { useParams } from 'react-router-dom';\n\nimport { publishAnchorService } from '@/service/connector-anchor';\n\nexport const useBizConnectorAnchor = () => {\n const userId = useUserInfo()?.user_id_str;\n const projectId = useParams().project_id;\n\n const setAnchor = (connectorId: string) => {\n if (!userId || !projectId) {\n return;\n }\n return publishAnchorService.setAnchor({ projectId, userId, connectorId });\n };\n\n const getAnchor = () => {\n if (!userId || !projectId) {\n return;\n }\n return publishAnchorService.getAnchor({ userId, projectId });\n };\n\n const removeAnchor = () => {\n if (!userId || !projectId) {\n return;\n }\n return publishAnchorService.removeAnchor({ userId, projectId });\n };\n\n return {\n setAnchor,\n getAnchor,\n removeAnchor,\n };\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect } from 'react';\n\nimport { useProjectPublishStore } from '@/store';\nimport { useBizConnectorAnchor } from '@/hooks/use-biz-connector-anchor';\n\nimport { type ConnectorGroup } from '../utils/format-connector-groups';\nimport { usePublishContainer } from '../../context/publish-container-context';\nimport { type ConnectorRefMap } from './use-connector-scroll';\n\nexport const useAutoScrollToConnector = ({\n connectorGroupList,\n connectorRefMap,\n}: {\n connectorRefMap: ConnectorRefMap;\n connectorGroupList: ConnectorGroup[];\n}) => {\n const { getAnchor, removeAnchor } = useBizConnectorAnchor();\n const { getContainerRef } = usePublishContainer();\n\n useEffect(() => {\n const anchor = getAnchor();\n\n if (!anchor) {\n return;\n }\n\n const targetGroup = connectorGroupList.find(group =>\n group.connectors.some(\n connector => connector.id === anchor.connectorIdBeforeRedirect,\n ),\n );\n\n if (!targetGroup) {\n return;\n }\n\n const connectorRef = connectorRefMap[targetGroup.type];\n const { updateSelectedConnectorIds } = useProjectPublishStore.getState();\n updateSelectedConnectorIds(prev => {\n if (prev.some(id => id === anchor.connectorIdBeforeRedirect)) {\n return prev;\n }\n return prev.concat(anchor.connectorIdBeforeRedirect);\n });\n getContainerRef()?.current?.scrollTo({\n top: connectorRef.current?.offsetTop,\n behavior: 'smooth',\n });\n\n removeAnchor();\n }, [connectorGroupList, connectorRefMap]);\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useRequest } from 'ahooks';\nimport { type CheckType, WorkflowMode } from '@coze-arch/idl/workflow_api';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { workflowApi } from '@coze-arch/bot-api';\nimport { useParams } from 'react-router-dom';\n\nexport interface ChatflowOptionProps {\n value: string;\n label: string;\n disabled?: boolean;\n tooltip?: string;\n}\n\nexport function useChatflowOptions(checkType?: CheckType) {\n const needsCheck = typeof checkType !== 'undefined';\n const { space_id = '', project_id = '' } = useParams();\n const { data: chatflowOptions, loading } = useRequest(async () => {\n const res = await workflowApi.GetWorkFlowList({\n space_id,\n project_id,\n flow_mode: WorkflowMode.ChatFlow,\n page: 1,\n size: 100,\n checker: needsCheck ? [checkType] : undefined,\n });\n return res.data.workflow_list?.map(item => ({\n label: item.name,\n value: item.workflow_id,\n disabled: needsCheck\n ? item.check_result?.find(r => r.type === checkType)?.is_pass !== true\n : false,\n tooltip: item.check_result?.find(r => r.type === checkType)?.reason,\n })) as ChatflowOptionProps[];\n });\n return { chatflowOptions, loading };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type PropsWithChildren } from 'react';\n\nimport classNames from 'classnames';\nimport { IconCozCheckMarkFill } from '@coze-arch/coze-design/icons';\nimport {\n type optionRenderProps,\n Tooltip,\n Typography,\n} from '@coze-arch/coze-design';\n\nexport type OptionWithTooltipProps = PropsWithChildren<{\n option: optionRenderProps;\n tooltip?: string;\n}>;\n\nexport function OptionWithTooltip({\n option,\n tooltip,\n children,\n}: OptionWithTooltipProps) {\n const optionNode = (\n \n
\n {option.selected ? (\n \n ) : null}\n
\n {children ?? (\n \n {option.label}\n \n )}\n \n );\n return tooltip ? (\n \n {optionNode}\n \n ) : (\n optionNode\n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { CheckType } from '@coze-arch/idl/workflow_api';\nimport { ConnectorClassification } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { FormSelect, type optionRenderProps } from '@coze-arch/coze-design';\n\nimport { useProjectPublishStore } from '@/store';\n\nimport {\n type ChatflowOptionProps,\n useChatflowOptions,\n} from '../hooks/use-chatflow-options';\nimport { OptionWithTooltip } from './option-with-tooltip';\n\nexport const SocialPlatformChatflow: React.FC<{ className?: string }> = ({\n className,\n}) => {\n const {\n connectorList,\n selectedConnectorIds,\n socialPlatformChatflow,\n setProjectPublishInfo,\n } = useProjectPublishStore(\n useShallow(state => ({\n connectorList: state.connectorList,\n selectedConnectorIds: state.selectedConnectorIds,\n socialPlatformChatflow: state.socialPlatformChatflow,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n const hasSelectedSocialPlatforms = connectorList.some(\n c =>\n selectedConnectorIds.includes(c.id) &&\n c.connector_classification === ConnectorClassification.SocialPlatform,\n );\n\n const { chatflowOptions } = useChatflowOptions(CheckType.SocialPublish);\n\n const handleSelectChatflow = (option: ChatflowOptionProps) => {\n setProjectPublishInfo({\n socialPlatformChatflow: {\n selected_workflows: [\n {\n workflow_id: option.value,\n workflow_name: option.label,\n },\n ],\n },\n });\n };\n\n return (\n
\n (\n \n )}\n onSelect={(_: unknown, option: unknown) =>\n handleSelectChatflow(option as ChatflowOptionProps)\n }\n rules={[\n // Chatflow is required when SocialPlatform is selected\n { required: hasSelectedSocialPlatforms },\n // Verify that the selected chatflow exists & & is not disabled\n {\n validator: (_rule: unknown, value: unknown) => {\n if (!hasSelectedSocialPlatforms) {\n return true;\n }\n const selected = chatflowOptions?.find(\n option => option.value === (value as string),\n );\n if (!selected) {\n return new Error(I18n.t('project_release_chatflow3'));\n }\n if (selected.disabled) {\n return new Error(selected.tooltip);\n }\n return true;\n },\n },\n ]}\n />\n
\n );\n};\n","\n import API from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type CSSProperties, forwardRef, type PropsWithChildren } from 'react';\n\nimport classNames from 'classnames';\nimport { Badge, Button } from '@coze-arch/coze-design';\n\nimport styles from './index.module.less';\n\nexport interface TabbarItemProps {\n onClick: () => void;\n isActive: boolean;\n selectedConnectorCount: number;\n}\nexport const ConnectorTabbarItem: React.FC<\n PropsWithChildren\n> = ({ onClick, isActive, children, selectedConnectorCount }) => (\n \n {children}\n {selectedConnectorCount > 0 ? (\n \n ) : null}\n \n);\n\nexport interface ConnectorTabbarProps {\n className?: string;\n style?: CSSProperties;\n}\n\nexport const ConnectorTabbar = forwardRef<\n HTMLDivElement,\n PropsWithChildren\n>(({ className, style, children }, ref) => (\n \n {children}\n \n));\n","\n import API from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./connector-group-header.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./connector-group-header.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type AnimationEventHandler } from 'react';\n\nimport classNames from 'classnames';\nimport { ConnectorClassification } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport {\n IconCozInfoCircle,\n IconCozDiamondFill,\n} from '@coze-arch/coze-design/icons';\nimport { Tooltip, Space } from '@coze-arch/coze-design';\nimport {\n useBenefitAvailable,\n PremiumPaywallScene,\n usePremiumPaywallModal,\n} from '@coze-studio/premium-components-adapter';\n\nimport styles from './connector-group-header.module.less';\n\ninterface ConnectorGroupHeaderProps {\n label: string;\n tooltipContent: string;\n showTooltipInfo: boolean;\n isHighlight: boolean;\n type: ConnectorClassification;\n onAnimationEnd: AnimationEventHandler;\n}\n\nexport function ConnectorGroupHeader({\n label,\n tooltipContent,\n showTooltipInfo,\n isHighlight,\n type,\n onAnimationEnd,\n}: ConnectorGroupHeaderProps) {\n // paywall\n const isAPIOrSDK = type === ConnectorClassification.APIOrSDK;\n const isAvailable = useBenefitAvailable({\n scene: PremiumPaywallScene.API,\n });\n const { node: premiumPaywallModal, open: openPremiumPaywallModal } =\n usePremiumPaywallModal({ scene: PremiumPaywallScene.API });\n\n return (\n \n

{label}

\n {isAPIOrSDK && !isAvailable ? (\n \n \n {I18n.t('coze_quota_exemption_notice', {\n link: (\n \n {I18n.t('coze_upgrade_package')}\n \n ),\n })}\n \n ) : null}\n {showTooltipInfo ? (\n \n \n \n ) : null}\n {premiumPaywallModal}\n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type StoreBindKey } from '@/store';\n\ntype SelfMapping = {\n [K in T]: K; // Key syntax: Mapping each literal type to itself\n};\n\ntype KeyMapping = SelfMapping;\n\nexport const isStoreBindConfigured = (\n config: Record,\n): boolean => {\n // Prevent StoreBindKey changes from causing bugs\n const { category_id, display_screen }: KeyMapping = {\n category_id: 'category_id',\n display_screen: 'display_screen',\n };\n return Boolean(config[category_id]) && Boolean(config[display_screen]);\n};\n","import baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport baseUniq from './_baseUniq.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nexport default union;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable complexity */\n/* eslint-disable @coze-arch/max-line-per-function */\nimport { useParams } from 'react-router-dom';\nimport { useState, useRef } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport { debounce, union, find } from 'lodash-es';\nimport { useInfiniteScroll } from 'ahooks';\nimport {\n CheckType,\n WorkflowMode,\n type Workflow,\n} from '@coze-arch/idl/workflow_api';\nimport {\n type PublishConnectorInfo,\n ConnectorConfigStatus,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { IconCozInfoCircle, IconCozEmpty } from '@coze-arch/coze-design/icons';\nimport {\n Modal,\n Search,\n Checkbox,\n Divider,\n Spin,\n Tooltip,\n Space,\n EmptyState,\n} from '@coze-arch/coze-design';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { workflowApi } from '@coze-arch/bot-api';\n\nimport { useProjectPublishStore } from '@/store';\n\nexport interface DataList {\n list: Workflow[];\n hasMore?: boolean;\n nextCursorId?: string;\n total: number;\n nextPageIndex: number;\n}\n\nconst debounceTimer = 500;\n\nexport const UseMcpConfigModal = ({\n record,\n}: {\n record: PublishConnectorInfo;\n}) => {\n const [visible, setVisible] = useState(false);\n const [searchVal, setSearchVal] = useState('');\n const [checkedList, setCheckedList] = useState([]);\n const { space_id = '', project_id = '' } = useParams();\n\n const {\n connectorPublishConfig,\n setProjectPublishInfo,\n connectorList,\n selectedConnectorIds,\n } = useProjectPublishStore(\n useShallow(state => ({\n connectorPublishConfig: state.connectorPublishConfig,\n setProjectPublishInfo: state.setProjectPublishInfo,\n connectorList: state.connectorList,\n selectedConnectorIds: state.selectedConnectorIds,\n })),\n );\n\n const containerRef = useRef(null);\n\n const { loading, data, loadingMore } = useInfiniteScroll(\n async d => {\n const res = await workflowApi.GetWorkFlowList({\n space_id,\n project_id,\n flow_mode: WorkflowMode.All,\n checker: [CheckType.MCPPublish],\n size: 15,\n page: d?.nextPageIndex ?? 1,\n name: searchVal,\n });\n return {\n list: res.data?.workflow_list ?? [],\n total: Number(res.data?.total ?? 0),\n nextPageIndex: (d?.nextPageIndex || 1) + 1,\n };\n },\n {\n target: containerRef,\n reloadDeps: [searchVal],\n isNoMore: dataSource =>\n Boolean(\n !dataSource?.total ||\n (dataSource.nextPageIndex - 1) * 15 >= dataSource.total,\n ),\n },\n );\n\n // Only undisabled workflows can be selected.\n const filterPassList = data?.list?.filter(\n item =>\n find(item?.check_result, {\n type: CheckType.MCPPublish,\n })?.is_pass,\n );\n //Half selection state\n const indeterminate =\n checkedList.length > 0 &&\n checkedList.length < (filterPassList?.length || 0);\n //Select All\n const checkAll = checkedList.length === (filterPassList?.length || 0);\n\n const close = () => {\n setVisible(false);\n };\n\n const handleConfirm = () => {\n setProjectPublishInfo({\n connectorPublishConfig: {\n ...connectorPublishConfig,\n [record.id]: {\n selected_workflows: checkedList.map(item => {\n const res = find(data?.list, {\n workflow_id: item,\n });\n return {\n workflow_id: res?.workflow_id,\n workflow_name: res?.name,\n };\n }),\n },\n },\n connectorList: connectorList.map(item => {\n if (item.id === record.id) {\n return {\n ...item,\n config_status: ConnectorConfigStatus.Configured,\n };\n }\n return item;\n }),\n selectedConnectorIds: union(selectedConnectorIds, [record.id]), //ID merge deduplicate\n });\n close();\n };\n\n return {\n open: () => {\n setVisible(true);\n const ids = connectorPublishConfig?.[record.id]?.selected_workflows;\n setCheckedList(ids?.map(item => item.workflow_id ?? '') ?? []);\n },\n close,\n node: (\n \n
\n {I18n.t('app_publish_connector_space_mcp_config_dialog_desc')}\n
\n \n
\n {I18n.t('app_publish_connector_space_mcp_config_dialog_desc2')}\n
\n\n \n {I18n.t(\n 'app_publish_connector_space_mcp_config_dialog_hover_wf_constraints',\n )}\n \n }\n >\n \n \n
\n
\n {I18n.t('app_publish_connector_space_mcp_config_dialog_choose_wf')}\n *\n
\n
\n
\n {\n setSearchVal(v);\n }, debounceTimer)}\n />\n
\n\n \n\n
\n {data?.list.length ? (\n {\n setCheckedList(\n e.target.checked\n ? filterPassList?.map(item => item.workflow_id || '') ||\n []\n : [],\n );\n }}\n >\n {I18n.t(\n 'app_publish_connector_space_mcp_config_dialog_filter_all',\n )}\n \n ) : null}\n \n \n {data?.list?.map(option => {\n const mcpOpt = find(option?.check_result, {\n type: CheckType.MCPPublish,\n });\n return (\n \n {mcpOpt?.is_pass ? (\n option.name\n ) : (\n \n {option.name}\n \n )}\n \n );\n })}\n \n\n {/* Loading */}\n {loadingMore && data?.list.length ? (\n
\n \n
\n ) : null}\n\n {/* empty state */}\n {!data?.list.length ? (\n }\n title={I18n.t(\n 'app_publish_connector_space_mcp_config_dialog_no_results_found',\n )}\n />\n ) : null}\n
\n
\n \n \n ),\n };\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type PublishConnectorInfo,\n ConnectorConfigStatus,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { Button } from '@coze-arch/coze-design';\n\nimport { UseMcpConfigModal } from '@/hooks/use-mcp-config-modal';\n\n/** MCP configuration button + pop-up window */\nexport const McpConfigBtn = ({ record }: { record: PublishConnectorInfo }) => {\n const { node, open } = UseMcpConfigModal({ record });\n return (\n {\n e.stopPropagation();\n }}\n >\n {\n open();\n }}\n >\n {record.config_status === ConnectorConfigStatus.Configured\n ? I18n.t('enterprise_sso_seetings_page_desc_button1')\n : I18n.t('bot_publish_action_configure')}\n \n {node}\n \n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useShallow } from 'zustand/react/shallow';\nimport { type PublishConnectorInfo } from '@coze-arch/idl/intelligence_api';\nimport { FormSelect } from '@coze-arch/coze-design';\nimport { IconCozArrowDown } from '@coze-arch/bot-icons';\n\nimport { useProjectPublishStore } from '@/store';\n\ninterface UnionSelectProps {\n record: PublishConnectorInfo;\n}\n\nexport const UnionSelect = ({ record }: UnionSelectProps) => {\n const { connectorUnionMap, unions, setProjectPublishInfo } =\n useProjectPublishStore(\n useShallow(state => ({\n connectorUnionMap: state.connectorUnionMap,\n unions: state.unions,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n const unionId = record.connector_union_id ?? '';\n const unionConnectors = connectorUnionMap[unionId]?.connector_options ?? [];\n const unionOptionList = unionConnectors.map(c => ({\n label: c.show_name,\n value: c.connector_id,\n }));\n\n const onSelectUnion = (selectedId: string) => {\n setProjectPublishInfo({\n unions: {\n ...unions,\n [unionId]: selectedId,\n },\n });\n };\n\n return (\n
e.stopPropagation()}>\n }\n onSelect={(val: unknown) => onSelectUnion(val as string)}\n />\n
\n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type MouseEventHandler } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { type PublishConnectorInfo } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { FormSelect, type optionRenderProps } from '@coze-arch/coze-design';\n\nimport { useProjectPublishStore } from '@/store';\nimport {\n type ChatflowOptionProps,\n useChatflowOptions,\n} from '@/publish-main/hooks/use-chatflow-options';\n\nimport { OptionWithTooltip } from '../option-with-tooltip';\n\nexport interface WebSdkBindProps {\n checked: boolean;\n record: PublishConnectorInfo;\n onClick: MouseEventHandler;\n}\n\nexport function WebSdkBind({ checked, record, onClick }: WebSdkBindProps) {\n const { connectorPublishConfig, setProjectPublishInfo } =\n useProjectPublishStore(\n useShallow(state => ({\n connectorPublishConfig: state.connectorPublishConfig,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n const lastSelectedChatflow =\n connectorPublishConfig?.[record.id]?.selected_workflows?.[0]?.workflow_id;\n\n const { chatflowOptions } = useChatflowOptions();\n\n const handleChatflowSelect = (option: ChatflowOptionProps) => {\n setProjectPublishInfo({\n connectorPublishConfig: {\n ...connectorPublishConfig,\n [record.id]: {\n selected_workflows: [\n {\n workflow_id: option.value,\n workflow_name: option.label,\n },\n ],\n },\n },\n });\n };\n\n const removePublishConfig = () => {\n useProjectPublishStore.getState().setProjectPublishInfoByImmer(draft => {\n const target = draft[record.id];\n if (!target?.selected_workflows) {\n return;\n }\n delete target.selected_workflows;\n });\n };\n\n return (\n
\n (\n \n )}\n // onChange is responsible for handling the logic of data emptying\n // onSelect handles data selection logic\n onChange={values => {\n if (typeof values !== 'undefined') {\n return;\n }\n removePublishConfig();\n }}\n onSelect={(_: unknown, option: unknown) =>\n handleChatflowSelect(option as ChatflowOptionProps)\n }\n rules={[\n {\n required: checked,\n message: I18n.t('project_release_Please_select'),\n },\n // Verify that the selected chatflow exists & & is not disabled\n {\n validator: (_rule: unknown, value: unknown) => {\n if (!checked) {\n return true;\n }\n const selected = chatflowOptions?.find(\n option => option.value === (value as string),\n );\n if (!selected) {\n return new Error(I18n.t('project_release_chatflow3'));\n }\n if (selected.disabled) {\n return new Error(selected.tooltip);\n }\n return true;\n },\n },\n ]}\n />\n
\n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UIPreviewType } from '@coze-arch/idl/product_api';\nimport { type UIOption } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\n\nexport enum DisplayScreen {\n Web = 'web',\n Mobile = 'mobile',\n}\n\nexport interface DisplayScreenOption {\n label: string;\n value: DisplayScreen;\n disabled?: boolean;\n tooltip?: string;\n}\n\nexport function toDisplayScreenOption(uiOption: UIOption): DisplayScreenOption {\n const publicProps = {\n disabled: uiOption.available === false,\n tooltip: uiOption.unavailable_reason,\n };\n if (uiOption.ui_channel === UIPreviewType.Web.toString()) {\n return {\n value: DisplayScreen.Web,\n label: I18n.t('builder_canvas_tools_pc'),\n ...publicProps,\n };\n }\n return {\n value: DisplayScreen.Mobile,\n label: I18n.t('builder_canvas_tools_phone'),\n ...publicProps,\n };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ProductStatus, type EntityInfoData } from '@coze-arch/idl/product_api';\nimport { type UIOption } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { type FileItem } from '@coze-arch/bot-semi/Upload';\n\nimport {\n type DisplayScreen,\n toDisplayScreenOption,\n} from '@/publish-main/utils/display-screen-option';\n\nexport interface TemplateBindInfo {\n title: string;\n cover_uri: string;\n description: string;\n readme: string;\n display_screen: DisplayScreen;\n category_id: string;\n [k: string]: string;\n}\n\nexport interface TemplateForm {\n agreement: boolean;\n name: string;\n covers: Partial[];\n description: string;\n // EditorFullInput plain text form value, only to meet the type requirements, not used in business\n readme_text: string;\n // The editor-kit rich text content that actually needs to be passed to the backend\n readme: string;\n preview_type: DisplayScreen;\n category: string;\n}\n\nfunction stringToDeltaSet(str?: string) {\n if (!str) {\n return '';\n }\n return `{\"0\":{\"ops\":[{\"insert\":\"${str}\\\\n\"}],\"zoneId\":\"0\",\"zoneType\":\"Z\"}}`;\n}\n\nexport function entityInfoToTemplateForm(\n info: EntityInfoData,\n uiOption?: UIOption,\n): Partial {\n const isZh = I18n.language.startsWith('zh');\n const meta = info.meta_info ?? {};\n const form: Partial = {\n // By default, check Agree to the template payment agreement: already on the shelves, or already configured template information (readme is not empty)\n agreement: meta.status !== ProductStatus.NeverListed || meta.readme !== '',\n name: meta.name,\n covers: meta.covers?.map(c => ({\n url: c.url,\n response: c,\n // Supplements other properties of FileItem for form validation\n status: 'success',\n _sizeInvalid: false,\n })),\n description: meta.description?.substring(0, isZh ? 100 : 300),\n readme: meta.readme || stringToDeltaSet(meta.description),\n category: meta.category?.id,\n };\n if (uiOption) {\n form.preview_type = toDisplayScreenOption(uiOption).value;\n }\n return form;\n}\n\nexport function templateFormToBindInfo(form: TemplateForm): TemplateBindInfo {\n return {\n title: form.name,\n cover_uri: form.covers?.[0].response?.uri ?? '',\n description: form.description,\n readme: form.readme,\n display_screen: form.preview_type,\n category_id: form.category ?? '',\n };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AxiosError } from 'axios';\nimport { type UploadProps } from '@coze-arch/coze-design';\nimport { upLoadFile } from '@coze-arch/bot-utils';\nimport { ProductApi } from '@coze-arch/bot-api';\n\nfunction fileToBase64(file: File): Promise {\n return new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = event => {\n const result = event.target?.result;\n if (typeof result === 'string') {\n resolve(result.slice(result.indexOf(',') + 1));\n } else {\n reject(new Error('readAsDataURL failed'));\n }\n };\n fileReader.readAsDataURL(file);\n });\n}\n\nexport const uploadCustomRequest: UploadProps['customRequest'] = async args => {\n const { fileInstance, onProgress, onSuccess, onError } = args;\n try {\n if (!fileInstance) {\n throw new Error('no file to upload');\n }\n const result = await ProductApi.PublicUploadImage(\n { data: await fileToBase64(fileInstance) },\n {\n onUploadProgress: e =>\n onProgress({ total: e.total ?? fileInstance.size, loaded: e.loaded }),\n },\n );\n onSuccess(result.data);\n } catch (e) {\n if (e instanceof AxiosError) {\n onError(e.request);\n } else {\n onError({});\n }\n }\n};\n\nexport const uploadCustomRequestImageX: UploadProps['customRequest'] =\n async args => {\n const { fileInstance, onProgress, onSuccess, onError } = args;\n try {\n if (!fileInstance) {\n throw new Error('no file to upload');\n }\n const uri = await upLoadFile({\n biz: 'store',\n file: fileInstance,\n fileType: 'image',\n getUploadAuthToken: async () => {\n const { data } = await ProductApi.PublicGetImageUploadToken();\n return {\n data: {\n service_id: data?.service_id || '',\n upload_host: data?.upload_host || '',\n auth: {\n current_time: data?.current_time || '',\n expired_time: data?.expired_time || '',\n session_token: data?.session_token || '',\n access_key_id: data?.access_key_id || '',\n secret_access_key: data?.secret_access_key || '',\n },\n },\n };\n },\n getProgress: progress => {\n onProgress({ total: fileInstance.size, loaded: progress });\n },\n });\n const res = await ProductApi.PublicGetImageURL({ uri });\n onSuccess({ uri, url: res.data?.url });\n } catch (e) {\n if (e instanceof AxiosError) {\n onError(e.request);\n } else {\n onError({});\n }\n }\n };\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useRequest } from 'ahooks';\nimport { type ProductEntityType } from '@coze-arch/bot-api/product_api';\nimport { ProductApi } from '@coze-arch/bot-api';\n\nexport interface CategoryOptions {\n label: string;\n value: string;\n}\n\nexport function useProductCategoryOptions(entityType: ProductEntityType) {\n const { data: categoryOptions, loading } = useRequest(async () => {\n const res = await ProductApi.PublicGetProductCategoryList({\n need_empty_category: true,\n entity_type: entityType,\n });\n return res.data?.categories?.map(item => ({\n label: item.name,\n value: item.id,\n })) as CategoryOptions[];\n });\n return { categoryOptions, loading };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AvatarName } from '@coze-studio/components';\nimport { type UserInfo } from '@coze-arch/idl/product_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { IconCozImage } from '@coze-arch/coze-design/icons';\nimport { Image, Typography } from '@coze-arch/coze-design';\n\nexport interface TemplatePreviewCardProps {\n userInfo?: UserInfo;\n cover?: string;\n name?: string;\n description?: string;\n}\n\n// Basically copied packages/studio/template/pages/src/components/template-list-card/index.tsx\nexport function TemplatePreviewCard({\n userInfo,\n cover,\n name,\n description,\n}: TemplatePreviewCardProps) {\n const userLabel = userInfo?.user_label\n ? {\n name: userInfo.user_label.label_name,\n icon: userInfo.user_label.icon_url,\n href: userInfo.user_label.jump_link,\n }\n : undefined;\n\n return (\n
\n
\n }\n />\n
\n\n
\n
\n \n {name ?? I18n.t('project_release_template_info_name')}\n \n
\n\n \n\n
\n \n {description ?? I18n.t('project_release_template_info_desc')}\n \n
\n
\n
\n );\n}\n","\n import API from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n forwardRef,\n useImperativeHandle,\n useRef,\n useState,\n Suspense,\n} from 'react';\n\nimport classNames from 'classnames';\nimport { ProductEntityType, type UserInfo } from '@coze-arch/idl/product_api';\nimport { type PublishConnectorInfo } from '@coze-arch/idl/intelligence_api';\nimport { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';\nimport { typeSafeJSONParse } from '@coze-arch/bot-utils';\nimport { useFlags } from '@coze-arch/bot-flags';\nimport {\n LazyEditorFullInput,\n DeltaSet,\n type DeltaSetOptions,\n type Editor,\n EditorEventType,\n normalizeSchema,\n} from '@coze-common/md-editor-adapter';\nimport { IconCozPlus } from '@coze-arch/coze-design/icons';\nimport {\n type FileItem,\n Form,\n FormInput,\n FormSelect,\n Typography,\n type optionRenderProps,\n} from '@coze-arch/coze-design';\n\nimport {\n uploadCustomRequest,\n uploadCustomRequestImageX,\n} from '@/utils/upload-custom-request';\nimport { toDisplayScreenOption } from '@/publish-main/utils/display-screen-option';\nimport { useProductCategoryOptions } from '@/publish-main/hooks/use-product-category-options';\n\nimport { OptionWithTooltip } from '../../option-with-tooltip';\nimport { type TemplateForm } from './types';\nimport { TemplatePreviewCard } from './template-preview-card';\n\nimport s from './index.module.less';\n\nfunction getRequiredRules(type: I18nKeysNoOptionsType) {\n return [\n {\n required: true,\n message: I18n.t('project_release_template_info_not', {\n template_info_type: I18n.t(type),\n }),\n },\n ];\n}\n\nexport interface TemplateConfigFormRef {\n fillInitialValues: (values: Partial) => void;\n validate: () => Promise | undefined;\n}\n\nexport interface TemplateConfigFormProps {\n record: PublishConnectorInfo;\n userInfo?: UserInfo;\n}\n\nexport const TemplateConfigForm = forwardRef<\n TemplateConfigFormRef,\n TemplateConfigFormProps\n // eslint-disable-next-line @coze-arch/max-line-per-function\n>(({ record, userInfo }, ref) => {\n const [FLAGS] = useFlags();\n // Support soon, so stay tuned.\n const customRequest = FLAGS['bot.studio.project_publish_imagex']\n ? uploadCustomRequestImageX\n : uploadCustomRequest;\n const uiChannelOptions = record.UIOptions?.map(toDisplayScreenOption) ?? [];\n const formRef = useRef>(null);\n const [formValues, setFormValues] = useState>({});\n const editorRef = useRef();\n const onEditorInit = (editor: Editor) => {\n editorRef.current = editor;\n // EditorFullInput's form value is plain text, but here you need to submit editor-kit rich text content\n editor.on(EditorEventType.CONTENT_CHANGE, _ => {\n formRef.current?.formApi?.setValue(\n 'readme',\n JSON.stringify(editor.getContent().deltas),\n );\n });\n };\n const { categoryOptions } = useProductCategoryOptions(\n ProductEntityType.TemplateCommon,\n );\n\n useImperativeHandle(ref, () => ({\n fillInitialValues: values => {\n const formApi = formRef.current?.formApi;\n if (!formApi) {\n return;\n }\n formApi.setValues(values, { isOverride: true });\n const readme = typeSafeJSONParse(values.readme);\n if (readme) {\n editorRef.current?.setContent(\n new DeltaSet(normalizeSchema(readme as DeltaSetOptions)),\n );\n }\n // @ts-expect-error -- values is the TemplateForm type\n Object.keys(values).forEach(key => formApi.setError(key, null));\n },\n validate: () => formRef.current?.formApi?.validate(),\n }));\n\n const isZh = I18n.language.startsWith('zh');\n\n return (\n \n ref={formRef}\n className={classNames('flex gap-[24px]', s['template-form'])}\n onValueChange={values => setFormValues({ ...values })}\n >\n
\n \n \n (value as boolean) === true,\n message: I18n.t('template_buy_paid_agreement_toast'),\n },\n ]}\n >\n \n {I18n.t('template_buy_paid_agreement_action')}\n \n {I18n.t('template_buy_paid_agreement_detail')}\n \n \n \n
\n
\n
\n \n \n (value as FileItem[] | undefined)?.every(\n item => !item._sizeInvalid && item.status === 'success',\n ) === true,\n message: '', // Verify whether the file size meets the limit & & whether the upload was successful, the Upload component will display an error message\n },\n ]}\n >\n \n \n \n \n \n \n (\n \n )}\n fieldClassName=\"w-full\"\n className=\"w-full\"\n rules={getRequiredRules('project_release_template_info_display')}\n />\n \n
\n \n );\n});\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// @File open source version does not support template channel binding for future expansion\nimport { useParams } from 'react-router-dom';\nimport { type MouseEventHandler, useEffect, useRef, useState } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { ProductEntityType, type UserInfo } from '@coze-arch/idl/product_api';\nimport { type PublishConnectorInfo } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { ProductApi } from '@coze-arch/bot-api';\nimport { Button, Modal } from '@coze-arch/coze-design';\n\nimport { useProjectPublishStore } from '@/store';\n\nimport {\n entityInfoToTemplateForm,\n type TemplateForm,\n templateFormToBindInfo,\n} from './types';\nimport {\n TemplateConfigForm,\n type TemplateConfigFormRef,\n} from './template-config-form';\n\ninterface TemplateBindProps {\n record: PublishConnectorInfo;\n onClick: MouseEventHandler;\n}\n\nexport function TemplateBind({\n record,\n onClick: inputOnClick,\n}: TemplateBindProps) {\n const [modalVisible, setModalVisible] = useState(false);\n const [userInfo, setUserInfo] = useState();\n const templateConfigForm = useRef(null);\n const [savedValues, setSavedValues] = useState>();\n\n const { connectors, setProjectPublishInfo } = useProjectPublishStore(\n useShallow(state => ({\n connectors: state.connectors,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n\n const { project_id = '' } = useParams();\n\n // Backfill template configuration\n const fillTemplateFrom = async () => {\n const productInfo = await ProductApi.PublicGetProductEntityInfo({\n entity_id: project_id,\n entity_type: ProductEntityType.ProjectTemplate,\n });\n if (productInfo.data.meta_info?.name) {\n const formValues = entityInfoToTemplateForm(\n productInfo.data,\n record.UIOptions?.find(item => item.available),\n );\n setSavedValues(formValues);\n setProjectPublishInfo({\n templateConfigured: formValues.agreement === true,\n connectors: {\n ...connectors,\n // @ts-expect-error can accept Partial\n [record.id]: templateFormToBindInfo(formValues),\n },\n });\n }\n if (productInfo.data.meta_info?.user_info) {\n setUserInfo(productInfo.data.meta_info.user_info);\n }\n };\n\n useEffect(() => {\n fillTemplateFrom();\n }, []);\n\n const showModal = () => {\n templateConfigForm.current?.fillInitialValues(savedValues ?? {});\n setModalVisible(true);\n };\n const closeModal = () => {\n setModalVisible(false);\n };\n\n const handleSubmit = async () => {\n const formValues = await templateConfigForm.current?.validate();\n if (!formValues) {\n return;\n }\n setSavedValues(formValues);\n setProjectPublishInfo({\n templateConfigured: true,\n connectors: {\n ...connectors,\n [record.id]: templateFormToBindInfo(formValues),\n },\n });\n closeModal();\n };\n\n return (\n \n \n \n \n \n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// @File open source version does not support store channel binding for future expansion\nimport { type MouseEventHandler } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { type PublishConnectorInfo } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { ProductEntityType } from '@coze-arch/bot-api/product_api';\nimport { FormSelect, type optionRenderProps } from '@coze-arch/coze-design';\n\nimport { type StoreBindKey, useProjectPublishStore } from '@/store';\nimport { toDisplayScreenOption } from '@/publish-main/utils/display-screen-option';\nimport { useProductCategoryOptions } from '@/publish-main/hooks/use-product-category-options';\n\nimport { OptionWithTooltip } from '../option-with-tooltip';\n\nexport interface StoreBindProps {\n checked: boolean;\n record: PublishConnectorInfo;\n onClick: MouseEventHandler;\n}\n\nexport const StoreBind = ({\n checked,\n record,\n onClick: inputOnClick,\n}: StoreBindProps) => {\n const { bind_info, id = '', UIOptions } = record;\n const displayScreenOptions = UIOptions?.map(toDisplayScreenOption) ?? [];\n const defaultDisplayScreen = bind_info?.display_screen;\n const { connectors, setProjectPublishInfo } = useProjectPublishStore(\n useShallow(state => ({\n connectors: state.connectors,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n\n const { categoryOptions } = useProductCategoryOptions(ProductEntityType.Bot);\n\n const handleSelect = (key: StoreBindKey, value: string) => {\n setProjectPublishInfo({\n connectors: {\n ...connectors,\n [id]: {\n ...bind_info,\n ...connectors[id],\n [key]: value,\n },\n },\n });\n };\n\n return (\n \n (\n \n )}\n rules={[{ required: checked }]}\n onSelect={(value: unknown) =>\n handleSelect('display_screen', value as string)\n }\n />\n \n handleSelect('category_id', value as string)\n }\n />\n \n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type MouseEventHandler } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport {\n ConnectorBindType,\n type PublishConnectorInfo,\n ConnectorConfigStatus,\n ConnectorStatus,\n} from '@coze-arch/idl/intelligence_api';\nimport { KvBindButton } from '@coze-agent-ide/space-bot/component/connector-action';\nimport { AuthorizeButton } from '@coze-agent-ide/space-bot/component/authorize-button';\n\nimport { TEMPLATE_CONNECTOR_ID } from '@/utils/constants';\n\nimport { useProjectPublishStore } from '../../store';\nimport { useBizConnectorAnchor } from '../../hooks/use-biz-connector-anchor';\nimport { WebSdkBind } from './bind-actions/web-sdk-bind';\nimport { TemplateBind } from './bind-actions/template-bind';\nimport { StoreBind } from './bind-actions/store-bind';\n// import { ApiBind } from './bind-actions/api-bind';\n\ninterface ConnectorActionProps {\n record: PublishConnectorInfo;\n checked: boolean;\n authActionWrapperClassName?: string;\n}\nexport function ConnectorAction(props: ConnectorActionProps) {\n const { record, checked, authActionWrapperClassName } = props;\n\n const { setProjectPublishInfo, connectorList, selectedConnectorIds } =\n useProjectPublishStore(\n useShallow(state => ({\n setProjectPublishInfo: state.setProjectPublishInfo,\n connectorList: state.connectorList,\n selectedConnectorIds: state.selectedConnectorIds,\n })),\n );\n\n const { setAnchor } = useBizConnectorAnchor();\n const stopEventPropagation: MouseEventHandler = mouseEvent => {\n mouseEvent.stopPropagation();\n };\n\n // The bind/unbind is the same callback, which can be distinguished by whether the bind_id is empty or not\n const kvBindSuccessCallback = (value?: PublishConnectorInfo) => {\n if (value) {\n const isUnbind = !value.bind_id;\n const newValue: PublishConnectorInfo = {\n ...value,\n config_status: isUnbind\n ? ConnectorConfigStatus.NotConfigured\n : ConnectorConfigStatus.Configured,\n connector_status: isUnbind\n ? ConnectorStatus.Normal\n : value.connector_status,\n };\n setProjectPublishInfo({\n connectorList: connectorList.map(item =>\n item.id === value.id ? newValue : item,\n ),\n });\n }\n };\n\n const authRevokeSuccess = () => {\n setProjectPublishInfo({\n connectorList: connectorList.map(item => {\n if (item.id === record.id) {\n return {\n ...item,\n config_status: ConnectorConfigStatus.NotConfigured,\n };\n }\n return item;\n }),\n selectedConnectorIds: selectedConnectorIds.filter(\n item => item !== record.id,\n ),\n });\n };\n\n switch (record.bind_type) {\n case ConnectorBindType.KvBind:\n case ConnectorBindType.KvAuthBind:\n return (\n // Force flex row wrap with basis-full\n \n
\n \n
\n \n );\n case ConnectorBindType.AuthBind:\n return (\n \n
\n {\n setAnchor(id);\n }}\n revokeSuccess={authRevokeSuccess}\n authInfo={record?.auth_login_info ?? {}}\n isV2\n v2ButtonProps={{\n color: 'primary',\n size: 'small',\n }}\n />\n
\n \n );\n case ConnectorBindType.WebSDKBind:\n return (\n \n );\n // The open-source version does not support store channel binding for the time being, for future expansion\n case ConnectorBindType.StoreBind:\n return (\n \n );\n // The open-source version does not support template channel binding for future expansion\n // bind_type = 9 is used as the logo of the first-party channel of the button, and the binding method needs to be displayed according to the channel ID.\n // TODO backend updates ConnectorBindType type definition\n case ConnectorBindType.TemplateBind: {\n if (record.id === TEMPLATE_CONNECTOR_ID) {\n return ;\n }\n return null;\n }\n default:\n return null;\n }\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ConnectorBindType,\n ConnectorConfigStatus,\n type PublishConnectorInfo,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { type TagProps } from '@coze-arch/coze-design';\n\ninterface ConfigStatusUI {\n text: string;\n color: TagProps['color'];\n}\n\nexport const getConfigStatus = (\n record: PublishConnectorInfo,\n): ConfigStatusUI => {\n const { bind_type } = record;\n\n if (\n bind_type === ConnectorBindType.KvBind ||\n bind_type === ConnectorBindType.KvAuthBind ||\n bind_type === ConnectorBindType.TemplateBind\n ) {\n return getKvBindStatus(record);\n }\n\n return getDefaultStatus(record);\n};\n\nconst getKvBindStatus = (record: PublishConnectorInfo): ConfigStatusUI => {\n const { config_status = ConnectorConfigStatus.Configured } = record;\n\n const couldPublish = config_status === ConnectorConfigStatus.Configured;\n const color = couldPublish ? 'green' : 'primary';\n\n const textMap = {\n [ConnectorConfigStatus.Configured]: I18n.t(\n 'bot_publish_columns_status_configured',\n ),\n [ConnectorConfigStatus.NotConfigured]: I18n.t(\n 'bot_publish_columns_status_not_configured',\n ),\n // Business will not go to the following 3 cases\n [ConnectorConfigStatus.Configuring]: '',\n [ConnectorConfigStatus.Disconnected]: '',\n [ConnectorConfigStatus.NeedReconfiguring]: '',\n };\n\n return {\n text: textMap[config_status],\n color,\n };\n};\n\nconst getDefaultStatus = (record: PublishConnectorInfo): ConfigStatusUI => {\n const { config_status = ConnectorConfigStatus.Configured } = record;\n const couldPublish = config_status === ConnectorConfigStatus.Configured;\n const color = couldPublish ? 'green' : 'primary';\n\n const textMap = {\n [ConnectorConfigStatus.Configured]: I18n.t(\n 'bot_publish_columns_status_authorized',\n ),\n [ConnectorConfigStatus.NotConfigured]: I18n.t(\n 'bot_publish_columns_status_unauthorized',\n ),\n [ConnectorConfigStatus.Configuring]: I18n.t('publish_douyin_config_ing'),\n [ConnectorConfigStatus.Disconnected]: '',\n [ConnectorConfigStatus.NeedReconfiguring]: '',\n };\n\n return {\n text: textMap[config_status],\n color,\n };\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ConnectorBindType,\n ConnectorClassification,\n ConnectorStatus,\n type PublishConnectorInfo,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { IconCozInfoCircle } from '@coze-arch/coze-design/icons';\nimport { Tag, type TagProps, Tooltip } from '@coze-arch/coze-design';\n\nimport { getConfigStatus } from '../utils/get-config-status';\n\ninterface TipTagProps {\n showText: string;\n tip: string;\n tagProps?: TagProps;\n}\n\nconst TipTag: React.FC = ({ showText, tip, tagProps }) => (\n \n {showText ? (\n \n {showText}\n \n \n ) : (\n \n )}\n \n);\n\n/** Channel categories that need to display configuration status */\nconst Classes = [\n ConnectorClassification.SocialPlatform,\n ConnectorClassification.MiniProgram,\n ConnectorClassification.CozeSpaceExtensionLibrary,\n];\n\nexport const ConfigStatus = ({ record }: { record: PublishConnectorInfo }) => {\n if (\n !Classes.includes(record.connector_classification) ||\n record.bind_type === ConnectorBindType.NoBindRequired\n ) {\n return null;\n }\n\n const { text, color } = getConfigStatus(record);\n\n return (\n
\n {/* configuration status */}\n \n {text}\n \n {record?.connector_status === ConnectorStatus.Normal ? null : (\n \n )}\n
\n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type MouseEventHandler } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { I18n } from '@coze-arch/i18n';\nimport { Button, Modal } from '@coze-arch/coze-design';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { DeveloperApi } from '@coze-arch/bot-api';\nimport { useParams } from 'react-router-dom';\n\nimport { useProjectPublishStore } from '../../../store';\n\ninterface UnbindButtonProps {\n bindId: string;\n checked: boolean;\n connectorId: string;\n className?: string;\n onClick: MouseEventHandler;\n}\n\nconst PROJECT_AGENT_TYPE = 1;\n\n// Unpublish for APIs or WebSDKs\nexport const UndoButton = (props: UnbindButtonProps) => {\n const {\n bindId,\n checked,\n connectorId,\n className,\n onClick: inputOnclick,\n } = props;\n const { space_id = '', project_id = '' } = useParams();\n\n const { setProjectPublishInfo, selectedConnectorIds, connectorList } =\n useProjectPublishStore(\n useShallow(state => ({\n selectedConnectorIds: state.selectedConnectorIds,\n setProjectPublishInfo: state.setProjectPublishInfo,\n connectorList: state.connectorList,\n })),\n );\n\n const handleUnbind: MouseEventHandler = e => {\n inputOnclick(e);\n Modal.confirm({\n title: I18n.t('project_release_cancel1'),\n content: I18n.t('project_release_cancel1_desc'),\n okText: I18n.t('project_release_cancel'),\n okButtonColor: 'red',\n cancelText: I18n.t('Cancel'),\n onOk: async () => {\n await DeveloperApi.UnBindConnector({\n bind_id: bindId,\n agent_type: PROJECT_AGENT_TYPE,\n space_id,\n bot_id: project_id,\n connector_id: connectorId,\n });\n setProjectPublishInfo({\n selectedConnectorIds: selectedConnectorIds.filter(\n id => id !== connectorId,\n ),\n connectorList: connectorList.map(item => {\n if (item.id === connectorId) {\n return {\n ...item,\n bind_id: '',\n };\n }\n return item;\n }),\n });\n },\n });\n };\n return bindId && checked ? (\n \n {I18n.t('project_release_cancel')}\n \n ) : null;\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable complexity */\nimport ReactMarkdown from 'react-markdown';\nimport { type MouseEventHandler, useEffect, useRef } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { useHover } from 'ahooks';\nimport {\n ConnectorBindType,\n ConnectorClassification,\n ConnectorConfigStatus,\n type ConnectorPublishConfig,\n type PublishConnectorInfo,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { Checkbox, Tooltip, Typography } from '@coze-arch/coze-design';\nimport { typeSafeJSONParse } from '@coze-arch/bot-utils';\nimport { type TextProps } from '@coze-arch/bot-semi/Typography';\n\nimport { TEMPLATE_CONNECTOR_ID } from '@/utils/constants';\nimport { useProjectPublishStore } from '@/store';\n\nimport { isStoreBindConfigured } from '../utils/is-store-bind-configured';\nimport { getConnectorNotConfigured } from '../utils/connector-disabled-publish';\nimport { McpConfigBtn } from './mcp-config-btn';\nimport { UnionSelect } from './connector-union-select';\nimport { ConnectorAction } from './connector-action';\nimport { ConfigStatus } from './config-status';\nimport { UndoButton } from './bind-actions/undo-button';\n\nenum DisabledReason {\n /** Chatflow is not selected for social channels. */\n SocialPlatform,\n /** Unbound, Unauthorized */\n NotConfigured,\n /** The reason for the back-end delivery */\n NotAllowed,\n /** No template configured */\n Template,\n}\n\ninterface ConnectorDisabledConfig {\n reason: DisabledReason;\n text?: string;\n}\n\nfunction getConnectorDisabledConfig({\n connector,\n socialPlatformConfig,\n templateConfigured,\n connectorPublishConfig,\n connectorConfigMap,\n}: {\n connector: PublishConnectorInfo;\n socialPlatformConfig: ConnectorPublishConfig | undefined;\n templateConfigured: boolean | undefined;\n connectorPublishConfig: Record;\n connectorConfigMap: Record>;\n}): ConnectorDisabledConfig | undefined {\n if (\n connector.connector_classification ===\n ConnectorClassification.SocialPlatform &&\n !socialPlatformConfig?.selected_workflows?.[0]?.workflow_id\n ) {\n // Post to social channels without Chatflow selected.\n return {\n reason: DisabledReason.SocialPlatform,\n text: I18n.t('project_release_chatflow4'),\n };\n }\n const notConfigured = {\n reason: DisabledReason.NotConfigured,\n text: I18n.t('project_release_set_desc'),\n };\n // Unbound, Unauthorized\n if (getConnectorNotConfigured(connector)) {\n return notConfigured;\n }\n // The reason why it cannot be released after being issued by the backend.\n if (!connector.allow_publish && connector.not_allow_publish_reason) {\n return {\n reason: DisabledReason.NotAllowed,\n text: connector.not_allow_publish_reason,\n };\n }\n // No template configured\n if (connector.id === TEMPLATE_CONNECTOR_ID && !templateConfigured) {\n return {\n reason: DisabledReason.Template,\n text: I18n.t('project_release_template_info'),\n };\n }\n\n const isWebSDK =\n connector.connector_classification === ConnectorClassification.APIOrSDK &&\n connector.bind_type === ConnectorBindType.WebSDKBind;\n\n const isSdkChatFlowConfigured = Boolean(\n connectorPublishConfig[connector.id]?.selected_workflows,\n );\n\n if (isWebSDK && !isSdkChatFlowConfigured) {\n return notConfigured;\n }\n const isStorePublish =\n connector.connector_classification === ConnectorClassification.Coze &&\n connector.bind_type === ConnectorBindType.StoreBind;\n const storeConfig = connectorConfigMap[connector.id];\n if (isStorePublish && (!storeConfig || !isStoreBindConfigured(storeConfig))) {\n return notConfigured;\n }\n}\n\n// Additional descriptive information agreed upon with the backend\ninterface DescriptionExtra {\n // Channel name hover tooltip\n text?: string;\n}\n\nexport interface ConnectorCardProps {\n connectorInfo: PublishConnectorInfo;\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n onShowWebSdkGuide: () => void;\n}\n\n// eslint-disable-next-line @coze-arch/max-line-per-function -- it's complex\nexport function ConnectorCard({\n connectorInfo,\n checked,\n onCheckedChange,\n onShowWebSdkGuide,\n}: ConnectorCardProps) {\n const { id, name, description, bind_id = '' } = connectorInfo;\n\n const {\n templateConfigured,\n socialPlatformChatflow,\n connectorPublishConfig,\n connectors,\n } = useProjectPublishStore(\n useShallow(state => ({\n templateConfigured: state.templateConfigured,\n socialPlatformChatflow: state.socialPlatformChatflow,\n connectorPublishConfig: state.connectorPublishConfig,\n connectors: state.connectors,\n })),\n );\n const divRef = useRef(null);\n const isHover = useHover(divRef.current);\n\n const disabledConfig = getConnectorDisabledConfig({\n connector: connectorInfo,\n socialPlatformConfig: socialPlatformChatflow,\n templateConfigured,\n connectorPublishConfig,\n connectorConfigMap: connectors,\n });\n // The open-source version does not support social platform channels for future expansion.\n // When the social channel does not select \"Process message conversation flow\", the entire card needs to be displayed as disabled.\n const cardDisabled = disabledConfig?.reason === DisabledReason.SocialPlatform;\n\n const descriptionExtra = (typeSafeJSONParse(\n connectorInfo.description_extra,\n ) ?? {}) as DescriptionExtra;\n\n // If the disabled status changes, uncheck the current channel\n useEffect(() => {\n if (checked && disabledConfig) {\n onCheckedChange(false);\n }\n }, [checked, disabledConfig]);\n\n const connectorCheckbox = (\n {\n if (!disabledConfig) {\n onCheckedChange(!checked);\n }\n }}\n data-testid=\"project.publish.select.connector\"\n disabled={Boolean(disabledConfig)}\n />\n );\n const stopEventPropagation: MouseEventHandler = mouseEvent => {\n mouseEvent.stopPropagation();\n };\n\n const getIsShowAction = () => {\n const isConnectorAuth = [\n ConnectorBindType.KvBind,\n ConnectorBindType.KvAuthBind,\n ConnectorBindType.AuthBind,\n ].includes(connectorInfo.bind_type);\n const isConnectorAuthConfigured =\n connectorInfo.config_status === ConnectorConfigStatus.Configured;\n\n if (isConnectorAuth) {\n return (\n !isConnectorAuthConfigured || (isConnectorAuthConfigured && isHover)\n );\n }\n\n return true;\n };\n\n const isShowAction = getIsShowAction();\n\n const connectorCard = (\n {\n if (!disabledConfig) {\n onCheckedChange(!checked);\n }\n }}\n >\n \n
\n \n {descriptionExtra.text ? (\n (\n \n ),\n }}\n >\n {descriptionExtra.text}\n \n }\n >\n
{name}
\n \n ) : (\n
{name}
\n )}\n \n
\n
\n {description ? (\n (\n \n {props.children}\n \n ),\n a: props => {\n const textProps: TextProps =\n props.href === 'coze://web-sdk-guide'\n ? {\n link: true,\n onClick: e => {\n stopEventPropagation(e);\n onShowWebSdkGuide();\n },\n }\n : {\n link: {\n href: props.href,\n target: '_blank',\n onClick: stopEventPropagation,\n },\n };\n return (\n \n {props.children}\n \n );\n },\n }}\n >\n {description}\n \n ) : null}\n
\n
\n {connectorInfo.connector_union_id ? (\n \n ) : null}\n \n {connectorInfo.connector_classification ===\n ConnectorClassification.APIOrSDK ? (\n \n ) : null}\n {/* The open-source version does not support MCP service channels for future expansion */}\n {connectorInfo.connector_classification ===\n ConnectorClassification.CozeSpaceExtensionLibrary &&\n connectorInfo.bind_type === ConnectorBindType.TemplateBind && (\n \n )}\n
\n \n\n
\n {disabledConfig && !cardDisabled ? (\n \n {connectorCheckbox}\n \n ) : (\n connectorCheckbox\n )}\n
\n \n );\n\n return (\n \n {connectorCard}\n \n );\n}\n","\n import API from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useParams } from 'react-router-dom';\nimport { useMemo } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { MonetizePublishInfo } from '@coze-studio/components/monetize';\nimport {\n ConnectorClassification,\n type PublishConnectorInfo,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { PublishTermService } from '@coze-agent-ide/agent-ide-commons';\nimport { IconCozEmpty } from '@coze-arch/coze-design/icons';\nimport { Form } from '@coze-arch/coze-design';\n\nimport { useWebSdkGuideModal } from '@/web-sdk-guide';\nimport { WEB_SDK_CONNECTOR_ID } from '@/utils/constants';\nimport { useProjectPublishStore } from '@/store';\n\nimport { CONNECTOR_TAB_BAR_Z_INDEX } from '../utils/constants';\nimport { usePublishContainer } from '../context/publish-container-context';\nimport { formatConnectorGroups } from './utils/format-connector-groups';\nimport { useConnectorScroll } from './hooks/use-connector-scroll';\nimport { useAutoScrollToConnector } from './hooks/use-auto-scroll-to-connector';\nimport { SocialPlatformChatflow } from './components/social-platform-chatflow';\nimport {\n ConnectorTabbar,\n ConnectorTabbarItem,\n} from './components/connector-tab-bar';\nimport { ConnectorGroupHeader } from './components/connector-group-header';\nimport { ConnectorCard } from './components/connector-card';\n\nimport s from './index.module.less';\n\nconst getTermServiceData = (connectorList: PublishConnectorInfo[]) =>\n connectorList\n .filter(item => item.privacy_policy || item.user_agreement)\n .map(i => ({\n name: i.name,\n icon: i.icon_url,\n privacy_policy: i.privacy_policy,\n user_agreement: i.user_agreement,\n }));\n\n// eslint-disable-next-line @coze-arch/max-line-per-function\nexport function PublishConnectors() {\n const { project_id = '' } = useParams();\n\n const {\n connectorList, // The open-source version only supports API and Chat SDK channels\n connectorUnionMap,\n monetizeConfig,\n selectedConnectorIds,\n connectorPublishConfig,\n unions,\n updateSelectedConnectorIds,\n } = useProjectPublishStore(\n useShallow(state => ({\n connectorList: state.connectorList,\n connectorUnionMap: state.connectorUnionMap,\n monetizeConfig: state.monetizeConfig,\n selectedConnectorIds: state.selectedConnectorIds,\n connectorPublishConfig: state.connectorPublishConfig,\n unions: state.unions,\n updateSelectedConnectorIds: state.updateSelectedConnectorIds,\n })),\n );\n\n const termServiceData = useMemo(\n () => getTermServiceData(connectorList),\n [connectorList],\n );\n\n const connectorGroups = useMemo(\n () =>\n formatConnectorGroups(connectorList, connectorUnionMap, unions).filter(\n item => item.connectors.length > 0,\n ),\n [connectorList, connectorUnionMap, unions],\n );\n const { publishHeaderHeight } = usePublishContainer();\n const {\n connectorRefMap,\n activeConnectorTarget,\n connectorBarRef,\n scrollToConnector,\n closeAnimation,\n animationStateMap,\n } = useConnectorScroll();\n\n useAutoScrollToConnector({\n connectorGroupList: connectorGroups,\n connectorRefMap,\n });\n\n const isConnectorChecked = (c: PublishConnectorInfo) =>\n selectedConnectorIds.includes(c.connector_union_id ?? c.id);\n\n const onCheckConnector = (c: PublishConnectorInfo, checked: boolean) => {\n const id = c.connector_union_id ?? c.id;\n if (checked) {\n updateSelectedConnectorIds(prev => prev.concat(id));\n } else {\n updateSelectedConnectorIds(prev => prev.filter(i => i !== id));\n }\n };\n\n // Collapse Panel does not display the icon of the selected channel in the header when expanded\n const getGroupHeaderList = (groupId: ConnectorClassification) => {\n const group = connectorGroups.find(g => g.type === groupId);\n if (!group) {\n return [];\n }\n return group.connectors.filter(c =>\n selectedConnectorIds.includes(c.connector_union_id ?? c.id),\n );\n };\n\n const { node: guideModal, show: showWebSdkGuide } = useWebSdkGuideModal();\n const onShowWebSdkGuide = () => {\n const sdkConnector = connectorList.find(c => c.id === WEB_SDK_CONNECTOR_ID);\n const sdkConfig = connectorPublishConfig[WEB_SDK_CONNECTOR_ID];\n showWebSdkGuide({\n projectId: project_id,\n workflowId: sdkConfig?.selected_workflows?.[0]?.workflow_id ?? '',\n version: sdkConnector?.bind_info?.sdk_version ?? '',\n });\n };\n\n return (\n
\n
\n \n {I18n.t('bot_publish_select_title')}\n \n {IS_OVERSEA && monetizeConfig ? (\n c.support_monetization)\n .map(c => ({ id: c.id, name: c.name, icon: c.icon_url }))}\n />\n ) : null}\n
\n {termServiceData.length ? (\n \n ) : null}\n \n {connectorGroups.map(connector => (\n scrollToConnector(connector.type)}\n >\n {connector.label}\n \n ))}\n \n {connectorGroups.map((i, index) => {\n // The open-source version does not support social platform channels for the time being\n const isSocialPlatform =\n i.type === ConnectorClassification.SocialPlatform;\n return (\n \n {\n closeAnimation(i.type);\n }}\n />\n {/* The open-source version does not support social platform channels for the time being */}\n {isSocialPlatform ? (\n \n ) : null}\n \n {i.connectors.map(c => (\n onCheckConnector(c, checked)}\n onShowWebSdkGuide={onShowWebSdkGuide}\n />\n ))}\n
\n \n );\n })}\n {!connectorList.length ? (\n
\n \n
\n {I18n.t('publish_page_no_channel_status_title')}\n
\n
\n {I18n.t('publish_page_no_channel_status_desc')}\n
\n
\n ) : null}\n {guideModal}\n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type ConnectorUnionInfo,\n ConnectorClassification,\n type PublishConnectorInfo,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\n\nexport interface ConnectorGroup {\n type: ConnectorClassification;\n label: string;\n desc: string;\n connectors: PublishConnectorInfo[];\n}\n\nexport function formatConnectorGroups(\n connectors: PublishConnectorInfo[],\n unionMap: Record,\n unions: Record,\n) {\n const groups: ConnectorGroup[] = [\n {\n type: ConnectorClassification.APIOrSDK,\n label: I18n.t('project_release_api1'),\n desc: I18n.t('project_release_api_sdk_desc'),\n connectors: [],\n },\n {\n type: ConnectorClassification.MiniProgram,\n label: I18n.t('project_release_miniprogram1'),\n desc: I18n.t('project_release_h5_desc'),\n connectors: [],\n },\n {\n type: ConnectorClassification.SocialPlatform,\n label: I18n.t('project_release_social1'),\n desc: I18n.t('project_release_social_desc1'),\n connectors: [],\n },\n {\n type: ConnectorClassification.Coze,\n label: I18n.t('project_release_coze1'),\n desc: I18n.t('project_release_ts_desc'),\n connectors: [],\n },\n {\n type: ConnectorClassification.CozeSpaceExtensionLibrary,\n label: I18n.t('app_publish_connector_mcp'),\n desc: I18n.t('app_publish_connector_mcp'),\n connectors: [],\n },\n ];\n for (const c of connectors) {\n const group = groups.find(g => g.type === c.connector_classification);\n if (!group) {\n continue;\n }\n if (c.connector_union_id) {\n const unionId = c.connector_union_id;\n // If the current union_id has already been added to the group, skip\n if (group.connectors.some(i => i.connector_union_id === unionId)) {\n continue;\n }\n let connectorInfo = c;\n // Give priority to the connector selected by the union, otherwise take the first one.\n const unionSelection = connectors.find(i => i.id === unions[unionId]);\n if (unionSelection) {\n connectorInfo = unionSelection;\n } else {\n const firstId = unionMap[unionId].connector_options[0].connector_id;\n const firstConnector = connectors.find(i => i.id === firstId);\n if (firstConnector) {\n connectorInfo = firstConnector;\n }\n }\n const unionInfo = unionMap[unionId];\n group.connectors.push({\n ...connectorInfo,\n name: unionInfo.name,\n description: unionInfo.description,\n icon_url: unionInfo.icon_url,\n });\n } else {\n group.connectors.push(c);\n }\n }\n return groups;\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { I18n } from '@coze-arch/i18n';\nimport { intelligenceApi } from '@coze-arch/bot-api';\n\nexport async function checkVersionNum(\n versionNumber: string,\n projectId: string,\n) {\n if (!versionNumber) {\n return I18n.t('project_release_example2');\n }\n const { data } = await intelligenceApi.CheckProjectVersionNumber({\n project_id: projectId,\n version_number: versionNumber,\n });\n\n if (data?.is_duplicate) {\n return I18n.t('project_release_example3');\n } else {\n return '';\n }\n}\n","\n import API from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type CSSProperties, useEffect, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\nimport {\n type CommonFieldProps,\n Input,\n TextArea,\n type TextAreaProps,\n withField,\n} from '@coze-arch/coze-design';\n\nimport styles from './index.module.less';\n\nexport interface VersionDescInputProps\n extends Pick<\n TextAreaProps,\n 'placeholder' | 'maxLength' | 'maxCount' | 'wrapperClassName' | 'value'\n > {\n onChange?: (value: string) => void;\n inputClassName?: string;\n textAreaClassName?: string;\n textAreaStyle?: CSSProperties;\n}\n\nconst VersionDescInput: React.FC = ({\n inputClassName,\n textAreaClassName,\n wrapperClassName,\n textAreaStyle,\n ...props\n}) => {\n const [mode, setMode] = useState<'input' | 'textarea'>('input');\n const textAreaRef = useRef(null);\n\n useEffect(() => {\n const target = textAreaRef.current;\n if (mode !== 'textarea' || !target) {\n return;\n }\n const valueLength = props.value?.length;\n target.focus();\n if (!valueLength) {\n return;\n }\n target.setSelectionRange(valueLength, valueLength);\n }, [mode]);\n\n if (mode === 'input') {\n return (\n {\n setMode('textarea');\n }}\n />\n );\n }\n\n return (\n
\n {\n setMode('input');\n }}\n />\n
\n );\n};\n\nexport const FormVersionDescInput: React.FC<\n CommonFieldProps & VersionDescInputProps\n> = withField(VersionDescInput);\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { I18n } from '@coze-arch/i18n';\nimport { Form } from '@coze-arch/coze-design';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { useParams } from 'react-router-dom';\n\nimport { CONNECTOR_TAB_BAR_Z_INDEX } from '../utils/constants';\nimport { useProjectPublishStore } from '../store';\nimport { checkVersionNum } from './utils/version-number-check';\nimport { FormVersionDescInput } from './components/version-desc-input';\n\nexport function PublishBasicInfo() {\n const { project_id = '' } = useParams();\n const {\n lastVersionNumber,\n versionNumber,\n versionDescription,\n setProjectPublishInfo,\n } = useProjectPublishStore(\n useShallow(state => ({\n lastVersionNumber: state.lastVersionNumber,\n versionNumber: state.versionNumber,\n versionDescription: state.versionDescription,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n\n const inputBaseCls = '';\n\n return (\n
\n
\n {I18n.t('project_release_version_info')}\n
\n
\n \n {I18n.t('builder_publish_version_label')}\n \n }\n placeholder={\n lastVersionNumber\n ? I18n.t('project_release_example1', {\n version: lastVersionNumber,\n })\n : I18n.t('project_release_example')\n }\n initValue={versionNumber}\n className=\"bg-transparent coz-stroke-plus\"\n rules={[\n { required: true, message: I18n.t('project_release_example2') },\n ]}\n onChange={value => {\n setProjectPublishInfo({\n versionNumber: value,\n });\n }}\n validate={val => checkVersionNum(val, project_id)}\n trigger={'blur'}\n maxLength={20}\n />\n \n {I18n.t('builder_publish_changelog_label')}\n \n }\n placeholder={I18n.t('builder_publish_changelog_placeholder')}\n initValue={versionDescription}\n maxLength={800}\n maxCount={800}\n wrapperClassName=\"relative overflow-visible\"\n inputClassName={inputBaseCls}\n textAreaClassName={classNames(\n inputBaseCls,\n 'absolute',\n 'top-0',\n 'left-0',\n '!coz-bg-max',\n )}\n // It is higher than the channel tab to avoid occlusion.\n textAreaStyle={{ zIndex: CONNECTOR_TAB_BAR_Z_INDEX + 1 }}\n onChange={value => {\n setProjectPublishInfo({\n versionDescription: value,\n });\n }}\n />\n
\n
\n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type PropsWithChildren, useRef, useState } from 'react';\n\nimport { DEFAULT_PUBLISH_HEADER_HEIGHT } from '../../../utils/constants';\nimport { PublishContainerContext } from '../../../context/publish-container-context';\n\nexport const PublishContainer: React.FC = ({ children }) => {\n const ref = useRef(null);\n const [publishHeaderHeight, setPublishHeaderHeight] = useState(\n DEFAULT_PUBLISH_HEADER_HEIGHT,\n );\n\n const getContainerRef = () => ref;\n\n return (\n \n \n {children}\n \n \n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport { useErrorHandler } from '@coze-arch/logger';\nimport { Form, Spin } from '@coze-arch/coze-design';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { useParams } from 'react-router-dom';\n\nimport { useProjectPublishStore } from '../store';\nimport {\n loadProjectPublishDraft,\n saveProjectPublishDraft,\n} from './utils/publish-draft';\nimport { initPublishStore } from './utils/init-publish-store';\nimport { PublishTitleBar } from './publish-title-bar';\nimport { PublishRecord } from './publish-record';\nimport { PublishConnectors } from './publish-connectors';\nimport { PublishBasicInfo } from './publish-basic-info';\nimport { PublishContainer } from './components/publish-container';\n\nimport s from './index.module.less';\n\nexport function ProjectPublish(): JSX.Element {\n const { project_id = '', space_id = '' } = useParams();\n const {\n showPublishResult,\n pageLoading,\n resetProjectPublishInfo,\n exportDraft,\n } = useProjectPublishStore(\n useShallow(state => ({\n showPublishResult: state.showPublishResult,\n pageLoading: state.pageLoading,\n resetProjectPublishInfo: state.resetProjectPublishInfo,\n exportDraft: state.exportDraft,\n })),\n );\n const errorHandle = useErrorHandler();\n\n useEffect(() => {\n const saveDraft = () => {\n saveProjectPublishDraft(exportDraft(project_id));\n };\n window.addEventListener('beforeunload', saveDraft);\n return () => {\n window.removeEventListener('beforeunload', saveDraft);\n };\n }, [exportDraft, project_id]);\n\n useEffect(() => {\n initPublishStore(\n project_id,\n errorHandle,\n loadProjectPublishDraft(project_id),\n );\n return () => {\n resetProjectPublishInfo();\n };\n }, []);\n\n return !pageLoading ? (\n \n >\n className={s.project}\n showValidateIcon={false}\n >\n \n {!showPublishResult ? (\n
\n
\n \n \n
\n
\n ) : (\n \n )}\n \n
\n ) : (\n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect, useState } from 'react';\n\nimport { useRequest } from 'ahooks';\nimport {\n ConnectorPublishStatus,\n PublishRecordStatus,\n type PublishRecordDetail,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';\nimport {\n IconCozCheckMarkCircle,\n IconCozClock,\n IconCozCrossCircle,\n} from '@coze-arch/coze-design/icons';\nimport { Modal, Select, Tag, type TagProps } from '@coze-arch/coze-design';\nimport { type OptionProps } from '@coze-arch/bot-semi/Select';\nimport { intelligenceApi } from '@coze-arch/bot-api';\nimport { EProjectPermission, useProjectAuth } from '@coze-common/auth';\n\nimport { isPublishFinish } from '../utils/is-publish-finish';\nimport { ProjectPublishProgress } from '../publish-progress';\n\nenum PublishStatus {\n Publishing,\n Failed,\n Success,\n}\n\nconst PublishStatusMap: Record<\n PublishStatus,\n Pick & { text: I18nKeysNoOptionsType }\n> = {\n [PublishStatus.Publishing]: {\n prefixIcon: ,\n color: 'brand',\n text: 'project_releasing',\n },\n [PublishStatus.Failed]: {\n prefixIcon: ,\n color: 'red',\n text: 'project_release_failed',\n },\n [PublishStatus.Success]: {\n prefixIcon: ,\n color: 'green',\n text: 'project_release_success',\n },\n};\n\nfunction toPublishStatus(record: PublishRecordDetail) {\n const projectFailed =\n record.publish_status === PublishRecordStatus.PackFailed ||\n record.publish_status === PublishRecordStatus.AuditNotPass;\n const connectorsFailed =\n record.connector_publish_result?.some(\n item => item.connector_publish_status === ConnectorPublishStatus.Failed,\n ) ?? false;\n // The project itself failed, or some channels failed to publish - > overall failed\n if (projectFailed || connectorsFailed) {\n return PublishStatus.Failed;\n }\n const projectPublishing =\n record.publish_status === PublishRecordStatus.Packing ||\n record.publish_status === PublishRecordStatus.Auditing ||\n record.publish_status === PublishRecordStatus.ConnectorPublishing;\n const connectorsPublishing =\n record.connector_publish_result?.some(\n item =>\n item.connector_publish_status === ConnectorPublishStatus.Default ||\n item.connector_publish_status === ConnectorPublishStatus.Auditing,\n ) ?? false;\n // The project itself is being released, or some channels are being released - > the overall release is in progress\n if (projectPublishing || connectorsPublishing) {\n return PublishStatus.Publishing;\n }\n return PublishStatus.Success;\n}\n\nexport interface ProjectPublishStatusProps {\n spaceId: string;\n projectId: string;\n defaultRecordID?: string;\n}\n\n/* eslint @coze-arch/max-line-per-function: [\"error\", {\"max\": 300}] */\nexport function usePublishStatus({\n spaceId,\n projectId,\n defaultRecordID,\n}: ProjectPublishStatusProps) {\n const [status, setStatus] = useState();\n const [latestRecord, setLatestRecord] = useState();\n const [recordList, setRecordList] = useState([]);\n const [selectedVersion, setSelectedVersion] = useState(defaultRecordID);\n const [selectedRecord, setSelectedRecord] = useState();\n\n const [modalVisible, setModalVisible] = useState(false);\n\n // Polling the latest release history until it stops when it is not in the \"In Release\" state\n const latestRecordRequest = useRequest(\n () => intelligenceApi.GetPublishRecordDetail({ project_id: projectId }),\n {\n manual: true,\n pollingInterval: 5000,\n pollingWhenHidden: false,\n pollingErrorRetryCount: 3,\n onSuccess: res => {\n const record = res.data;\n // Stop polling when no record is published\n if (!record || typeof record.publish_status !== 'number') {\n latestRecordRequest.cancel();\n return;\n }\n setStatus(toPublishStatus(record));\n setLatestRecord(record);\n // After first requesting the latest release record, its version number is selected by default\n if (!selectedVersion) {\n setRecordList([\n { value: record.publish_record_id, label: record.version_number },\n ]);\n setSelectedVersion(record.publish_record_id ?? '');\n } else if (selectedVersion === record.publish_record_id) {\n setSelectedRecord(record);\n }\n if (isPublishFinish(record)) {\n latestRecordRequest.cancel();\n }\n },\n },\n );\n\n // Get a list of publication records\n const recordListRequest = useRequest(\n () => intelligenceApi.GetPublishRecordList({ project_id: projectId }),\n {\n manual: true,\n onSuccess: res => {\n setRecordList(\n res.data?.map(item => ({\n value: item.publish_record_id,\n label: item.version_number,\n })) ?? [],\n );\n },\n },\n );\n\n const hasPermission = useProjectAuth(\n EProjectPermission.PUBLISH,\n projectId,\n spaceId,\n );\n\n // When the user has \"publish\" permission, start polling\n useEffect(() => {\n if (!hasPermission || defaultRecordID) {\n return;\n }\n latestRecordRequest.run();\n }, [hasPermission, defaultRecordID]);\n\n // Manually request selected release records\n const recordDetailRequest = useRequest(\n (recordId: string) =>\n intelligenceApi.GetPublishRecordDetail({\n project_id: projectId,\n publish_record_id: recordId,\n }),\n {\n manual: true,\n onSuccess: res => {\n const record = res.data;\n setSelectedRecord(record);\n if (record?.publish_record_id === latestRecord?.publish_record_id) {\n setLatestRecord(record);\n }\n },\n },\n );\n\n const tagConfig = PublishStatusMap[status ?? PublishStatus.Failed];\n const showingRecord = selectedRecord ?? latestRecord;\n\n const open = async () => {\n await recordListRequest.runAsync();\n if (defaultRecordID) {\n await changeVersion(defaultRecordID);\n }\n setModalVisible(true);\n };\n\n const close = () => {\n setModalVisible(false);\n };\n\n const changeVersion = async (version: string) => {\n setSelectedVersion(version);\n await recordDetailRequest.run(version);\n };\n\n return {\n latestVersion: latestRecord,\n currentVersion: recordList.find(item => item.value === selectedVersion),\n\n open,\n\n close,\n\n modal: (\n setModalVisible(false)}\n >\n
\n {\n if (typeof version === 'string') {\n changeVersion(version);\n }\n }}\n />\n {showingRecord ? (\n \n ) : null}\n
\n \n ),\n tag: (\n 1 will cause its height to be larger than the Tag itself\n className=\"flex !px-[3px] font-medium\"\n >\n {I18n.t(tagConfig.text)}\n \n ),\n };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable complexity */\n/* eslint-disable react-hooks/exhaustive-deps */\nimport { useNavigate } from 'react-router-dom';\nimport React, { type ReactNode, useCallback } from 'react';\n\nimport { useIsPublishRecordReady } from '@coze-studio/publish-manage-hooks';\nimport {\n useProjectAuth,\n EProjectPermission,\n useProjectRole,\n} from '@coze-common/auth';\nimport { IntelligenceType } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport {\n IconCozAnalytics,\n IconCozArrowDown,\n IconCozArrowRight,\n IconCozDocument,\n IconCozLongArrowTopRight,\n IconCozTrigger,\n} from '@coze-arch/coze-design/icons';\nimport {\n Button,\n Divider,\n IconButton,\n Menu,\n Popover,\n Tooltip,\n} from '@coze-arch/coze-design';\nimport { useFlags } from '@coze-arch/bot-flags';\n\nimport { usePublishStatus } from '../hooks/use-publish-status';\nimport { useBizConnectorAnchor } from '../hooks/use-biz-connector-anchor';\n\nconst isLocalDevMode = () => {\n const searchParams = new URLSearchParams(location.search);\n return searchParams.has('devBlock');\n};\n\n/* eslint @coze-arch/max-line-per-function: [\"error\", {\"max\": 300}] */\nexport const PublishButton = ({\n spaceId,\n projectId,\n hasPublished,\n}: {\n spaceId: string;\n projectId: string;\n hasPublished: boolean;\n}) => {\n const navigate = useNavigate();\n\n const { modal, tag, latestVersion, open } = usePublishStatus({\n spaceId,\n projectId,\n });\n\n const hasPublishPermission = useProjectAuth(\n EProjectPermission.PUBLISH,\n projectId,\n spaceId,\n );\n const { removeAnchor } = useBizConnectorAnchor();\n\n const handlePublish = useCallback(() => {\n removeAnchor();\n navigate(`/space/${spaceId}/project-ide/${projectId}/publish`);\n }, [spaceId, projectId, removeAnchor]);\n\n const projectRoles = useProjectRole(projectId);\n\n const [FLAGS] = useFlags();\n\n const { ready, inited } = useIsPublishRecordReady({\n type: IntelligenceType.Project,\n intelligenceId: projectId,\n spaceId,\n enable: !!(\n // Support soon, so stay tuned.\n (\n FLAGS['bot.studio.publish_management'] &&\n hasPublished &&\n projectRoles.length &&\n !IS_OPEN_SOURCE\n )\n ),\n });\n\n const menuAnalysis = (\n {\n navigate(`/space/${spaceId}/publish/app/${projectId}?tab=analysis`);\n }}\n text={I18n.t('analytics_page_title')}\n prefix={\n \n }\n />\n );\n\n const menuLogs = (\n {\n navigate(`/space/${spaceId}/publish/app/${projectId}?tab=logs`);\n }}\n text={I18n.t('release_management_trace')}\n prefix={\n \n }\n />\n );\n\n const menuTriggers = (\n {\n navigate(`/space/${spaceId}/publish/app/${projectId}?tab=triggers`);\n }}\n text={I18n.t('release_management_trigger')}\n prefix={\n \n }\n />\n );\n\n if (!hasPublishPermission) {\n return null;\n }\n\n if (!hasPublished) {\n return (\n \n {I18n.t('project_ide_frame_publish')}\n \n );\n }\n\n return (\n <>\n {modal}\n \n {latestVersion?.version_number ? (\n open()}\n >\n \n {`${I18n.t('app_ide_publish_modal_recent_publication')} ${\n latestVersion?.version_number\n }`}\n \n {tag}\n }\n color=\"secondary\"\n />\n \n ) : null}\n\n
\n \n
\n\n {/* Support soon, so stay tuned. */}\n {FLAGS['bot.studio.publish_management'] && !IS_OPEN_SOURCE ? (\n
\n
\n {I18n.t('app_ide_publish_modal_publish_management')}\n
\n \n {ready || !inited ? (\n menuAnalysis\n ) : (\n \n
{menuAnalysis}
\n \n )}\n {ready || !inited ? (\n menuLogs\n ) : (\n \n
{menuLogs}
\n \n )}\n {ready || !inited ? (\n menuTriggers\n ) : (\n \n
{menuTriggers}
\n \n )}\n
\n
\n ) : null}\n\n
\n \n {I18n.t('app_ide_publish_modal_publish_button')}\n \n
\n \n }\n >\n \n \n \n );\n};\n\nconst MenuItem = ({\n prefix,\n text,\n onClick,\n disabled,\n}: {\n prefix?: ReactNode;\n text?: string;\n onClick?: () => void;\n disabled?: boolean;\n}) => (\n \n
\n {prefix}\n {text}\n \n
\n \n);\n","\n import API from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","import * as React from \"react\";\nconst SvgDiffEmpty = props => ;\nexport { SvgDiffEmpty as ReactComponent };\nexport default \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04LjMzMzk4IDIuOTk5OTJDOC4zMzM5OCAxLjUyNzE2IDkuNTI3ODkgMC4zMzMyNTIgMTEuMDAwNyAwLjMzMzI1MkgyNy4wMDA2QzI4LjQ3MzQgMC4zMzMyNTIgMjkuNjY3MyAxLjUyNzE2IDI5LjY2NzMgMi45OTk5MlYxOC45OTk5QzI5LjY2NzMgMjAuNDcyNyAyOC40NzM0IDIxLjY2NjYgMjcuMDAwNiAyMS42NjY2SDIxLjY2NzNWMjYuOTk5OUMyMS42NjczIDI4LjQ3MjcgMjAuNDczNCAyOS42NjY2IDE5LjAwMDcgMjkuNjY2NkgzLjAwMDY1QzEuNTI3ODkgMjkuNjY2NiAwLjMzMzk4NCAyOC40NzI3IDAuMzMzOTg0IDI2Ljk5OTlWMTAuOTk5OUMwLjMzMzk4NCA5LjUyNzE2IDEuNTI3ODkgOC4zMzMyNSAzLjAwMDY1IDguMzMzMjVIOC4zMzM5OFYyLjk5OTkyWk04LjMzMzk4IDEwLjk5OTlIMy4wMDA2NVYyNi45OTk5SDE5LjAwMDdWMjEuNjY2NkgxMS4wMDA3QzkuNTI3ODkgMjEuNjY2NiA4LjMzMzk4IDIwLjQ3MjcgOC4zMzM5OCAxOC45OTk5VjEwLjk5OTlaTTE5LjAwMDcgMTguOTk5OUgxMS4wMDA3VjEwLjk5OTlIMTkuMDAwN1YxOC45OTk5Wk0yMS42NjczIDE4Ljk5OTlWMTAuOTk5OUMyMS42NjczIDkuNTI3MTYgMjAuNDczNCA4LjMzMzI1IDE5LjAwMDcgOC4zMzMyNUgxMS4wMDA3VjIuOTk5OTJIMjcuMDAwNlYxOC45OTk5SDIxLjY2NzNaIiBmaWxsPSIjMUQxQzIzIiBmaWxsLW9wYWNpdHk9IjAuMzUiLz4KPC9zdmc+Cg==\";","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.editor-container-JPBTxq{height:100%;position:relative}.editor-VinOIJ{background-color:#fff;border:1px solid rgba(29,28,35,.12);border-radius:8px;height:100%;padding:0}.editor-VinOIJ .monaco-editor .scroll-decoration{box-shadow:unset}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"editor-container\": `editor-container-JPBTxq`,\n\t\"editorContainer\": `editor-container-JPBTxq`,\n\t\"editor\": `editor-VinOIJ`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.multiline-text-GVNO_v{word-break:break-word;white-space:pre-wrap}.multiline-container-uIOXgz{flex:1;grid-template-columns:100px 36px 100px;display:grid;overflow:hidden}.editor-container-YQ76sR{border:1px solid var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));border-radius:8px;min-height:400px;margin-top:20px;overflow:hidden}.editor-header-rVNsYI{border-bottom:1px solid var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));width:100%;display:flex}.editor-title-TtUkQu{color:var(--Fg-COZ-fg-primary,rgba(6,7,9,.8));flex:1;padding:12px;font-size:14px;font-weight:500;overflow:hidden}.editor-divider-sAapKP{width:1px;height:46px;color:var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1))}.editor-cj3RsF{background-color:transparent;min-height:400px;max-height:600px}.editor-cj3RsF .monaco-editor-background{background-color:#f9f9f9!important}.editor-cj3RsF .monaco-editor .vertical{box-shadow:0 0 0 0 var(--guide-color)inset!important}.editor-cj3RsF .margin{background-color:#f9f9f9!important}.editor-cj3RsF .monaco-diff-editor.side-by-side .editor.modified{border-left:1px solid var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));box-shadow:none!important}.editor-cj3RsF .mtk1{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.6))}.editor-cj3RsF .margin-view-overlays .line-numbers{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3));width:24px!important}.editor-cj3RsF .monaco-editor .diagonal-fill{background-size:8px 8px;background-image:linear-gradient(-45deg,rgba(34,34,34,.1) 12.5%,transparent 12.5%,transparent 50%,rgba(34,34,34,.1) 50%,rgba(34,34,34,.1) 62.5%,transparent 62.5%,transparent 100%)!important}.editor-cj3RsF .margin-view-overlays:after{pointer-events:none;background:var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));width:1px;position:absolute;top:0;bottom:0;right:3px;content:\" \"!important}.editor-cj3RsF .line-numbers.active-line-number{color:var(--Fg-COZ-fg-primary,rgba(6,7,9,.8))!important}.editor-cj3RsF .monaco-editor .delete-sign{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3))!important;font-size:8px!important;font-weight:900!important;left:29px!important}.editor-cj3RsF .monaco-editor .insert-sign{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3))!important;font-size:8px!important;font-weight:900!important;left:29px!important}.editor-cj3RsF .monaco-editor .view-overlays .current-line{border:0!important}.editor-cj3RsF .monaco-scrollable-element>.scrollbar>.slider{background:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3));border-radius:3px;width:8px!important}.editor-cj3RsF .decorationsOverviewRuler{display:none!important}.editor-cj3RsF .modified .slider{left:6px!important}.editor-cj3RsF .modified .presentation{width:12px!important;right:-4px!important}.editor-cj3RsF .original .slider{left:6px!important}.editor-cj3RsF .original .presentation{width:12px!important;left:3px!important}.editor-cj3RsF .gutter-insert{background-color:var(--vscode-diffEditor-insertedLineBackground,var(--vscode-diffEditor-insertedTextBackground))!important}.editor-cj3RsF .gutter-delete{background-color:var(--vscode-diffEditor-removedLineBackground,var(--vscode-diffEditor-removedTextBackground))!important}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"multiline-text\": `multiline-text-GVNO_v`,\n\t\"multilineText\": `multiline-text-GVNO_v`,\n\t\"multiline-container\": `multiline-container-uIOXgz`,\n\t\"multilineContainer\": `multiline-container-uIOXgz`,\n\t\"editor-container\": `editor-container-YQ76sR`,\n\t\"editorContainer\": `editor-container-YQ76sR`,\n\t\"editor-header\": `editor-header-rVNsYI`,\n\t\"editorHeader\": `editor-header-rVNsYI`,\n\t\"editor-title\": `editor-title-TtUkQu`,\n\t\"editorTitle\": `editor-title-TtUkQu`,\n\t\"editor-divider\": `editor-divider-sAapKP`,\n\t\"editorDivider\": `editor-divider-sAapKP`,\n\t\"editor\": `editor-cj3RsF`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.list-utyqSJ{padding:.75rem 0 .75rem .75rem}.list-utyqSJ .semi-list-item-body-header{flex:1;width:0;overflow:hidden}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"list\": `list-utyqSJ`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.error-container-_IyY_2 .error-link-Pq2VWp .error-link-underline-EVkAXO{color:var(--semi-color-danger);max-width:200px;margin-left:2px;font-size:14px;text-decoration:underline}.error-container-_IyY_2 .error-link-Pq2VWp .error-link-underline-EVkAXO a{color:var(--semi-color-danger)}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"error-container\": `error-container-_IyY_2`,\n\t\"errorContainer\": `error-container-_IyY_2`,\n\t\"error-link\": `error-link-Pq2VWp`,\n\t\"errorLink\": `error-link-Pq2VWp`,\n\t\"error-link-underline\": `error-link-underline-EVkAXO`,\n\t\"errorLinkUnderline\": `error-link-underline-EVkAXO`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.disable-field-jMLuez{padding:12px 0 24px}.disable-field-jMLuez .title-s26PF2{margin-bottom:8px;font-size:14px;font-weight:600}.input-XYeEI3.input-XYeEI3{padding-top:4px}.input-XYeEI3 .semi-input-suffix{cursor:pointer;padding:8px}.link-button-tWRlPA.link-button-tWRlPA.link-button-tWRlPA{background-color:transparent}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"disable-field\": `disable-field-jMLuez`,\n\t\"disableField\": `disable-field-jMLuez`,\n\t\"title\": `title-s26PF2`,\n\t\"input\": `input-XYeEI3`,\n\t\"link-button\": `link-button-tWRlPA`,\n\t\"linkButton\": `link-button-tWRlPA`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.step-order-La7ARW{background:var(--light-color-brand-brand-5,#4d53e8);width:16px;height:16px;color:var(--light-color-white-white,#fff);border-radius:50%;justify-content:center;align-items:center;margin-top:2px;font-size:10px;font-weight:600;display:flex}.step-title-vWRtVL{color:#000;margin-bottom:8px;font-size:14px;font-weight:600;line-height:22px}.markdown-qLZ0zo{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"step-order\": `step-order-La7ARW`,\n\t\"stepOrder\": `step-order-La7ARW`,\n\t\"step-title\": `step-title-vWRtVL`,\n\t\"stepTitle\": `step-title-vWRtVL`,\n\t\"markdown\": `markdown-qLZ0zo`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.start-text-pXfZ2p{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}.config-link-HEiJGW{color:var(--light-color-brand-brand-5,#4d53e8);font-size:12px;line-height:16px}.markdown-PFR8kZ{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}.guide-XLqN5c{margin-bottom:32px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"start-text\": `start-text-pXfZ2p`,\n\t\"startText\": `start-text-pXfZ2p`,\n\t\"config-link\": `config-link-HEiJGW`,\n\t\"configLink\": `config-link-HEiJGW`,\n\t\"markdown\": `markdown-PFR8kZ`,\n\t\"guide\": `guide-XLqN5c`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.step-order-kS8rzB{background:var(--light-color-brand-brand-5,#4d53e8);width:16px;height:16px;color:var(--light-color-white-white,#fff);border-radius:50%;justify-content:center;align-items:center;margin-top:2px;font-size:10px;font-weight:600;display:flex}.step-title-fbaFcC{color:#000;margin-bottom:8px;font-size:14px;font-weight:600;line-height:22px}.markdown-ihOOii{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}.link-area-yqpTLT .link-list-hCIt6h{margin-top:16px}.link-area-yqpTLT .link-list-hCIt6h .title-HQq6si{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;font-weight:600;line-height:22px}.link-area-yqpTLT .link-list-hCIt6h .link-zMA1OB{word-break:break-word}.link-area-yqpTLT .link-list-hCIt6h .semi-form-field-error-message-ig2k1h{position:absolute}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"step-order\": `step-order-kS8rzB`,\n\t\"stepOrder\": `step-order-kS8rzB`,\n\t\"step-title\": `step-title-fbaFcC`,\n\t\"stepTitle\": `step-title-fbaFcC`,\n\t\"markdown\": `markdown-ihOOii`,\n\t\"link-area\": `link-area-yqpTLT`,\n\t\"linkArea\": `link-area-yqpTLT`,\n\t\"link-list\": `link-list-hCIt6h`,\n\t\"linkList\": `link-list-hCIt6h`,\n\t\"title\": `title-HQq6si`,\n\t\"link\": `link-zMA1OB`,\n\t\"semi-form-field-error-message\": `semi-form-field-error-message-ig2k1h`,\n\t\"semiFormFieldErrorMessage\": `semi-form-field-error-message-ig2k1h`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.info-title-hM03fu{margin-bottom:8px;font-size:16px;font-weight:600}.info-subtitle-xJLDxa{margin-top:12px;margin-bottom:8px;font-size:14px;font-weight:500}.container-LF_kv1{width:100%;height:100%}.diff-table-tF4K3Z{margin-bottom:24px}.diff-table-tF4K3Z .semi-table-row-head{border-bottom:1px solid var(--semi-color-border);font-size:12px;background-color:rgba(46,46,56,.04)!important;padding:4px 8px!important}.diff-table-tF4K3Z .semi-table-row-cell{font-size:12px;padding:10px 8px!important}.cell-span-H_nQzL{word-break:break-word;font-weight:400;font-size:12px!important}.property-tooltip-ji9W4V{word-break:break-word}.empty-container-YLcORh{flex-direction:column;justify-content:center;align-items:center;height:100%;min-height:200px;display:flex}.empty-info-q193R7{margin-top:4px}.list-BE2Xcy{border-radius:8px;border:1px solid var(--Stroke-COZ-stroke-plus,rgba(6,7,9,.15))!important;background-color:#fff!important}.list-BE2Xcy .semi-list-item{border-bottom:1px solid var(--Stroke-COZ-stroke-plus,rgba(6,7,9,.15))!important}.list-BE2Xcy .semi-list-item:last-child{border-bottom:none!important}.list-item-vLj8Sw{grid-template-columns:280px 120px 1fr;align-items:center;display:grid}.tag-1-aqUUN6{color:#3ec254;background-color:#d2f3d5}.tag-2-CdvW0P,.tag-4-MC5w82{color:#ff441e;background-color:#ffe0d2}.tag-3-KTmcm_{color:#ff9600;background-color:#fff1cc}.property-title-Tuf6E1{color:var(--Fg-COZ-fg-primary,rgba(6,7,9,.8));font-size:12px;font-weight:500}.info-block-s33QB0:not(:first-child){margin-top:24px}.mask-U3tgbz{pointer-events:none;background:linear-gradient(to top,rgba(var(--coze-bg-2),1)0,rgba(var(--coze-bg-2),0)100%);width:100%;height:32px;position:absolute;bottom:80px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"info-title\": `info-title-hM03fu`,\n\t\"infoTitle\": `info-title-hM03fu`,\n\t\"info-subtitle\": `info-subtitle-xJLDxa`,\n\t\"infoSubtitle\": `info-subtitle-xJLDxa`,\n\t\"container\": `container-LF_kv1`,\n\t\"diff-table\": `diff-table-tF4K3Z`,\n\t\"diffTable\": `diff-table-tF4K3Z`,\n\t\"cell-span\": `cell-span-H_nQzL`,\n\t\"cellSpan\": `cell-span-H_nQzL`,\n\t\"property-tooltip\": `property-tooltip-ji9W4V`,\n\t\"propertyTooltip\": `property-tooltip-ji9W4V`,\n\t\"empty-container\": `empty-container-YLcORh`,\n\t\"emptyContainer\": `empty-container-YLcORh`,\n\t\"empty-info\": `empty-info-q193R7`,\n\t\"emptyInfo\": `empty-info-q193R7`,\n\t\"list\": `list-BE2Xcy`,\n\t\"list-item\": `list-item-vLj8Sw`,\n\t\"listItem\": `list-item-vLj8Sw`,\n\t\"tag-1\": `tag-1-aqUUN6`,\n\t\"tag1\": `tag-1-aqUUN6`,\n\t\"tag-2\": `tag-2-CdvW0P`,\n\t\"tag2\": `tag-2-CdvW0P`,\n\t\"tag-4\": `tag-4-MC5w82`,\n\t\"tag4\": `tag-4-MC5w82`,\n\t\"tag-3\": `tag-3-KTmcm_`,\n\t\"tag3\": `tag-3-KTmcm_`,\n\t\"property-title\": `property-title-Tuf6E1`,\n\t\"propertyTitle\": `property-title-Tuf6E1`,\n\t\"info-block\": `info-block-s33QB0`,\n\t\"infoBlock\": `info-block-s33QB0`,\n\t\"mask\": `mask-U3tgbz`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.resource-group-YhQutA .resource-group-header-dQYzYW{cursor:pointer;justify-content:space-between;align-items:center;height:36px;padding:0 14px 0 17px;display:flex}.resource-group-YhQutA .resource-group-header-dQYzYW .header-left-PI8WU3{align-items:center;gap:4px;display:flex}.resource-group-YhQutA .resource-group-header-dQYzYW .header-title-m6jh2J{font-size:14px;font-weight:500;line-height:20px}.resource-group-YhQutA .resource-group-header-dQYzYW .action-group-wHBVve{align-items:center;gap:2px;display:flex}.resource-group-YhQutA .resource-group-content-s59UBy{padding:0 6px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"resource-group\": `resource-group-YhQutA`,\n\t\"resourceGroup\": `resource-group-YhQutA`,\n\t\"resource-group-header\": `resource-group-header-dQYzYW`,\n\t\"resourceGroupHeader\": `resource-group-header-dQYzYW`,\n\t\"header-left\": `header-left-PI8WU3`,\n\t\"headerLeft\": `header-left-PI8WU3`,\n\t\"header-title\": `header-title-m6jh2J`,\n\t\"headerTitle\": `header-title-m6jh2J`,\n\t\"action-group\": `action-group-wHBVve`,\n\t\"actionGroup\": `action-group-wHBVve`,\n\t\"resource-group-content\": `resource-group-content-s59UBy`,\n\t\"resourceGroupContent\": `resource-group-content-s59UBy`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.resource-list-UL45IN{width:100%;height:100%}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .item-is-selected{background-color:var(--coz-mg-primary)}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .item-is-selected:hover{background-color:var(--coz-mg-secondary-hovered)}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .item-is-temp-selected.item-is-selected{background-color:var(--coz-mg-primary)}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .base-item-hover-class:hover{background-color:var(--coz-mg-secondary-hovered)}.shortcut-lk6Mtn{color:var(--coz-fg-dim);font-family:Inter,sans-serif;font-size:12px;font-weight:700}.file-list-wrapper-EnRR5A{border:1px solid var(--coz-stroke-primary);border-radius:var(--coze-8);max-height:124px;margin-top:4px;overflow:auto}.file-list-wrapper-EnRR5A::-webkit-scrollbar{background:0 0;width:0;height:10px}.file-list-wrapper-EnRR5A::-webkit-scrollbar:hover{background:0 0}.file-list-wrapper-EnRR5A::-webkit-scrollbar-thumb{background:0 0}.file-list-wrapper-EnRR5A::-webkit-scrollbar-corner{background:0 0}.file-list-Ve2P05{flex-direction:column;align-items:flex-start;padding:6px 0;display:flex}.file-list-Ve2P05 .file-item-pzkzjD{text-overflow:ellipsis;white-space:nowrap;width:100%;height:22px;padding:0 8px;overflow:hidden}.file-list-Ve2P05 .file-item-pzkzjD .file-icon-n_bTZZ{color:var(--coz-fg-secondary);margin-right:4px;position:relative;top:2px}.file-list-Ve2P05 .file-item-pzkzjD .file-name-Ijw7og{color:var(--coz-fg-primary);font-size:14px}.empty-RIYl2e{flex-direction:column;justify-content:center;align-items:center;gap:12px;width:232px;height:80px;margin:0 auto;display:flex}.empty-RIYl2e .empty-card-gahwex{background-color:var(--coz-bg-max);border-radius:var(--coze-4);border:.5px solid #f0f0f0;flex-direction:row;justify-content:flex-start;align-items:center;gap:4px;padding:4.5px;display:flex}.empty-RIYl2e .empty-icon-TXAZwQ{background-color:var(--coz-mg-primary);border-radius:var(--coze-3);width:15px;height:15px}.empty-RIYl2e .empty-skeleton-DONg5h{opacity:.12;flex-direction:column;align-items:flex-start;gap:2.5px;display:flex}.empty-RIYl2e .empty-skeleton-DONg5h span{background-color:var(--coz-fg-secondary);border-radius:var(--coze-2);height:4.5px}.empty-RIYl2e .empty-skeleton-DONg5h span:first-child{width:20px}.empty-RIYl2e .empty-skeleton-DONg5h span:last-child{width:33px}.empty-RIYl2e .empty-title-NilH4m{color:var(--coz-fg-dim);font-size:12px;font-weight:400;line-height:16px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"resource-list\": `resource-list-UL45IN`,\n\t\"resourceList\": `resource-list-UL45IN`,\n\t\"resource-folder-coze\": `resource-folder-coze-XUy3TX`,\n\t\"resourceFolderCoze\": `resource-folder-coze-XUy3TX`,\n\t\"shortcut\": `shortcut-lk6Mtn`,\n\t\"file-list-wrapper\": `file-list-wrapper-EnRR5A`,\n\t\"fileListWrapper\": `file-list-wrapper-EnRR5A`,\n\t\"file-list\": `file-list-Ve2P05`,\n\t\"fileList\": `file-list-Ve2P05`,\n\t\"file-item\": `file-item-pzkzjD`,\n\t\"fileItem\": `file-item-pzkzjD`,\n\t\"file-icon\": `file-icon-n_bTZZ`,\n\t\"fileIcon\": `file-icon-n_bTZZ`,\n\t\"file-name\": `file-name-Ijw7og`,\n\t\"fileName\": `file-name-Ijw7og`,\n\t\"empty\": `empty-RIYl2e`,\n\t\"empty-card\": `empty-card-gahwex`,\n\t\"emptyCard\": `empty-card-gahwex`,\n\t\"empty-icon\": `empty-icon-TXAZwQ`,\n\t\"emptyIcon\": `empty-icon-TXAZwQ`,\n\t\"empty-skeleton\": `empty-skeleton-DONg5h`,\n\t\"emptySkeleton\": `empty-skeleton-DONg5h`,\n\t\"empty-title\": `empty-title-NilH4m`,\n\t\"emptyTitle\": `empty-title-NilH4m`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.resource-list-wrapper-mXc1nd{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%}.resource-list-wrapper-mXc1nd .resource-list-custom-event-wrapper{width:100%;height:100%}.resource-list-wrapper-mXc1nd .resource-list-scroll-container{height:100%;overflow-x:hidden;overflow-y:auto}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper{height:100%}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-wrapper{border-radius:4px;position:relative}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-wrapper .item-wrapper-indent-line{border-left-style:solid;border-left-width:1px;transition:all .2s ease-in-out;position:absolute}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-hover-class:hover{background-color:rgba(6,7,9,.08)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-is-temp-selected{background-color:rgba(6,7,9,.04);border-radius:0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-is-in-edit{background-color:rgba(6,7,9,.04)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-is-selected{background-color:rgba(6,7,9,.14)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .dragging-hover-class{background-color:rgba(148,152,247,.44);border-radius:0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item{align-items:center;width:100%;padding-right:8px;transition:all .1s ease-in-out;display:flex}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-icon{align-items:center;margin-right:4px;display:flex}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input{align-items:center;width:100%;display:flex;position:relative}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input .semi-input-wrapper{border-radius:6px;height:20px;line-height:20px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input .semi-input-wrapper-focus{background-color:#fff}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input [class~=semi-input]{height:20px;padding:0 4px;line-height:20px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input .base-item-name-input-error-msg-absolute{z-index:999;color:rgba(6,7,9,.5);background-color:#fff1f2;border:1px solid #f22435;border-radius:6px;align-items:center;width:100%;padding:2px 4px;font-size:12px;font-weight:700;line-height:16px;display:flex;position:absolute;top:26px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input-error [class~=semi-input-wrapper]{border-color:#f22435}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-more-hover-display-class{display:none}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item:hover .base-item-more-hover-display-class{display:flex}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-more-btn{color:rgba(6,7,9,.96);background-color:transparent;justify-content:center;align-items:center;width:16px;min-width:16px;height:16px;padding-left:0;padding-right:0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-more-btn:hover{background-color:rgba(6,7,9,.14)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-more-btn svg{width:12px;height:12px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-radius-class-first{border-radius:4px 4px 0 0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-radius-class-last{border-radius:0 0 4px 4px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-radius-class-single{border-radius:4px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"resource-list-wrapper\": `resource-list-wrapper-mXc1nd`,\n\t\"resourceListWrapper\": `resource-list-wrapper-mXc1nd`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.config-container-_jKhXq{background:var(--coz-bg-max);border:1px solid var(--coz-stroke-primary);border-top:none;border-radius:0 0 8px 8px;width:100%;height:100%;overflow:hidden}.config-container-_jKhXq .primary-sidebar-header-GIDj0H{justify-content:space-between;align-items:center;width:100%;padding:0 14px;font-size:14px;line-height:20px;display:flex}.config-container-_jKhXq .primary-sidebar-header-GIDj0H .title-FeuhvF{color:var(--coz-fg-plus);font-weight:500}.config-container-_jKhXq .item-WJQ3kG{color:var(--coz-fg-primary);border-radius:8px;align-items:center;margin:0 8px;padding:4px 8px 4px 20px;font-size:14px;line-height:1.5;display:flex}.config-container-_jKhXq .item-WJQ3kG:hover,.config-container-_jKhXq .item-WJQ3kG.activate-uBUYqB{cursor:pointer;color:var(--coz-fg-plus);background-color:var(--coz-mg-primary)}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"config-container\": `config-container-_jKhXq`,\n\t\"configContainer\": `config-container-_jKhXq`,\n\t\"primary-sidebar-header\": `primary-sidebar-header-GIDj0H`,\n\t\"primarySidebarHeader\": `primary-sidebar-header-GIDj0H`,\n\t\"title\": `title-FeuhvF`,\n\t\"item\": `item-WJQ3kG`,\n\t\"activate\": `activate-uBUYqB`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.global-loading-orDTkw{background:var(--coz-bg-max);justify-content:center;align-items:center;width:100%;height:100vh;display:flex;position:fixed;top:0;left:0}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"global-loading\": `global-loading-orDTkw`,\n\t\"globalLoading\": `global-loading-orDTkw`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.content-ixXohr{color:var(--coz-fg-secondary);margin-top:4px;font-size:14px;line-height:20px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"content\": `content-ixXohr`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.content-bHOPf6{color:var(--coz-fg-secondary);margin-top:4px;font-size:14px;line-height:20px}.content-bHOPf6 .error-container-_Y28mV{white-space:pre-wrap;flex-direction:column;flex:1 0 0;justify-content:center;align-items:center;gap:22px;margin:24px 0 22px;display:flex}.content-bHOPf6 .description-container-NlI420{text-align:center;flex-direction:column;justify-content:center;align-items:center;margin:28px 0 12px;display:flex}.content-bHOPf6 .description-container-NlI420 .spin-oAh06F{margin-bottom:12px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"content\": `content-bHOPf6`,\n\t\"error-container\": `error-container-_Y28mV`,\n\t\"errorContainer\": `error-container-_Y28mV`,\n\t\"description-container\": `description-container-NlI420`,\n\t\"descriptionContainer\": `description-container-NlI420`,\n\t\"spin\": `spin-oAh06F`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.primary-sidebar-HKe_Js{background:var(--coz-bg-max);border:1px solid var(--coz-stroke-primary);border-bottom:none;border-radius:8px 8px 0 0;width:100%;height:100%;overflow:hidden}.primary-sidebar-header-LcvDBK{justify-content:space-between;align-items:center;width:100%;padding:0 14px;font-size:14px;line-height:20px;display:flex}.primary-sidebar-header-LcvDBK .title-ugz3Nx{color:var(--coz-fg-plus);font-weight:500}.resource-list-wrapper-JlJNdV{overflow-y:auto}.resource-list-wrapper-JlJNdV::-webkit-scrollbar{background:0 0;width:0;height:10px}.resource-list-wrapper-JlJNdV::-webkit-scrollbar:hover{background:0 0}.resource-list-wrapper-JlJNdV::-webkit-scrollbar-thumb{background:0 0}.resource-list-wrapper-JlJNdV::-webkit-scrollbar-corner{background:0 0}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"primary-sidebar\": `primary-sidebar-HKe_Js`,\n\t\"primarySidebar\": `primary-sidebar-HKe_Js`,\n\t\"primary-sidebar-header\": `primary-sidebar-header-LcvDBK`,\n\t\"primarySidebarHeader\": `primary-sidebar-header-LcvDBK`,\n\t\"title\": `title-ugz3Nx`,\n\t\"resource-list-wrapper\": `resource-list-wrapper-JlJNdV`,\n\t\"resourceListWrapper\": `resource-list-wrapper-JlJNdV`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.icon-button-rjXhPW{margin-right:6px}.icon-button-rjXhPW.icon-button-rjXhPW.icon-button-rjXhPW{background-color:var(--coz-bg-max)}.icon-button-rjXhPW.icon-button-rjXhPW.icon-button-rjXhPW:hover{background-color:var(--coz-bg-6)}.icon-button-rjXhPW.icon-button-rjXhPW.icon-button-rjXhPW:active{background-color:var(--coz-bg-8)}.sidebar-wrapper-sSaaGq{width:282px;height:calc(100vh - 114px)}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"icon-button\": `icon-button-rjXhPW`,\n\t\"iconButton\": `icon-button-rjXhPW`,\n\t\"sidebar-wrapper\": `sidebar-wrapper-sSaaGq`,\n\t\"sidebarWrapper\": `sidebar-wrapper-sSaaGq`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.full-screen-button-ZxxIiN{border:1px solid var(--coz-stroke-primary);justify-content:center;align-items:center;display:flex}.shortcut-tE6S6S{justify-content:space-between;align-items:center;display:flex}.shortcut-tE6S6S .label-bhLPgL{font-size:14px;line-height:20px}.shortcut-tE6S6S .keybinding-jC_YMY{color:var(--coz-fg-dim);font-weight:700}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"full-screen-button\": `full-screen-button-ZxxIiN`,\n\t\"fullScreenButton\": `full-screen-button-ZxxIiN`,\n\t\"shortcut\": `shortcut-tE6S6S`,\n\t\"label\": `label-bhLPgL`,\n\t\"keybinding\": `keybinding-jC_YMY`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.project-info-lhSc0J{align-items:center;display:flex}.project-info-lhSc0J .title-kATuFD{color:var(--coz-fg-plus);margin:0 4px 0 8px;font-size:16px;font-weight:500;line-height:22px}.project-info-lhSc0J .check-icon-IOuXVa{background-color:#fff;border-radius:50%;justify-content:center;align-items:center;width:16px;height:16px;display:flex;position:absolute;top:31px;left:54px}.icon-xLquXQ.icon-xLquXQ.icon-xLquXQ{background-color:var(--coz-bg-plus)}.icon-xLquXQ.icon-xLquXQ.icon-xLquXQ:hover{background-color:var(--coz-bg-6)}.icon-xLquXQ.icon-xLquXQ.icon-xLquXQ:active{background-color:var(--coz-bg-8)}.content-ViYH65{flex-direction:column;justify-content:center;align-items:center;min-width:252px;max-width:320px;padding:16px;display:flex}.content-ViYH65 .title-kATuFD{word-break:break-all;margin:16px 0 2px;font-size:16px;font-weight:500;line-height:22px}.content-ViYH65 .description-OERQCC{word-break:break-all;font-size:14px;line-height:20px}.content-ViYH65 .tag-container-dngyT5{-moz-column-gap:4px;column-gap:4px;margin-top:8px;font-weight:500;display:flex}.content-ViYH65 .tag-container-dngyT5 .tag-daM42A{padding:2px 6px}.content-ViYH65 .owner-container-mJpSns{-moz-column-gap:4px;color:var(--coz-fg-secondary);align-items:center;column-gap:4px;margin-top:24px;font-size:12px;display:flex}.content-ViYH65 .time-IOV6xS{color:var(--coz-fg-secondary);word-break:break-all;margin-top:6px;font-size:12px;line-height:16px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"project-info\": `project-info-lhSc0J`,\n\t\"projectInfo\": `project-info-lhSc0J`,\n\t\"title\": `title-kATuFD`,\n\t\"check-icon\": `check-icon-IOuXVa`,\n\t\"checkIcon\": `check-icon-IOuXVa`,\n\t\"icon\": `icon-xLquXQ`,\n\t\"content\": `content-ViYH65`,\n\t\"description\": `description-OERQCC`,\n\t\"tag-container\": `tag-container-dngyT5`,\n\t\"tagContainer\": `tag-container-dngyT5`,\n\t\"tag\": `tag-daM42A`,\n\t\"owner-container\": `owner-container-mJpSns`,\n\t\"ownerContainer\": `owner-container-mJpSns`,\n\t\"time\": `time-IOV6xS`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.container-bkmzif{width:100%;height:100%;height:-moz-fit-content;flex-direction:column;height:fit-content;display:flex}.container-bkmzif .banner-a1qDt3{justify-content:center;align-items:center;width:100%;height:36px;display:flex}.top-bar-PkNJU7{align-items:center;width:100%;height:56px;display:flex}.top-bar-PkNJU7 .left-col-JvoTh0{-moz-column-gap:4px;align-items:center;column-gap:4px;height:100%;padding-left:4px;display:flex}.top-bar-PkNJU7 .middle-col-Xvqg6n{justify-content:center;align-items:center;height:100%;display:flex}.top-bar-PkNJU7 .right-col-bh6Ml1{-moz-column-gap:8px;justify-content:flex-end;align-items:center;column-gap:8px;height:100%;display:flex}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"container\": `container-bkmzif`,\n\t\"banner\": `banner-a1qDt3`,\n\t\"top-bar\": `top-bar-PkNJU7`,\n\t\"topBar\": `top-bar-PkNJU7`,\n\t\"left-col\": `left-col-JvoTh0`,\n\t\"leftCol\": `left-col-JvoTh0`,\n\t\"middle-col\": `middle-col-Xvqg6n`,\n\t\"middleCol\": `middle-col-Xvqg6n`,\n\t\"right-col\": `right-col-bh6Ml1`,\n\t\"rightCol\": `right-col-bh6Ml1`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.shortcut-item-yQPPVF{justify-content:space-between;align-items:center;margin-bottom:8px;display:flex}.shortcut-item-yQPPVF .label-R4NN_Y{font-size:14px;font-weight:500;line-height:20px}.shortcut-item-yQPPVF .keybinding-iByntU{display:flex}.shortcut-item-yQPPVF .keybinding-iByntU .keybinding-block-x6N_fk{min-width:20px;height:20px;color:var(--coz-fg-secondary);background:var(--coz-mg-primary);border:.5px solid var(--coz-stroke-primary);border-radius:4px;justify-content:center;align-items:center;margin-left:6px;font-family:SF Pro Text,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:9px;font-weight:800;display:flex}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"shortcut-item\": `shortcut-item-yQPPVF`,\n\t\"shortcutItem\": `shortcut-item-yQPPVF`,\n\t\"label\": `label-R4NN_Y`,\n\t\"keybinding\": `keybinding-iByntU`,\n\t\"keybinding-block\": `keybinding-block-x6N_fk`,\n\t\"keybindingBlock\": `keybinding-block-x6N_fk`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.default-container-diUeCI{background:rgba(0,0,0,.03);flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.default-container-diUeCI img{pointer-events:none}.default-container-diUeCI .title-DpF6rw{font-size:28px;font-weight:700;line-height:36px}.default-container-diUeCI .sub-title-LLGSdG{color:var(--coz-fg-secondary,rgba(6,7,9,.5));margin-bottom:40px;font-size:14px;line-height:20px}.default-container-diUeCI .gallery-ZgGwgK{justify-content:center;gap:12px;width:100%;display:flex}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH{cursor:pointer;flex-direction:column;width:320px;display:flex}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .gallery-image-D9NPd3{border:1px solid var(--coz-stroke-primary);border-radius:12px;flex-shrink:0}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .gallery-title-hOnIe8{font-size:16px;font-weight:500;font-weight:22px;margin:12px 0 8px}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .gallery-description-Vyu9aR{font-size:14px;font-weight:20px;color:var(--coz-fg-secondary,rgba(6,7,9,.05))}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .doc-search-i1EWnU{visibility:hidden;margin-top:12px}.default-container-diUeCI .gallery-block-zSgEFH:hover>.doc-search-i1EWnU{visibility:visible}.default-container-diUeCI .item-WeupOT{cursor:pointer;background-color:var(--coz-bg-max);border:1px solid var(--coz-stroke-primary);border-radius:8px;justify-content:space-between;align-items:center;width:320px;height:48px;margin-bottom:16px;padding:8px 12px 8px 8px;display:flex}.default-container-diUeCI .item-WeupOT:hover{background-color:var(--coz-bg-6)}.default-container-diUeCI .item-WeupOT:active{background-color:var(--coz-bg-8)}.default-container-diUeCI .item-WeupOT .item-pre-xa2oun{align-items:center;display:flex}.default-container-diUeCI .item-WeupOT .item-text-RDDB7K{margin-left:8px;font-size:14px;font-weight:500;line-height:20px}.default-container-diUeCI .icon-expand-nkgAqW{position:absolute;top:6px;left:8px}.default-container-diUeCI .full-screen-A096_5{position:absolute;top:6px;right:8px}.default-container-diUeCI .shortcuts-list-tL2iMa{flex-direction:column;width:320px;margin-top:48px;display:flex}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"default-container\": `default-container-diUeCI`,\n\t\"defaultContainer\": `default-container-diUeCI`,\n\t\"title\": `title-DpF6rw`,\n\t\"sub-title\": `sub-title-LLGSdG`,\n\t\"subTitle\": `sub-title-LLGSdG`,\n\t\"gallery\": `gallery-ZgGwgK`,\n\t\"gallery-block\": `gallery-block-zSgEFH`,\n\t\"galleryBlock\": `gallery-block-zSgEFH`,\n\t\"gallery-image\": `gallery-image-D9NPd3`,\n\t\"galleryImage\": `gallery-image-D9NPd3`,\n\t\"gallery-title\": `gallery-title-hOnIe8`,\n\t\"galleryTitle\": `gallery-title-hOnIe8`,\n\t\"gallery-description\": `gallery-description-Vyu9aR`,\n\t\"galleryDescription\": `gallery-description-Vyu9aR`,\n\t\"doc-search\": `doc-search-i1EWnU`,\n\t\"docSearch\": `doc-search-i1EWnU`,\n\t\"item\": `item-WeupOT`,\n\t\"item-pre\": `item-pre-xa2oun`,\n\t\"itemPre\": `item-pre-xa2oun`,\n\t\"item-text\": `item-text-RDDB7K`,\n\t\"itemText\": `item-text-RDDB7K`,\n\t\"icon-expand\": `icon-expand-nkgAqW`,\n\t\"iconExpand\": `icon-expand-nkgAqW`,\n\t\"full-screen\": `full-screen-A096_5`,\n\t\"fullScreen\": `full-screen-A096_5`,\n\t\"shortcuts-list\": `shortcuts-list-tL2iMa`,\n\t\"shortcutsList\": `shortcuts-list-tL2iMa`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.title-container-yiq3lB{margin:0 8px}.widget-title-lxpZLH{justify-content:space-between;align-items:center;display:flex}.widget-title-lxpZLH .semi-spin.coz-loading-wrapper{line-height:0}.title-label-IGa1w0{-moz-column-gap:8px;flex-grow:1;flex-shrink:1;align-items:center;column-gap:8px;width:0;display:flex}.label-icon-Lq44hT{align-items:center;display:flex}.label-text-DGsQEw{flex-grow:1;flex-shrink:1;width:0;line-height:20px}.close-icon-hwNTjH{cursor:pointer;align-items:center;display:flex}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"title-container\": `title-container-yiq3lB`,\n\t\"titleContainer\": `title-container-yiq3lB`,\n\t\"widget-title\": `widget-title-lxpZLH`,\n\t\"widgetTitle\": `widget-title-lxpZLH`,\n\t\"title-label\": `title-label-IGa1w0`,\n\t\"titleLabel\": `title-label-IGa1w0`,\n\t\"label-icon\": `label-icon-Lq44hT`,\n\t\"labelIcon\": `label-icon-Lq44hT`,\n\t\"label-text\": `label-text-DGsQEw`,\n\t\"labelText\": `label-text-DGsQEw`,\n\t\"close-icon\": `close-icon-hwNTjH`,\n\t\"closeIcon\": `close-icon-hwNTjH`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `body{overscroll-behavior:none;background:var(--coz-bg-primary)}.flowide-container{padding:0 8px 8px;background:var(--coz-bg-primary)!important}.flowide-container .gedit-playground{background-color:transparent!important}.flowide-container .project-ide-workflow-playground{background-color:rgba(0,0,0,.03)!important}.flowide-container #flowide-top-bar{background:var(--coz-bg-primary)!important;border-bottom:none!important;min-height:56px!important}.flowide-container #flowide-main-panel{border-radius:8px;background:var(--coz-bg-primary)!important}.flowide-container #flowide-secondary-sidebar{min-width:250px;max-width:250px;background:var(--coz-bg-primary)!important;border:none!important}.flowide-container .lm-DockPanel-widget{border-radius:0 0 8px 8px;min-width:360px!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar{background:var(--coz-bg-primary)!important;border:none!important;width:268px!important;min-width:268px!important;max-width:500px!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-child{min-height:44px}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle{border-right:1px solid var(--coz-stroke-primary);border-left:1px solid var(--coz-stroke-primary);transition:transform .2s ease-in-out;background:linear-gradient(to right,white 6px,var(--coz-stroke-primary)6px,var(--coz-stroke-primary)calc(100% - 6px),white calc(100% - 6px))!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle:after{margin-right:6px;min-height:4px!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle:hover:after,.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle:active:after{background:linear-gradient(to right,white 6px,var(--coz-stroke-hglt)6px,var(--coz-stroke-hglt)calc(100% - 6px),white calc(100% - 6px))!important}.flowide-container .lm-TabBar{padding:6px 8px;background:rgba(0,0,0,.03)!important;border-radius:8px 8px 0 0!important;height:44px!important;min-height:44px!important;max-height:44px!important}.flowide-container .lm-DockPanel-overlay{background:rgba(148,152,247,.16);border:none;border-radius:0 0 8px 8px;margin-top:44px}.flowide-container .lm-DockPanel-handle{opacity:0;transition:opacity .35s ease-out;background:0 0!important}.flowide-container .lm-DockPanel-handle:hover,.flowide-container .lm-DockPanel-handle:active{opacity:1;background:linear-gradient(to right,var(--coz-bg-plus)0,var(--coz-bg-plus)1px,var(--coz-stroke-hglt)1px,var(--coz-stroke-hglt)5px,var(--coz-bg-plus)5px)!important}.flowide-container .lm-TabBar-tab{border-radius:6px;position:relative;min-height:32px!important;max-height:32px!important;margin:0 4px!important;padding:0!important;overflow:visible!important}.flowide-container .lm-TabBar-tab:not(:first-child):after{content:\"\";background:var(--coz-stroke-primary);width:1px;height:16px;position:absolute;top:8px;left:-4px}.flowide-container .lm-TabBar-tab.lm-mod-current .flowide-container .lm-TabBar-tab:not(:first-child):after,.flowide-container .lm-TabBar-tab.lm-mod-current+.lm-TabBar-tab:not(:first-child):after,.flowide-container .lm-TabBar-tab:hover:after,.flowide-container .lm-TabBar-tab:hover+.lm-TabBar-tab:after,.flowide-container .lm-TabBar-tab .lm-TabBar-tabCloseIcon{display:none}.flowide-container .lm-TabBar-tab:hover:not(.lm-mod-current){background:var(--coz-mg-secondary-hovered)}.flowide-container .lm-TabBar-tab.lm-mod-current:before,.flowide-container .lm-TabBar-tab.lm-mod-current:after{display:none!important}.flowide-container .lm-TabBar-tab.lm-mod-current span{font-weight:500!important}.flowide-container .lm-TabBar-tabIcon{width:100%;display:block}.lm-mod-drag-image{border-radius:6px;position:relative;min-height:32px!important;max-height:32px!important;margin:0 4px!important;padding:0!important;overflow:visible!important}.lm-mod-drag-image .flow-tab-icon-label{align-items:center;width:100%;display:flex;overflow:hidden}.lm-mod-drag-image .flow-tab-icon-label .flow-TabBar-tabLabel-text{text-overflow:ellipsis;word-break:keep-all;white-space:nowrap;overflow:hidden}.lm-mod-drag-image .flow-tab-icon-label span{font-weight:500!important}.lm-mod-drag-image .flow-tab-icon-label .lm-TabBar-tabIcon{width:100%;display:block}.flow-tab-icon-label{cursor:pointer!important}.flow-Menu .flow-Menu-item .flow-Menu-itemLabel{font-size:14px;line-height:20px}.flow-Menu .flow-Menu-item .flow-Menu-itemShortcut{color:var(--coz-fg-dim);letter-spacing:1.2px;font-weight:700}.flow-Menu .flow-Menu-item[role~=menuitem]{min-height:32px!important}.flow-Menu .flow-Menu-item[role~=presentation]{background-color:var(--coz-stroke-primary);margin:4px 0;height:1px!important}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.template-form-kind2m .editor-container-v9qzn_{border:1px solid rgba(var(--coze-stroke-6),var(--coze-stroke-6-alpha))}.template-form-kind2m .editor-container-v9qzn_:focus-within{border-color:var(--semi-color-focus-border)}.template-form-kind2m .semi-form-field{padding-top:0}.template-form-kind2m .semi-upload-picture .semi-upload-picture-add{border:1px solid rgba(var(--coze-stroke-6),var(--coze-stroke-6-alpha));background-color:transparent}.template-form-kind2m .semi-upload-picture .semi-upload-picture-file-card-error{outline-offset:-1px}.template-form-kind2m .coz-single-select .semi-radio{margin-top:3px;margin-bottom:3px}.template-form-kind2m .coz-single-select .semi-radio .semi-radio-addon-buttonRadio{border-radius:6px}.template-form-kind2m .coz-input-number.semi-input-number .semi-input-wrapper{border-color:rgba(var(--coze-stroke-6),var(--coze-stroke-6-alpha))}.template-form-kind2m .coz-input-number.semi-input-number .semi-input-wrapper-focus{border-color:var(--semi-color-focus-border)}.template-form-kind2m .coz-input-number.semi-input-number .semi-input-suffix{margin-right:30px;font-size:12px;font-weight:400}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"template-form\": `template-form-kind2m`,\n\t\"templateForm\": `template-form-kind2m`,\n\t\"editor-container\": `editor-container-v9qzn_`,\n\t\"editorContainer\": `editor-container-v9qzn_`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.highlight-EyZl50{border-radius:4px;animation:3s forwards highlight-animation-FUji_T}@keyframes highlight-animation-FUji_T{0%{background-color:rgba(var(--coze-brand-0),var(--coze-brand-0-alpha))}to{background-color:transparent}}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"highlight\": `highlight-EyZl50`,\n\t\"highlight-animation\": `highlight-animation-FUji_T`,\n\t\"highlightAnimation\": `highlight-animation-FUji_T`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.mask-B9qkmd{background:linear-gradient(180deg,rgba(var(--coze-bg-2),var(--coze-bg-2-alpha))0 85%,transparent 100%)}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"mask\": `mask-B9qkmd`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.desc-input-ty8_FN>input{text-overflow:ellipsis}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"desc-input\": `desc-input-ty8_FN`,\n\t\"descInput\": `desc-input-ty8_FN`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.publish-collapse-VlVg4U .semi-collapse-item{border-bottom:1px solid var(--coz-stroke-primary);position:relative}.publish-collapse-VlVg4U .semi-collapse-item:hover{border-color:var(--coz-bg-primary)}.publish-collapse-VlVg4U .semi-collapse-header:hover:before{content:\"\";background-color:var(--coz-bg-primary);width:100%;height:1px;position:absolute;top:-1px;left:0}.publish-collapse-VlVg4U .semi-collapse-header{border-radius:0;margin:0;padding:8px 0}.publish-collapse-VlVg4U .semi-collapse-header:hover{background:var(--coz-mg-secondary-hovered);border-radius:8px}.publish-collapse-VlVg4U .semi-collapse-header:active{background:var(--coz-mg-secondary-pressed)}.publish-collapse-VlVg4U .semi-collapse-header-icon{margin:4px}.publish-collapse-VlVg4U .semi-collapse-content{padding:4px 0 16px}.publish-collapse-VlVg4U .semi-collapse-item:last-child{border:none}.publish-collapse-VlVg4U .semi-form-field-label{line-height:20px}.publish-cards-cgmQMc .semi-select.coz-select{border-radius:var(--small,6px);height:24px}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-inset-label{color:var(--coz-fg-secondary);margin:0 4px;font-size:12px;font-weight:400}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-selection .semi-select-selection-text{font-size:12px}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-arrow{width:22px}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-empty{margin-left:0}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-collapse{align-items:center;gap:2px;line-height:normal}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-collapse .semi-overflow-list-item{display:flex}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-collapse .semi-overflow-list-overflow{display:flex}.publish-cards-cgmQMc .semi-select.coz-select .semi-tag{background:var(--coz-mg_primary,rgba(6,7,9,.08));border-radius:2px;height:16px;padding:2px}.publish-cards-cgmQMc .semi-select-error{border:1px solid var(--coz-stroke-hglt-red)}.publish-cards-cgmQMc .coz-checkbox.semi-checkbox-unChecked .semi-checkbox-inner-display{border-color:var(--coz-stroke-plus)}.project-vxjogy .semi-form-field-error-message{color:var(--coz-fg-hglt-red);font-size:12px;line-height:16px}.project-vxjogy .semi-input{border-radius:8px}.project-vxjogy .semi-form-field{padding:0}.project-vxjogy .semi-input-textarea{height:72px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"publish-collapse\": `publish-collapse-VlVg4U`,\n\t\"publishCollapse\": `publish-collapse-VlVg4U`,\n\t\"publish-cards\": `publish-cards-cgmQMc`,\n\t\"publishCards\": `publish-cards-cgmQMc`,\n\t\"project\": `project-vxjogy`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.web-sdk-guide-_xvOoZ ol li::marker{color:var(--coz-fg-secondary);font-weight:500}.web-sdk-guide-_xvOoZ [class^=code-block-element]{height:160px}.web-sdk-guide-_xvOoZ [class^=code-block-element] [class^=content]{flex-shrink:1;overflow:auto}.web-sdk-guide-_xvOoZ [class^=code-block-element] [class^=content] pre{overflow:visible}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"web-sdk-guide\": `web-sdk-guide-_xvOoZ`,\n\t\"webSdkGuide\": `web-sdk-guide-_xvOoZ`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../../@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"./codicon.ttf?38dcd33a732ebca5a557e04831e9e235\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `@font-face{font-family:codicon;font-display:block;src:url(${___CSS_LOADER_URL_REPLACEMENT_0___})format(\"truetype\")}.codicon[class*=codicon-]{text-rendering:auto;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font:16px/1 codicon;text-decoration:none;display:inline-block}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin{animation:1.5s steps(30,end) infinite codicon-spin}.codicon-modifier-disabled{opacity:.5}.codicon-modifier-hidden{opacity:0}.codicon-loading{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.codicon-add:before,.codicon-plus:before,.codicon-gist-new:before,.codicon-repo-create:before{content:\"\"}.codicon-lightbulb:before,.codicon-light-bulb:before{content:\"\"}.codicon-repo:before,.codicon-repo-delete:before{content:\"\"}.codicon-gist-fork:before,.codicon-repo-forked:before{content:\"\"}.codicon-git-pull-request:before,.codicon-git-pull-request-abandoned:before{content:\"\"}.codicon-record-keys:before,.codicon-keyboard:before{content:\"\"}.codicon-tag:before,.codicon-git-pull-request-label:before,.codicon-tag-add:before,.codicon-tag-remove:before{content:\"\"}.codicon-person:before,.codicon-person-follow:before,.codicon-person-outline:before,.codicon-person-filled:before{content:\"\"}.codicon-git-branch:before,.codicon-git-branch-create:before,.codicon-git-branch-delete:before,.codicon-source-control:before{content:\"\"}.codicon-mirror:before,.codicon-mirror-public:before{content:\"\"}.codicon-star:before,.codicon-star-add:before,.codicon-star-delete:before,.codicon-star-empty:before{content:\"\"}.codicon-comment:before,.codicon-comment-add:before{content:\"\"}.codicon-alert:before,.codicon-warning:before{content:\"\"}.codicon-search:before,.codicon-search-save:before{content:\"\"}.codicon-log-out:before,.codicon-sign-out:before{content:\"\"}.codicon-log-in:before,.codicon-sign-in:before{content:\"\"}.codicon-eye:before,.codicon-eye-unwatch:before,.codicon-eye-watch:before{content:\"\"}.codicon-circle-filled:before,.codicon-primitive-dot:before,.codicon-close-dirty:before,.codicon-debug-breakpoint:before,.codicon-debug-breakpoint-disabled:before,.codicon-debug-hint:before,.codicon-terminal-decoration-success:before{content:\"\"}.codicon-primitive-square:before{content:\"\"}.codicon-edit:before,.codicon-pencil:before{content:\"\"}.codicon-info:before,.codicon-issue-opened:before{content:\"\"}.codicon-gist-private:before,.codicon-git-fork-private:before,.codicon-lock:before,.codicon-mirror-private:before{content:\"\"}.codicon-close:before,.codicon-remove-close:before,.codicon-x:before{content:\"\"}.codicon-repo-sync:before,.codicon-sync:before{content:\"\"}.codicon-clone:before,.codicon-desktop-download:before{content:\"\"}.codicon-beaker:before,.codicon-microscope:before{content:\"\"}.codicon-vm:before,.codicon-device-desktop:before{content:\"\"}.codicon-file:before,.codicon-file-text:before{content:\"\"}.codicon-more:before,.codicon-ellipsis:before,.codicon-kebab-horizontal:before{content:\"\"}.codicon-mail-reply:before,.codicon-reply:before{content:\"\"}.codicon-organization:before,.codicon-organization-filled:before,.codicon-organization-outline:before{content:\"\"}.codicon-new-file:before,.codicon-file-add:before{content:\"\"}.codicon-new-folder:before,.codicon-file-directory-create:before{content:\"\"}.codicon-trash:before,.codicon-trashcan:before{content:\"\"}.codicon-history:before,.codicon-clock:before{content:\"\"}.codicon-folder:before,.codicon-file-directory:before,.codicon-symbol-folder:before{content:\"\"}.codicon-logo-github:before,.codicon-mark-github:before,.codicon-github:before{content:\"\"}.codicon-terminal:before,.codicon-console:before,.codicon-repl:before{content:\"\"}.codicon-zap:before,.codicon-symbol-event:before{content:\"\"}.codicon-error:before,.codicon-stop:before{content:\"\"}.codicon-variable:before,.codicon-symbol-variable:before{content:\"\"}.codicon-array:before,.codicon-symbol-array:before{content:\"\"}.codicon-symbol-module:before,.codicon-symbol-package:before,.codicon-symbol-namespace:before,.codicon-symbol-object:before{content:\"\"}.codicon-symbol-method:before,.codicon-symbol-function:before,.codicon-symbol-constructor:before{content:\"\"}.codicon-symbol-boolean:before,.codicon-symbol-null:before{content:\"\"}.codicon-symbol-numeric:before,.codicon-symbol-number:before{content:\"\"}.codicon-symbol-structure:before,.codicon-symbol-struct:before{content:\"\"}.codicon-symbol-parameter:before,.codicon-symbol-type-parameter:before{content:\"\"}.codicon-symbol-key:before,.codicon-symbol-text:before{content:\"\"}.codicon-symbol-reference:before,.codicon-go-to-file:before{content:\"\"}.codicon-symbol-enum:before,.codicon-symbol-value:before{content:\"\"}.codicon-symbol-ruler:before,.codicon-symbol-unit:before{content:\"\"}.codicon-activate-breakpoints:before{content:\"\"}.codicon-archive:before{content:\"\"}.codicon-arrow-both:before{content:\"\"}.codicon-arrow-down:before{content:\"\"}.codicon-arrow-left:before{content:\"\"}.codicon-arrow-right:before{content:\"\"}.codicon-arrow-small-down:before{content:\"\"}.codicon-arrow-small-left:before{content:\"\"}.codicon-arrow-small-right:before{content:\"\"}.codicon-arrow-small-up:before{content:\"\"}.codicon-arrow-up:before{content:\"\"}.codicon-bell:before{content:\"\"}.codicon-bold:before{content:\"\"}.codicon-book:before{content:\"\"}.codicon-bookmark:before{content:\"\"}.codicon-debug-breakpoint-conditional-unverified:before{content:\"\"}.codicon-debug-breakpoint-conditional:before,.codicon-debug-breakpoint-conditional-disabled:before{content:\"\"}.codicon-debug-breakpoint-data-unverified:before{content:\"\"}.codicon-debug-breakpoint-data:before,.codicon-debug-breakpoint-data-disabled:before{content:\"\"}.codicon-debug-breakpoint-log-unverified:before{content:\"\"}.codicon-debug-breakpoint-log:before,.codicon-debug-breakpoint-log-disabled:before{content:\"\"}.codicon-briefcase:before{content:\"\"}.codicon-broadcast:before{content:\"\"}.codicon-browser:before{content:\"\"}.codicon-bug:before{content:\"\"}.codicon-calendar:before{content:\"\"}.codicon-case-sensitive:before{content:\"\"}.codicon-check:before{content:\"\"}.codicon-checklist:before{content:\"\"}.codicon-chevron-down:before{content:\"\"}.codicon-chevron-left:before{content:\"\"}.codicon-chevron-right:before{content:\"\"}.codicon-chevron-up:before{content:\"\"}.codicon-chrome-close:before{content:\"\"}.codicon-chrome-maximize:before{content:\"\"}.codicon-chrome-minimize:before{content:\"\"}.codicon-chrome-restore:before{content:\"\"}.codicon-circle-outline:before,.codicon-circle:before,.codicon-debug-breakpoint-unverified:before,.codicon-terminal-decoration-incomplete:before{content:\"\"}.codicon-circle-slash:before{content:\"\"}.codicon-circuit-board:before{content:\"\"}.codicon-clear-all:before{content:\"\"}.codicon-clippy:before{content:\"\"}.codicon-close-all:before{content:\"\"}.codicon-cloud-download:before{content:\"\"}.codicon-cloud-upload:before{content:\"\"}.codicon-code:before{content:\"\"}.codicon-collapse-all:before{content:\"\"}.codicon-color-mode:before{content:\"\"}.codicon-comment-discussion:before{content:\"\"}.codicon-credit-card:before{content:\"\"}.codicon-dash:before{content:\"\"}.codicon-dashboard:before{content:\"\"}.codicon-database:before{content:\"\"}.codicon-debug-continue:before{content:\"\"}.codicon-debug-disconnect:before{content:\"\"}.codicon-debug-pause:before{content:\"\"}.codicon-debug-restart:before{content:\"\"}.codicon-debug-start:before{content:\"\"}.codicon-debug-step-into:before{content:\"\"}.codicon-debug-step-out:before{content:\"\"}.codicon-debug-step-over:before{content:\"\"}.codicon-debug-stop:before{content:\"\"}.codicon-debug:before{content:\"\"}.codicon-device-camera-video:before{content:\"\"}.codicon-device-camera:before{content:\"\"}.codicon-device-mobile:before{content:\"\"}.codicon-diff-added:before{content:\"\"}.codicon-diff-ignored:before{content:\"\"}.codicon-diff-modified:before{content:\"\"}.codicon-diff-removed:before{content:\"\"}.codicon-diff-renamed:before{content:\"\"}.codicon-diff:before,.codicon-diff-sidebyside:before{content:\"\"}.codicon-discard:before{content:\"\"}.codicon-editor-layout:before{content:\"\"}.codicon-empty-window:before{content:\"\"}.codicon-exclude:before{content:\"\"}.codicon-extensions:before{content:\"\"}.codicon-eye-closed:before{content:\"\"}.codicon-file-binary:before{content:\"\"}.codicon-file-code:before{content:\"\"}.codicon-file-media:before{content:\"\"}.codicon-file-pdf:before{content:\"\"}.codicon-file-submodule:before{content:\"\"}.codicon-file-symlink-directory:before{content:\"\"}.codicon-file-symlink-file:before{content:\"\"}.codicon-file-zip:before{content:\"\"}.codicon-files:before{content:\"\"}.codicon-filter:before{content:\"\"}.codicon-flame:before{content:\"\"}.codicon-fold-down:before{content:\"\"}.codicon-fold-up:before{content:\"\"}.codicon-fold:before{content:\"\"}.codicon-folder-active:before{content:\"\"}.codicon-folder-opened:before{content:\"\"}.codicon-gear:before{content:\"\"}.codicon-gift:before{content:\"\"}.codicon-gist-secret:before{content:\"\"}.codicon-gist:before{content:\"\"}.codicon-git-commit:before{content:\"\"}.codicon-git-compare:before,.codicon-compare-changes:before{content:\"\"}.codicon-git-merge:before{content:\"\"}.codicon-github-action:before{content:\"\"}.codicon-github-alt:before{content:\"\"}.codicon-globe:before{content:\"\"}.codicon-grabber:before{content:\"\"}.codicon-graph:before{content:\"\"}.codicon-gripper:before{content:\"\"}.codicon-heart:before{content:\"\"}.codicon-home:before{content:\"\"}.codicon-horizontal-rule:before{content:\"\"}.codicon-hubot:before{content:\"\"}.codicon-inbox:before{content:\"\"}.codicon-issue-reopened:before{content:\"\"}.codicon-issues:before{content:\"\"}.codicon-italic:before{content:\"\"}.codicon-jersey:before{content:\"\"}.codicon-json:before{content:\"\"}.codicon-kebab-vertical:before{content:\"\"}.codicon-key:before{content:\"\"}.codicon-law:before{content:\"\"}.codicon-lightbulb-autofix:before{content:\"\"}.codicon-link-external:before{content:\"\"}.codicon-link:before{content:\"\"}.codicon-list-ordered:before{content:\"\"}.codicon-list-unordered:before{content:\"\"}.codicon-live-share:before{content:\"\"}.codicon-loading:before{content:\"\"}.codicon-location:before{content:\"\"}.codicon-mail-read:before{content:\"\"}.codicon-mail:before{content:\"\"}.codicon-markdown:before{content:\"\"}.codicon-megaphone:before{content:\"\"}.codicon-mention:before{content:\"\"}.codicon-milestone:before,.codicon-git-pull-request-milestone:before{content:\"\"}.codicon-mortar-board:before{content:\"\"}.codicon-move:before{content:\"\"}.codicon-multiple-windows:before{content:\"\"}.codicon-mute:before{content:\"\"}.codicon-no-newline:before{content:\"\"}.codicon-note:before{content:\"\"}.codicon-octoface:before{content:\"\"}.codicon-open-preview:before{content:\"\"}.codicon-package:before{content:\"\"}.codicon-paintcan:before{content:\"\"}.codicon-pin:before{content:\"\"}.codicon-play:before,.codicon-run:before{content:\"\"}.codicon-plug:before{content:\"\"}.codicon-preserve-case:before{content:\"\"}.codicon-preview:before{content:\"\"}.codicon-project:before{content:\"\"}.codicon-pulse:before{content:\"\"}.codicon-question:before{content:\"\"}.codicon-quote:before{content:\"\"}.codicon-radio-tower:before{content:\"\"}.codicon-reactions:before{content:\"\"}.codicon-references:before{content:\"\"}.codicon-refresh:before{content:\"\"}.codicon-regex:before{content:\"\"}.codicon-remote-explorer:before{content:\"\"}.codicon-remote:before{content:\"\"}.codicon-remove:before{content:\"\"}.codicon-replace-all:before{content:\"\"}.codicon-replace:before{content:\"\"}.codicon-repo-clone:before{content:\"\"}.codicon-repo-force-push:before{content:\"\"}.codicon-repo-pull:before{content:\"\"}.codicon-repo-push:before{content:\"\"}.codicon-report:before{content:\"\"}.codicon-request-changes:before{content:\"\"}.codicon-rocket:before{content:\"\"}.codicon-root-folder-opened:before{content:\"\"}.codicon-root-folder:before{content:\"\"}.codicon-rss:before{content:\"\"}.codicon-ruby:before{content:\"\"}.codicon-save-all:before{content:\"\"}.codicon-save-as:before{content:\"\"}.codicon-save:before{content:\"\"}.codicon-screen-full:before{content:\"\"}.codicon-screen-normal:before{content:\"\"}.codicon-search-stop:before{content:\"\"}.codicon-server:before{content:\"\"}.codicon-settings-gear:before{content:\"\"}.codicon-settings:before{content:\"\"}.codicon-shield:before{content:\"\"}.codicon-smiley:before{content:\"\"}.codicon-sort-precedence:before{content:\"\"}.codicon-split-horizontal:before{content:\"\"}.codicon-split-vertical:before{content:\"\"}.codicon-squirrel:before{content:\"\"}.codicon-star-full:before{content:\"\"}.codicon-star-half:before{content:\"\"}.codicon-symbol-class:before{content:\"\"}.codicon-symbol-color:before{content:\"\"}.codicon-symbol-constant:before{content:\"\"}.codicon-symbol-enum-member:before{content:\"\"}.codicon-symbol-field:before{content:\"\"}.codicon-symbol-file:before{content:\"\"}.codicon-symbol-interface:before{content:\"\"}.codicon-symbol-keyword:before{content:\"\"}.codicon-symbol-misc:before{content:\"\"}.codicon-symbol-operator:before{content:\"\"}.codicon-symbol-property:before,.codicon-wrench:before,.codicon-wrench-subaction:before{content:\"\"}.codicon-symbol-snippet:before{content:\"\"}.codicon-tasklist:before{content:\"\"}.codicon-telescope:before{content:\"\"}.codicon-text-size:before{content:\"\"}.codicon-three-bars:before{content:\"\"}.codicon-thumbsdown:before{content:\"\"}.codicon-thumbsup:before{content:\"\"}.codicon-tools:before{content:\"\"}.codicon-triangle-down:before{content:\"\"}.codicon-triangle-left:before{content:\"\"}.codicon-triangle-right:before{content:\"\"}.codicon-triangle-up:before{content:\"\"}.codicon-twitter:before{content:\"\"}.codicon-unfold:before{content:\"\"}.codicon-unlock:before{content:\"\"}.codicon-unmute:before{content:\"\"}.codicon-unverified:before{content:\"\"}.codicon-verified:before{content:\"\"}.codicon-versions:before{content:\"\"}.codicon-vm-active:before{content:\"\"}.codicon-vm-outline:before{content:\"\"}.codicon-vm-running:before{content:\"\"}.codicon-watch:before{content:\"\"}.codicon-whitespace:before{content:\"\"}.codicon-whole-word:before{content:\"\"}.codicon-window:before{content:\"\"}.codicon-word-wrap:before{content:\"\"}.codicon-zoom-in:before{content:\"\"}.codicon-zoom-out:before{content:\"\"}.codicon-list-filter:before{content:\"\"}.codicon-list-flat:before{content:\"\"}.codicon-list-selection:before,.codicon-selection:before{content:\"\"}.codicon-list-tree:before{content:\"\"}.codicon-debug-breakpoint-function-unverified:before{content:\"\"}.codicon-debug-breakpoint-function:before,.codicon-debug-breakpoint-function-disabled:before{content:\"\"}.codicon-debug-stackframe-active:before{content:\"\"}.codicon-circle-small-filled:before,.codicon-debug-stackframe-dot:before,.codicon-terminal-decoration-mark:before{content:\"\"}.codicon-debug-stackframe:before,.codicon-debug-stackframe-focused:before{content:\"\"}.codicon-debug-breakpoint-unsupported:before{content:\"\"}.codicon-symbol-string:before{content:\"\"}.codicon-debug-reverse-continue:before{content:\"\"}.codicon-debug-step-back:before{content:\"\"}.codicon-debug-restart-frame:before{content:\"\"}.codicon-debug-alt:before{content:\"\"}.codicon-call-incoming:before{content:\"\"}.codicon-call-outgoing:before{content:\"\"}.codicon-menu:before{content:\"\"}.codicon-expand-all:before{content:\"\"}.codicon-feedback:before,.codicon-git-pull-request-reviewer:before{content:\"\"}.codicon-group-by-ref-type:before{content:\"\"}.codicon-ungroup-by-ref-type:before{content:\"\"}.codicon-account:before,.codicon-git-pull-request-assignee:before{content:\"\"}.codicon-bell-dot:before{content:\"\"}.codicon-debug-console:before{content:\"\"}.codicon-library:before{content:\"\"}.codicon-output:before{content:\"\"}.codicon-run-all:before{content:\"\"}.codicon-sync-ignored:before{content:\"\"}.codicon-pinned:before{content:\"\"}.codicon-github-inverted:before{content:\"\"}.codicon-server-process:before{content:\"\"}.codicon-server-environment:before{content:\"\"}.codicon-pass:before,.codicon-issue-closed:before{content:\"\"}.codicon-stop-circle:before{content:\"\"}.codicon-play-circle:before{content:\"\"}.codicon-record:before{content:\"\"}.codicon-debug-alt-small:before{content:\"\"}.codicon-vm-connect:before{content:\"\"}.codicon-cloud:before{content:\"\"}.codicon-merge:before{content:\"\"}.codicon-export:before{content:\"\"}.codicon-graph-left:before{content:\"\"}.codicon-magnet:before{content:\"\"}.codicon-notebook:before{content:\"\"}.codicon-redo:before{content:\"\"}.codicon-check-all:before{content:\"\"}.codicon-pinned-dirty:before{content:\"\"}.codicon-pass-filled:before{content:\"\"}.codicon-circle-large-filled:before{content:\"\"}.codicon-circle-large:before,.codicon-circle-large-outline:before{content:\"\"}.codicon-combine:before,.codicon-gather:before{content:\"\"}.codicon-table:before{content:\"\"}.codicon-variable-group:before{content:\"\"}.codicon-type-hierarchy:before{content:\"\"}.codicon-type-hierarchy-sub:before{content:\"\"}.codicon-type-hierarchy-super:before{content:\"\"}.codicon-git-pull-request-create:before{content:\"\"}.codicon-run-above:before{content:\"\"}.codicon-run-below:before{content:\"\"}.codicon-notebook-template:before{content:\"\"}.codicon-debug-rerun:before{content:\"\"}.codicon-workspace-trusted:before{content:\"\"}.codicon-workspace-untrusted:before{content:\"\"}.codicon-workspace-unknown:before{content:\"\"}.codicon-terminal-cmd:before{content:\"\"}.codicon-terminal-debian:before{content:\"\"}.codicon-terminal-linux:before{content:\"\"}.codicon-terminal-powershell:before{content:\"\"}.codicon-terminal-tmux:before{content:\"\"}.codicon-terminal-ubuntu:before{content:\"\"}.codicon-terminal-bash:before{content:\"\"}.codicon-arrow-swap:before{content:\"\"}.codicon-copy:before{content:\"\"}.codicon-person-add:before{content:\"\"}.codicon-filter-filled:before{content:\"\"}.codicon-wand:before{content:\"\"}.codicon-debug-line-by-line:before{content:\"\"}.codicon-inspect:before{content:\"\"}.codicon-layers:before{content:\"\"}.codicon-layers-dot:before{content:\"\"}.codicon-layers-active:before{content:\"\"}.codicon-compass:before{content:\"\"}.codicon-compass-dot:before{content:\"\"}.codicon-compass-active:before{content:\"\"}.codicon-azure:before{content:\"\"}.codicon-issue-draft:before{content:\"\"}.codicon-git-pull-request-closed:before{content:\"\"}.codicon-git-pull-request-draft:before{content:\"\"}.codicon-debug-all:before{content:\"\"}.codicon-debug-coverage:before{content:\"\"}.codicon-run-errors:before{content:\"\"}.codicon-folder-library:before{content:\"\"}.codicon-debug-continue-small:before{content:\"\"}.codicon-beaker-stop:before{content:\"\"}.codicon-graph-line:before{content:\"\"}.codicon-graph-scatter:before{content:\"\"}.codicon-pie-chart:before{content:\"\"}.codicon-bracket:before{content:\"\"}.codicon-bracket-dot:before{content:\"\"}.codicon-bracket-error:before{content:\"\"}.codicon-lock-small:before{content:\"\"}.codicon-azure-devops:before{content:\"\"}.codicon-verified-filled:before{content:\"\"}.codicon-newline:before{content:\"\"}.codicon-layout:before{content:\"\"}.codicon-layout-activitybar-left:before{content:\"\"}.codicon-layout-activitybar-right:before{content:\"\"}.codicon-layout-panel-left:before{content:\"\"}.codicon-layout-panel-center:before{content:\"\"}.codicon-layout-panel-justify:before{content:\"\"}.codicon-layout-panel-right:before{content:\"\"}.codicon-layout-panel:before{content:\"\"}.codicon-layout-sidebar-left:before{content:\"\"}.codicon-layout-sidebar-right:before{content:\"\"}.codicon-layout-statusbar:before{content:\"\"}.codicon-layout-menubar:before{content:\"\"}.codicon-layout-centered:before{content:\"\"}.codicon-target:before{content:\"\"}.codicon-indent:before{content:\"\"}.codicon-record-small:before{content:\"\"}.codicon-error-small:before,.codicon-terminal-decoration-error:before{content:\"\"}.codicon-arrow-circle-down:before{content:\"\"}.codicon-arrow-circle-left:before{content:\"\"}.codicon-arrow-circle-right:before{content:\"\"}.codicon-arrow-circle-up:before{content:\"\"}.codicon-layout-sidebar-right-off:before{content:\"\"}.codicon-layout-panel-off:before{content:\"\"}.codicon-layout-sidebar-left-off:before{content:\"\"}.codicon-blank:before{content:\"\"}.codicon-heart-filled:before{content:\"\"}.codicon-map:before,.codicon-map-horizontal:before,.codicon-fold-horizontal:before{content:\"\"}.codicon-map-filled:before,.codicon-map-horizontal-filled:before,.codicon-fold-horizontal-filled:before{content:\"\"}.codicon-circle-small:before{content:\"\"}.codicon-bell-slash:before{content:\"\"}.codicon-bell-slash-dot:before{content:\"\"}.codicon-comment-unresolved:before{content:\"\"}.codicon-git-pull-request-go-to-changes:before{content:\"\"}.codicon-git-pull-request-new-changes:before{content:\"\"}.codicon-search-fuzzy:before{content:\"\"}.codicon-comment-draft:before{content:\"\"}.codicon-send:before{content:\"\"}.codicon-sparkle:before{content:\"\"}.codicon-insert:before{content:\"\"}.codicon-mic:before{content:\"\"}.codicon-thumbsdown-filled:before{content:\"\"}.codicon-thumbsup-filled:before{content:\"\"}.codicon-coffee:before{content:\"\"}.codicon-snake:before{content:\"\"}.codicon-game:before{content:\"\"}.codicon-vr:before{content:\"\"}.codicon-chip:before{content:\"\"}.codicon-piano:before{content:\"\"}.codicon-music:before{content:\"\"}.codicon-mic-filled:before{content:\"\"}.codicon-repo-fetch:before{content:\"\"}.codicon-copilot:before{content:\"\"}.codicon-lightbulb-sparkle:before{content:\"\"}.codicon-robot:before{content:\"\"}.codicon-sparkle-filled:before{content:\"\"}.codicon-diff-single:before{content:\"\"}.codicon-diff-multiple:before{content:\"\"}.codicon-surround-with:before{content:\"\"}.codicon-share:before{content:\"\"}.codicon-git-stash:before{content:\"\"}.codicon-git-stash-apply:before{content:\"\"}.codicon-git-stash-pop:before{content:\"\"}.codicon-vscode:before{content:\"\"}.codicon-vscode-insiders:before{content:\"\"}.codicon-code-oss:before{content:\"\"}.codicon-run-coverage:before{content:\"\"}.codicon-run-all-coverage:before{content:\"\"}.codicon-coverage:before{content:\"\"}.codicon-github-project:before{content:\"\"}.codicon-map-vertical:before,.codicon-fold-vertical:before{content:\"\"}.codicon-map-vertical-filled:before,.codicon-fold-vertical-filled:before{content:\"\"}.codicon-go-to-search:before{content:\"\"}.codicon-percentage:before,.codicon-sort-percentage:before{content:\"\"}.codicon-git-fetch:before{content:\"\"}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.lm-Widget{box-sizing:border-box;position:relative;overflow:hidden}.lm-Widget.lm-mod-hidden{display:none!important}.lm-DockPanel,.lm-DockPanel-widget{z-index:0}.lm-DockPanel-tabBar{z-index:1}.lm-DockPanel-handle{z-index:2}.lm-DockPanel-handle.lm-mod-hidden{display:none!important}.lm-DockPanel-handle:after{content:\"\";width:100%;height:100%;position:absolute;top:0;left:0}.lm-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.lm-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.lm-DockPanel-handle[data-orientation=horizontal]:after{min-width:8px;left:50%;transform:translate(-50%)}.lm-DockPanel-handle[data-orientation=vertical]:after{min-height:8px;top:50%;transform:translateY(-50%)}.lm-DockPanel-overlay{pointer-events:none;z-index:3;box-sizing:border-box}.lm-DockPanel-overlay.lm-mod-hidden{display:none!important}.lm-SplitPanel-child{z-index:0}.lm-SplitPanel-handle{z-index:1}.lm-SplitPanel-handle.lm-mod-hidden{display:none!important}.lm-SplitPanel-handle:after{content:\"\";width:100%;height:100%;position:absolute;top:0;left:0}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle{cursor:ew-resize}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle{cursor:ns-resize}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle:after{min-width:8px;left:50%;transform:translate(-50%)}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle:after{min-height:8px;top:50%;transform:translateY(-50%)}.lm-TabBar{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex}.lm-TabBar[data-orientation=horizontal]{flex-direction:row;align-items:flex-end}.lm-TabBar[data-orientation=vertical]{flex-direction:column;align-items:flex-end}.lm-TabBar-content{flex:auto;margin:0;padding:0;list-style-type:none;display:flex}.lm-TabBar[data-orientation=horizontal]>.lm-TabBar-content{flex-direction:row}.lm-TabBar[data-orientation=vertical]>.lm-TabBar-content{flex-direction:column}.lm-TabBar-tab{touch-action:none;box-sizing:border-box;flex-direction:row;display:flex;overflow:hidden}.lm-TabBar-tabIcon,.lm-TabBar-tabCloseIcon{flex:none}.lm-TabBar-tabLabel{white-space:nowrap;flex:auto;overflow:hidden}.lm-TabBar-tabInput{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;box-sizing:border-box;width:100%}.lm-TabBar-tab.lm-mod-hidden,.lm-TabBar-addButton.lm-mod-hidden{display:none!important}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab{position:relative}.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab{transition:left .15s;left:0}.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab{transition:top .15s;top:0}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging{transition:none}.lm-TabBar-tabLabel .lm-TabBar-tabInput{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;box-sizing:border-box;background:inherit;width:100%}.lm-TabPanel-tabBar{z-index:1}.lm-TabPanel-stackedPanel{z-index:0}.lm-DockPanel-overlay{background:rgba(255,255,255,.6);border:1px dashed #000;transition-property:top,left,right,bottom;transition-duration:.15s;transition-timing-function:ease}.lm-TabBar{min-height:24px;max-height:24px}.lm-TabBar-content{border-bottom:1px solid silver;align-items:flex-end;min-width:0;min-height:0}.lm-TabBar-tab{background:#e5e5e5;border:1px solid silver;border-bottom:none;flex:0 125px;min-width:35px;min-height:20px;max-height:20px;margin-left:-1px;padding:0 10px;font:12px/20px Helvetica,Arial,sans-serif}.lm-TabBar-tabLabel .lm-TabBar-tabInput{border:0;padding:0;font:12px Helvetica,Arial,sans-serif}.lm-TabBar-tab.lm-mod-current{background:#fff;min-height:23px;max-height:23px;transform:translateY(1px)}.lm-TabBar-tab:hover:not(.lm-mod-current){background:#f0f0f0}.lm-TabBar-tab:first-child{margin-left:0}.lm-TabBar-tabIcon,.lm-TabBar-tabLabel,.lm-TabBar-tabCloseIcon{display:inline-block}.lm-TabBar-tab.lm-mod-closable>.lm-TabBar-tabCloseIcon{margin-left:4px}.lm-TabBar .lm-TabBar-addButton{border-bottom:1px solid silver;padding:0 6px}.lm-TabBar-tab.lm-mod-drag-image{border:none;min-width:125px;min-height:23px;max-height:23px;box-shadow:1px 1px 2px rgba(0,0,0,.3)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ide-ps{overflow-anchor:none;-ms-overflow-style:none;touch-action:auto;-ms-touch-action:auto;overflow:hidden!important}.ide-ps__rail-x{opacity:0;height:15px;transition:background-color .2s linear,opacity .2s linear;display:none;position:absolute;bottom:0}.ide-ps__rail-y{opacity:0;width:15px;transition:background-color .2s linear,opacity .2s linear;display:none;position:absolute;right:0}.ide-ps--active-x>.ide-ps__rail-x,.ide-ps--active-y>.ide-ps__rail-y{background-color:transparent;display:block}.ide-ps:hover>.ide-ps__rail-x,.ide-ps:hover>.ide-ps__rail-y,.ide-ps--focus>.ide-ps__rail-x,.ide-ps--focus>.ide-ps__rail-y,.ide-ps--scrolling-x>.ide-ps__rail-x,.ide-ps--scrolling-y>.ide-ps__rail-y{opacity:.6}.ide-ps .ide-ps__rail-x:hover,.ide-ps .ide-ps__rail-y:hover,.ide-ps .ide-ps__rail-x:focus,.ide-ps .ide-ps__rail-y:focus,.ide-ps .ide-ps__rail-x.ide-ps--clicking,.ide-ps .ide-ps__rail-y.ide-ps--clicking{opacity:.9}.ide-ps__thumb-x{background-color:#aaa;border-radius:6px;height:6px;transition:background-color .2s linear,height .2s ease-in-out;position:absolute;bottom:2px}.ide-ps__thumb-y{background-color:#aaa;border-radius:6px;width:6px;transition:background-color .2s linear,width .2s ease-in-out;position:absolute;right:2px}.ide-ps__rail-x:hover>.ide-ps__thumb-x,.ide-ps__rail-x:focus>.ide-ps__thumb-x,.ide-ps__rail-x.ide-ps--clicking .ide-ps__thumb-x{background-color:#999;height:11px}.ide-ps__rail-y:hover>.ide-ps__thumb-y,.ide-ps__rail-y:focus>.ide-ps__thumb-y,.ide-ps__rail-y.ide-ps--clicking .ide-ps__thumb-y{background-color:#999;width:11px}.lm-Widget::-webkit-scrollbar{background:0 0;width:10px;height:10px}.lm-Widget::-webkit-scrollbar:hover{background:0 0}.lm-Widget::-webkit-scrollbar-thumb{background:0 0}.lm-Widget::-webkit-scrollbar-corner{background:0 0}.lm-cursor-backdrop{will-change:transform;z-index:100;scrollbar-width:none;-ms-overflow-style:none;width:200px;height:200px;margin-top:-100px;margin-left:-100px;position:fixed;top:0;left:0;overflow:scroll}.lm-cursor-backdrop:after{content:\"\";width:1200px;height:1200px;display:block}.lm-cursor-backdrop::-webkit-scrollbar{display:none}.lm-mod-drag-image{will-change:transform;top:0;left:0}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nexport { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _defineProperty as defineProperty, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _slicedToArray as slicedToArray, _unsupportedIterableToArray as unsupportedIterableToArray };\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction compose() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (x) {\n return fns.reduceRight(function (y, f) {\n return f(y);\n }, x);\n };\n}\n\nfunction curry(fn) {\n return function curried() {\n var _this = this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return args.length >= fn.length ? fn.apply(this, args) : function () {\n for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n nextArgs[_key3] = arguments[_key3];\n }\n\n return curried.apply(_this, [].concat(args, nextArgs));\n };\n };\n}\n\nfunction isObject(value) {\n return {}.toString.call(value).includes('Object');\n}\n\nfunction isEmpty(obj) {\n return !Object.keys(obj).length;\n}\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n\nfunction hasOwnProperty(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nfunction validateChanges(initial, changes) {\n if (!isObject(changes)) errorHandler('changeType');\n if (Object.keys(changes).some(function (field) {\n return !hasOwnProperty(initial, field);\n })) errorHandler('changeField');\n return changes;\n}\n\nfunction validateSelector(selector) {\n if (!isFunction(selector)) errorHandler('selectorType');\n}\n\nfunction validateHandler(handler) {\n if (!(isFunction(handler) || isObject(handler))) errorHandler('handlerType');\n if (isObject(handler) && Object.values(handler).some(function (_handler) {\n return !isFunction(_handler);\n })) errorHandler('handlersType');\n}\n\nfunction validateInitial(initial) {\n if (!initial) errorHandler('initialIsRequired');\n if (!isObject(initial)) errorHandler('initialType');\n if (isEmpty(initial)) errorHandler('initialContent');\n}\n\nfunction throwError(errorMessages, type) {\n throw new Error(errorMessages[type] || errorMessages[\"default\"]);\n}\n\nvar errorMessages = {\n initialIsRequired: 'initial state is required',\n initialType: 'initial state should be an object',\n initialContent: 'initial state shouldn\\'t be an empty object',\n handlerType: 'handler should be an object or a function',\n handlersType: 'all handlers should be a functions',\n selectorType: 'selector should be a function',\n changeType: 'provided value of changes should be an object',\n changeField: 'it seams you want to change a field in the state which is not specified in the \"initial\" state',\n \"default\": 'an unknown error accured in `state-local` package'\n};\nvar errorHandler = curry(throwError)(errorMessages);\nvar validators = {\n changes: validateChanges,\n selector: validateSelector,\n handler: validateHandler,\n initial: validateInitial\n};\n\nfunction create(initial) {\n var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n validators.initial(initial);\n validators.handler(handler);\n var state = {\n current: initial\n };\n var didUpdate = curry(didStateUpdate)(state, handler);\n var update = curry(updateState)(state);\n var validate = curry(validators.changes)(initial);\n var getChanges = curry(extractChanges)(state);\n\n function getState() {\n var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (state) {\n return state;\n };\n validators.selector(selector);\n return selector(state.current);\n }\n\n function setState(causedChanges) {\n compose(didUpdate, update, validate, getChanges)(causedChanges);\n }\n\n return [getState, setState];\n}\n\nfunction extractChanges(state, causedChanges) {\n return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges;\n}\n\nfunction updateState(state, changes) {\n state.current = _objectSpread2(_objectSpread2({}, state.current), changes);\n return changes;\n}\n\nfunction didStateUpdate(state, handler, changes) {\n isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function (field) {\n var _handler$field;\n\n return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]);\n });\n return changes;\n}\n\nvar index = {\n create: create\n};\n\nexport default index;\n","function curry(fn) {\n return function curried() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return args.length >= fn.length ? fn.apply(this, args) : function () {\n for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n nextArgs[_key2] = arguments[_key2];\n }\n\n return curried.apply(_this, [].concat(args, nextArgs));\n };\n };\n}\n\nexport default curry;\n","import curry from '../utils/curry.js';\nimport isObject from '../utils/isObject.js';\n\n/**\n * validates the configuration object and informs about deprecation\n * @param {Object} config - the configuration object \n * @return {Object} config - the validated configuration object\n */\n\nfunction validateConfig(config) {\n if (!config) errorHandler('configIsRequired');\n if (!isObject(config)) errorHandler('configType');\n\n if (config.urls) {\n informAboutDeprecation();\n return {\n paths: {\n vs: config.urls.monacoBase\n }\n };\n }\n\n return config;\n}\n/**\n * logs deprecation message\n */\n\n\nfunction informAboutDeprecation() {\n console.warn(errorMessages.deprecation);\n}\n\nfunction throwError(errorMessages, type) {\n throw new Error(errorMessages[type] || errorMessages[\"default\"]);\n}\n\nvar errorMessages = {\n configIsRequired: 'the configuration object is required',\n configType: 'the configuration object should be an object',\n \"default\": 'an unknown error accured in `@monaco-editor/loader` package',\n deprecation: \"Deprecation warning!\\n You are using deprecated way of configuration.\\n\\n Instead of using\\n monaco.config({ urls: { monacoBase: '...' } })\\n use\\n monaco.config({ paths: { vs: '...' } })\\n\\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\\n \"\n};\nvar errorHandler = curry(throwError)(errorMessages);\nvar validators = {\n config: validateConfig\n};\n\nexport default validators;\nexport { errorHandler, errorMessages };\n","function isObject(value) {\n return {}.toString.call(value).includes('Object');\n}\n\nexport default isObject;\n","var compose = function compose() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (x) {\n return fns.reduceRight(function (y, f) {\n return f(y);\n }, x);\n };\n};\n\nexport default compose;\n","// The source (has been changed) is https://github.com/facebook/react/issues/5465#issuecomment-157888325\nvar CANCELATION_MESSAGE = {\n type: 'cancelation',\n msg: 'operation is manually canceled'\n};\n\nfunction makeCancelable(promise) {\n var hasCanceled_ = false;\n var wrappedPromise = new Promise(function (resolve, reject) {\n promise.then(function (val) {\n return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val);\n });\n promise[\"catch\"](reject);\n });\n return wrappedPromise.cancel = function () {\n return hasCanceled_ = true;\n }, wrappedPromise;\n}\n\nexport default makeCancelable;\nexport { CANCELATION_MESSAGE };\n","import { slicedToArray as _slicedToArray, objectWithoutProperties as _objectWithoutProperties } from '../_virtual/_rollupPluginBabelHelpers.js';\nimport state from 'state-local';\nimport config$1 from '../config/index.js';\nimport validators from '../validators/index.js';\nimport compose from '../utils/compose.js';\nimport merge from '../utils/deepMerge.js';\nimport makeCancelable from '../utils/makeCancelable.js';\n\n/** the local state of the module */\n\nvar _state$create = state.create({\n config: config$1,\n isInitialized: false,\n resolve: null,\n reject: null,\n monaco: null\n}),\n _state$create2 = _slicedToArray(_state$create, 2),\n getState = _state$create2[0],\n setState = _state$create2[1];\n/**\n * set the loader configuration\n * @param {Object} config - the configuration object\n */\n\n\nfunction config(globalConfig) {\n var _validators$config = validators.config(globalConfig),\n monaco = _validators$config.monaco,\n config = _objectWithoutProperties(_validators$config, [\"monaco\"]);\n\n setState(function (state) {\n return {\n config: merge(state.config, config),\n monaco: monaco\n };\n });\n}\n/**\n * handles the initialization of the monaco-editor\n * @return {Promise} - returns an instance of monaco (with a cancelable promise)\n */\n\n\nfunction init() {\n var state = getState(function (_ref) {\n var monaco = _ref.monaco,\n isInitialized = _ref.isInitialized,\n resolve = _ref.resolve;\n return {\n monaco: monaco,\n isInitialized: isInitialized,\n resolve: resolve\n };\n });\n\n if (!state.isInitialized) {\n setState({\n isInitialized: true\n });\n\n if (state.monaco) {\n state.resolve(state.monaco);\n return makeCancelable(wrapperPromise);\n }\n\n if (window.monaco && window.monaco.editor) {\n storeMonacoInstance(window.monaco);\n state.resolve(window.monaco);\n return makeCancelable(wrapperPromise);\n }\n\n compose(injectScripts, getMonacoLoaderScript)(configureLoader);\n }\n\n return makeCancelable(wrapperPromise);\n}\n/**\n * injects provided scripts into the document.body\n * @param {Object} script - an HTML script element\n * @return {Object} - the injected HTML script element\n */\n\n\nfunction injectScripts(script) {\n return document.body.appendChild(script);\n}\n/**\n * creates an HTML script element with/without provided src\n * @param {string} [src] - the source path of the script\n * @return {Object} - the created HTML script element\n */\n\n\nfunction createScript(src) {\n var script = document.createElement('script');\n return src && (script.src = src), script;\n}\n/**\n * creates an HTML script element with the monaco loader src\n * @return {Object} - the created HTML script element\n */\n\n\nfunction getMonacoLoaderScript(configureLoader) {\n var state = getState(function (_ref2) {\n var config = _ref2.config,\n reject = _ref2.reject;\n return {\n config: config,\n reject: reject\n };\n });\n var loaderScript = createScript(\"\".concat(state.config.paths.vs, \"/loader.js\"));\n\n loaderScript.onload = function () {\n return configureLoader();\n };\n\n loaderScript.onerror = state.reject;\n return loaderScript;\n}\n/**\n * configures the monaco loader\n */\n\n\nfunction configureLoader() {\n var state = getState(function (_ref3) {\n var config = _ref3.config,\n resolve = _ref3.resolve,\n reject = _ref3.reject;\n return {\n config: config,\n resolve: resolve,\n reject: reject\n };\n });\n var require = window.require;\n\n require.config(state.config);\n\n require(['vs/editor/editor.main'], function (monaco) {\n storeMonacoInstance(monaco);\n state.resolve(monaco);\n }, function (error) {\n state.reject(error);\n });\n}\n/**\n * store monaco instance in local state\n */\n\n\nfunction storeMonacoInstance(monaco) {\n if (!getState().monaco) {\n setState({\n monaco: monaco\n });\n }\n}\n/**\n * internal helper function\n * extracts stored monaco instance\n * @return {Object|null} - the monaco instance\n */\n\n\nfunction __getMonacoInstance() {\n return getState(function (_ref4) {\n var monaco = _ref4.monaco;\n return monaco;\n });\n}\n\nvar wrapperPromise = new Promise(function (resolve, reject) {\n return setState({\n resolve: resolve,\n reject: reject\n });\n});\nvar loader = {\n config: config,\n init: init,\n __getMonacoInstance: __getMonacoInstance\n};\n\nexport default loader;\n","var config = {\n paths: {\n vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs'\n }\n};\n\nexport default config;\n","import { objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';\n\nfunction merge(target, source) {\n Object.keys(source).forEach(function (key) {\n if (source[key] instanceof Object) {\n if (target[key]) {\n Object.assign(source[key], merge(target[key], source[key]));\n }\n }\n });\n return _objectSpread2(_objectSpread2({}, target), source);\n}\n\nexport default merge;\n","import _t from\"@monaco-editor/loader\";import{memo as Te}from\"react\";import ke,{useState as re,useRef as S,useCallback as oe,useEffect as ne}from\"react\";import Se from\"@monaco-editor/loader\";import{memo as ye}from\"react\";import K from\"react\";var le={wrapper:{display:\"flex\",position:\"relative\",textAlign:\"initial\"},fullWidth:{width:\"100%\"},hide:{display:\"none\"}},v=le;import me from\"react\";var ae={container:{display:\"flex\",height:\"100%\",width:\"100%\",justifyContent:\"center\",alignItems:\"center\"}},Y=ae;function Me({children:e}){return me.createElement(\"div\",{style:Y.container},e)}var Z=Me;var $=Z;function Ee({width:e,height:r,isEditorReady:n,loading:t,_ref:a,className:m,wrapperProps:E}){return K.createElement(\"section\",{style:{...v.wrapper,width:e,height:r},...E},!n&&K.createElement($,null,t),K.createElement(\"div\",{ref:a,style:{...v.fullWidth,...!n&&v.hide},className:m}))}var ee=Ee;var H=ye(ee);import{useEffect as xe}from\"react\";function Ce(e){xe(e,[])}var k=Ce;import{useEffect as ge,useRef as Re}from\"react\";function he(e,r,n=!0){let t=Re(!0);ge(t.current||!n?()=>{t.current=!1}:e,r)}var l=he;function D(){}function h(e,r,n,t){return De(e,t)||be(e,r,n,t)}function De(e,r){return e.editor.getModel(te(e,r))}function be(e,r,n,t){return e.editor.createModel(r,n,t?te(e,t):void 0)}function te(e,r){return e.Uri.parse(r)}function Oe({original:e,modified:r,language:n,originalLanguage:t,modifiedLanguage:a,originalModelPath:m,modifiedModelPath:E,keepCurrentOriginalModel:g=!1,keepCurrentModifiedModel:N=!1,theme:x=\"light\",loading:P=\"Loading...\",options:y={},height:V=\"100%\",width:z=\"100%\",className:F,wrapperProps:j={},beforeMount:A=D,onMount:q=D}){let[M,O]=re(!1),[T,s]=re(!0),u=S(null),c=S(null),w=S(null),d=S(q),o=S(A),b=S(!1);k(()=>{let i=Se.init();return i.then(f=>(c.current=f)&&s(!1)).catch(f=>f?.type!==\"cancelation\"&&console.error(\"Monaco initialization: error:\",f)),()=>u.current?I():i.cancel()}),l(()=>{if(u.current&&c.current){let i=u.current.getOriginalEditor(),f=h(c.current,e||\"\",t||n||\"text\",m||\"\");f!==i.getModel()&&i.setModel(f)}},[m],M),l(()=>{if(u.current&&c.current){let i=u.current.getModifiedEditor(),f=h(c.current,r||\"\",a||n||\"text\",E||\"\");f!==i.getModel()&&i.setModel(f)}},[E],M),l(()=>{let i=u.current.getModifiedEditor();i.getOption(c.current.editor.EditorOption.readOnly)?i.setValue(r||\"\"):r!==i.getValue()&&(i.executeEdits(\"\",[{range:i.getModel().getFullModelRange(),text:r||\"\",forceMoveMarkers:!0}]),i.pushUndoStop())},[r],M),l(()=>{u.current?.getModel()?.original.setValue(e||\"\")},[e],M),l(()=>{let{original:i,modified:f}=u.current.getModel();c.current.editor.setModelLanguage(i,t||n||\"text\"),c.current.editor.setModelLanguage(f,a||n||\"text\")},[n,t,a],M),l(()=>{c.current?.editor.setTheme(x)},[x],M),l(()=>{u.current?.updateOptions(y)},[y],M);let L=oe(()=>{if(!c.current)return;o.current(c.current);let i=h(c.current,e||\"\",t||n||\"text\",m||\"\"),f=h(c.current,r||\"\",a||n||\"text\",E||\"\");u.current?.setModel({original:i,modified:f})},[n,r,a,e,t,m,E]),U=oe(()=>{!b.current&&w.current&&(u.current=c.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...y}),L(),c.current?.editor.setTheme(x),O(!0),b.current=!0)},[y,x,L]);ne(()=>{M&&d.current(u.current,c.current)},[M]),ne(()=>{!T&&!M&&U()},[T,M,U]);function I(){let i=u.current?.getModel();g||i?.original?.dispose(),N||i?.modified?.dispose(),u.current?.dispose()}return ke.createElement(H,{width:z,height:V,isEditorReady:M,loading:P,_ref:w,className:F,wrapperProps:j})}var ie=Oe;var we=Te(ie);import{useState as Ie}from\"react\";import ce from\"@monaco-editor/loader\";function Pe(){let[e,r]=Ie(ce.__getMonacoInstance());return k(()=>{let n;return e||(n=ce.init(),n.then(t=>{r(t)})),()=>n?.cancel()}),e}var Le=Pe;import{memo as ze}from\"react\";import We,{useState as ue,useEffect as W,useRef as C,useCallback as _e}from\"react\";import Ne from\"@monaco-editor/loader\";import{useEffect as Ue,useRef as ve}from\"react\";function He(e){let r=ve();return Ue(()=>{r.current=e},[e]),r.current}var se=He;var _=new Map;function Ve({defaultValue:e,defaultLanguage:r,defaultPath:n,value:t,language:a,path:m,theme:E=\"light\",line:g,loading:N=\"Loading...\",options:x={},overrideServices:P={},saveViewState:y=!0,keepCurrentModel:V=!1,width:z=\"100%\",height:F=\"100%\",className:j,wrapperProps:A={},beforeMount:q=D,onMount:M=D,onChange:O,onValidate:T=D}){let[s,u]=ue(!1),[c,w]=ue(!0),d=C(null),o=C(null),b=C(null),L=C(M),U=C(q),I=C(),i=C(t),f=se(m),Q=C(!1),B=C(!1);k(()=>{let p=Ne.init();return p.then(R=>(d.current=R)&&w(!1)).catch(R=>R?.type!==\"cancelation\"&&console.error(\"Monaco initialization: error:\",R)),()=>o.current?pe():p.cancel()}),l(()=>{let p=h(d.current,e||t||\"\",r||a||\"\",m||n||\"\");p!==o.current?.getModel()&&(y&&_.set(f,o.current?.saveViewState()),o.current?.setModel(p),y&&o.current?.restoreViewState(_.get(m)))},[m],s),l(()=>{o.current?.updateOptions(x)},[x],s),l(()=>{!o.current||t===void 0||(o.current.getOption(d.current.editor.EditorOption.readOnly)?o.current.setValue(t):t!==o.current.getValue()&&(B.current=!0,o.current.executeEdits(\"\",[{range:o.current.getModel().getFullModelRange(),text:t,forceMoveMarkers:!0}]),o.current.pushUndoStop(),B.current=!1))},[t],s),l(()=>{let p=o.current?.getModel();p&&a&&d.current?.editor.setModelLanguage(p,a)},[a],s),l(()=>{g!==void 0&&o.current?.revealLine(g)},[g],s),l(()=>{d.current?.editor.setTheme(E)},[E],s);let X=_e(()=>{if(!(!b.current||!d.current)&&!Q.current){U.current(d.current);let p=m||n,R=h(d.current,t||e||\"\",r||a||\"\",p||\"\");o.current=d.current?.editor.create(b.current,{model:R,automaticLayout:!0,...x},P),y&&o.current.restoreViewState(_.get(p)),d.current.editor.setTheme(E),g!==void 0&&o.current.revealLine(g),u(!0),Q.current=!0}},[e,r,n,t,a,m,x,P,y,E,g]);W(()=>{s&&L.current(o.current,d.current)},[s]),W(()=>{!c&&!s&&X()},[c,s,X]),i.current=t,W(()=>{s&&O&&(I.current?.dispose(),I.current=o.current?.onDidChangeModelContent(p=>{B.current||O(o.current.getValue(),p)}))},[s,O]),W(()=>{if(s){let p=d.current.editor.onDidChangeMarkers(R=>{let G=o.current.getModel()?.uri;if(G&&R.find(J=>J.path===G.path)){let J=d.current.editor.getModelMarkers({resource:G});T?.(J)}});return()=>{p?.dispose()}}return()=>{}},[s,T]);function pe(){I.current?.dispose(),V?y&&_.set(m,o.current.saveViewState()):o.current.getModel()?.dispose(),o.current.dispose()}return We.createElement(H,{width:z,height:F,isEditorReady:s,loading:N,_ref:b,className:j,wrapperProps:A})}var fe=Ve;var de=ze(fe);var Ft=de;export{we as DiffEditor,de as Editor,Ft as default,_t as loader,Le as useMonaco};\n//# sourceMappingURL=index.mjs.map","import {asciiAlphanumeric} from 'micromark-util-character'\nimport {encode} from 'micromark-util-encode'\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri`).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * A regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or\n * `/^https?$/i` for `img[src]` (this is what `github.com` allows).\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string | undefined} url\n * URI to sanitize.\n * @param {RegExp | null | undefined} [protocol]\n * Allowed protocols.\n * @returns {string}\n * Sanitized URI.\n */\nexport function sanitizeUri(url, protocol) {\n const value = encode(normalizeUri(url || ''))\n if (!protocol) {\n return value\n }\n const colon = value.indexOf(':')\n const questionMark = value.indexOf('?')\n const numberSign = value.indexOf('#')\n const slash = value.indexOf('/')\n if (\n // If there is no protocol, it’s relative.\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash > -1 && colon > slash) ||\n (questionMark > -1 && colon > questionMark) ||\n (numberSign > -1 && colon > numberSign) ||\n // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))\n ) {\n return value\n }\n return ''\n}\n\n/**\n * Normalize a URL.\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * URI to normalize.\n * @returns {string}\n * Normalized URI.\n */\nexport function normalizeUri(value) {\n /** @type {Array} */\n const result = []\n let index = -1\n let start = 0\n let skip = 0\n while (++index < value.length) {\n const code = value.charCodeAt(index)\n /** @type {string} */\n let replace = ''\n\n // A correct percent encoded value.\n if (\n code === 37 &&\n asciiAlphanumeric(value.charCodeAt(index + 1)) &&\n asciiAlphanumeric(value.charCodeAt(index + 2))\n ) {\n skip = 2\n }\n // ASCII.\n else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code)\n }\n }\n // Astral.\n else if (code > 55295 && code < 57344) {\n const next = value.charCodeAt(index + 1)\n\n // A correct surrogate pair.\n if (code < 56320 && next > 56319 && next < 57344) {\n replace = String.fromCharCode(code, next)\n skip = 1\n }\n // Lone surrogate.\n else {\n replace = '\\uFFFD'\n }\n }\n // Unicode.\n else {\n replace = String.fromCharCode(code)\n }\n if (replace) {\n result.push(value.slice(start, index), encodeURIComponent(replace))\n start = index + skip + 1\n replace = ''\n }\n if (skip) {\n index += skip\n skip = 0\n }\n }\n return result.join('') + value.slice(start)\n}\n","/**\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n */\n\n/**\n * Get the starting point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointStart = point('start')\n\n/**\n * Get the ending point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointEnd = point('end')\n\n/**\n * Get the positional info of `node`.\n *\n * @param {NodeLike | Node | null | undefined} [node]\n * Node.\n * @returns {Position}\n * Position.\n */\nexport function position(node) {\n return {start: pointStart(node), end: pointEnd(node)}\n}\n\n/**\n * Get the positional info of `node`.\n *\n * @param {'start' | 'end'} type\n * Side.\n * @returns\n * Getter.\n */\nfunction point(type) {\n return point\n\n /**\n * Get the point info of `node` at a bound side.\n *\n * @param {NodeLike | Node | null | undefined} [node]\n * @returns {Point}\n */\n function point(node) {\n const point = (node && node.position && node.position[type]) || {}\n\n // To do: next major: don’t return points when invalid.\n return {\n // @ts-expect-error: in practice, null is allowed.\n line: point.line || null,\n // @ts-expect-error: in practice, null is allowed.\n column: point.column || null,\n // @ts-expect-error: in practice, null is allowed.\n offset: point.offset > -1 ? point.offset : null\n }\n }\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Definition} Definition\n */\n\n/**\n * @typedef {Root | Content} Node\n *\n * @callback GetDefinition\n * Get a definition by identifier.\n * @param {string | null | undefined} [identifier]\n * Identifier of definition.\n * @returns {Definition | null}\n * Definition corresponding to `identifier` or `null`.\n */\n\nimport {visit} from 'unist-util-visit'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Find definitions in `tree`.\n *\n * Uses CommonMark precedence, which means that earlier definitions are\n * preferred over duplicate later definitions.\n *\n * @param {Node} tree\n * Tree to check.\n * @returns {GetDefinition}\n * Getter.\n */\nexport function definitions(tree) {\n /** @type {Record} */\n const cache = Object.create(null)\n\n if (!tree || !tree.type) {\n throw new Error('mdast-util-definitions expected node')\n }\n\n visit(tree, 'definition', (definition) => {\n const id = clean(definition.identifier)\n if (id && !own.call(cache, id)) {\n cache[id] = definition\n }\n })\n\n return definition\n\n /** @type {GetDefinition} */\n function definition(identifier) {\n const id = clean(identifier)\n // To do: next major: return `undefined` when not found.\n return id && own.call(cache, id) ? cache[id] : null\n }\n}\n\n/**\n * @param {string | null | undefined} [value]\n * @returns {string}\n */\nfunction clean(value) {\n return String(value || '').toUpperCase()\n}\n","/**\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('hast').Element} Element\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `footnoteReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {FootnoteReference} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function footnoteReference(state, node) {\n const id = String(node.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n const index = state.footnoteOrder.indexOf(id)\n /** @type {number} */\n let counter\n\n if (index === -1) {\n state.footnoteOrder.push(id)\n state.footnoteCounts[id] = 1\n counter = state.footnoteOrder.length\n } else {\n state.footnoteCounts[id]++\n counter = index + 1\n }\n\n const reuseCounter = state.footnoteCounts[id]\n\n /** @type {Element} */\n const link = {\n type: 'element',\n tagName: 'a',\n properties: {\n href: '#' + state.clobberPrefix + 'fn-' + safeId,\n id:\n state.clobberPrefix +\n 'fnref-' +\n safeId +\n (reuseCounter > 1 ? '-' + reuseCounter : ''),\n dataFootnoteRef: true,\n ariaDescribedBy: ['footnote-label']\n },\n children: [{type: 'text', value: String(counter)}]\n }\n state.patch(node, link)\n\n /** @type {Element} */\n const sup = {\n type: 'element',\n tagName: 'sup',\n properties: {},\n children: [link]\n }\n state.patch(node, sup)\n return state.applyData(node, sup)\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Reference} Reference\n * @typedef {import('mdast').Root} Root\n *\n * @typedef {import('./state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} References\n */\n\n// To do: next major: always return array.\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @param {State} state\n * Info passed around.\n * @param {References} node\n * Reference node (image, link).\n * @returns {ElementContent | Array}\n * hast content.\n */\nexport function revert(state, node) {\n const subtype = node.referenceType\n let suffix = ']'\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return {type: 'text', value: '![' + node.alt + suffix}\n }\n\n const contents = state.all(node)\n const head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift({type: 'text', value: '['})\n }\n\n const tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push({type: 'text', value: suffix})\n }\n\n return contents\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} Parents\n */\n\n/**\n * Turn an mdast `listItem` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ListItem} node\n * mdast node.\n * @param {Parents | null | undefined} parent\n * Parent of `node`.\n * @returns {Element}\n * hast node.\n */\nexport function listItem(state, node, parent) {\n const results = state.all(node)\n const loose = parent ? listLoose(parent) : listItemLoose(node)\n /** @type {Properties} */\n const properties = {}\n /** @type {Array} */\n const children = []\n\n if (typeof node.checked === 'boolean') {\n const head = results[0]\n /** @type {Element} */\n let paragraph\n\n if (head && head.type === 'element' && head.tagName === 'p') {\n paragraph = head\n } else {\n paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}\n results.unshift(paragraph)\n }\n\n if (paragraph.children.length > 0) {\n paragraph.children.unshift({type: 'text', value: ' '})\n }\n\n paragraph.children.unshift({\n type: 'element',\n tagName: 'input',\n properties: {type: 'checkbox', checked: node.checked, disabled: true},\n children: []\n })\n\n // According to github-markdown-css, this class hides bullet.\n // See: .\n properties.className = ['task-list-item']\n }\n\n let index = -1\n\n while (++index < results.length) {\n const child = results[index]\n\n // Add eols before nodes, except if this is a loose, first paragraph.\n if (\n loose ||\n index !== 0 ||\n child.type !== 'element' ||\n child.tagName !== 'p'\n ) {\n children.push({type: 'text', value: '\\n'})\n }\n\n if (child.type === 'element' && child.tagName === 'p' && !loose) {\n children.push(...child.children)\n } else {\n children.push(child)\n }\n }\n\n const tail = results[results.length - 1]\n\n // Add a final eol.\n if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {\n children.push({type: 'text', value: '\\n'})\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'li', properties, children}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * @param {Parents} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n let loose = false\n if (node.type === 'list') {\n loose = node.spread || false\n const children = node.children\n let index = -1\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index])\n }\n }\n\n return loose\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n const spread = node.spread\n\n return spread === undefined || spread === null\n ? node.children.length > 1\n : spread\n}\n","const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Trimmed value.\n */\nexport function trimLines(value) {\n const source = String(value)\n const search = /\\r?\\n|\\r/g\n let match = search.exec(source)\n let last = 0\n /** @type {Array} */\n const lines = []\n\n while (match) {\n lines.push(\n trimLine(source.slice(last, match.index), last > 0, true),\n match[0]\n )\n\n last = match.index + match[0].length\n match = search.exec(source)\n }\n\n lines.push(trimLine(source.slice(last), last > 0, false))\n\n return lines.join('')\n}\n\n/**\n * @param {string} value\n * Line to trim.\n * @param {boolean} start\n * Whether to trim the start of the line.\n * @param {boolean} end\n * Whether to trim the end of the line.\n * @returns {string}\n * Trimmed line.\n */\nfunction trimLine(value, start, end) {\n let startIndex = 0\n let endIndex = value.length\n\n if (start) {\n let code = value.codePointAt(startIndex)\n\n while (code === tab || code === space) {\n startIndex++\n code = value.codePointAt(startIndex)\n }\n }\n\n if (end) {\n let code = value.codePointAt(endIndex - 1)\n\n while (code === tab || code === space) {\n endIndex--\n code = value.codePointAt(endIndex - 1)\n }\n }\n\n return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n","import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {footnote} from './footnote.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {tableRow} from './table-row.js'\nimport {tableCell} from './table-cell.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default handlers for nodes.\n */\nexport const handlers = {\n blockquote,\n break: hardBreak,\n code,\n delete: strikethrough,\n emphasis,\n footnoteReference,\n footnote,\n heading,\n html,\n imageReference,\n image,\n inlineCode,\n linkReference,\n link,\n listItem,\n list,\n paragraph,\n root,\n strong,\n table,\n tableCell,\n tableRow,\n text,\n thematicBreak,\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n // To do: next major: return `undefined`.\n return null\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `blockquote` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Blockquote} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function blockquote(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'blockquote',\n properties: {},\n children: state.wrap(state.all(node), true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').Break} Break\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `break` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Break} node\n * mdast node.\n * @returns {Array}\n * hast element content.\n */\nexport function hardBreak(state, node) {\n /** @type {Element} */\n const result = {type: 'element', tagName: 'br', properties: {}, children: []}\n state.patch(node, result)\n return [state.applyData(node, result), {type: 'text', value: '\\n'}]\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Code} Code\n * @typedef {import('../state.js').State} State\n\n */\n\n/**\n * Turn an mdast `code` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Code} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function code(state, node) {\n const value = node.value ? node.value + '\\n' : ''\n // To do: next major, use `node.lang` w/o regex, the splitting’s been going\n // on for years in remark now.\n const lang = node.lang ? node.lang.match(/^[^ \\t]+(?=[ \\t]|$)/) : null\n /** @type {Properties} */\n const properties = {}\n\n if (lang) {\n properties.className = ['language-' + lang]\n }\n\n // Create ``.\n /** @type {Element} */\n let result = {\n type: 'element',\n tagName: 'code',\n properties,\n children: [{type: 'text', value}]\n }\n\n if (node.meta) {\n result.data = {meta: node.meta}\n }\n\n state.patch(node, result)\n result = state.applyData(node, result)\n\n // Create `
`.\n  result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}\n  state.patch(node, result)\n  return result\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Delete} Delete\n * @typedef {import('../state.js').State} State\n\n */\n\n/**\n * Turn an mdast `delete` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Delete} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strikethrough(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'del',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `emphasis` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Emphasis} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function emphasis(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'em',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Footnote} Footnote\n * @typedef {import('../state.js').State} State\n */\n\nimport {footnoteReference} from './footnote-reference.js'\n\n// To do: when both:\n// * \n// * \n// …are archived, remove this (also from mdast).\n// These inline notes are not used in GFM.\n\n/**\n * Turn an mdast `footnote` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Footnote} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function footnote(state, node) {\n  const footnoteById = state.footnoteById\n  let no = 1\n\n  while (no in footnoteById) no++\n\n  const identifier = String(no)\n\n  footnoteById[identifier] = {\n    type: 'footnoteDefinition',\n    identifier,\n    children: [{type: 'paragraph', children: node.children}],\n    position: node.position\n  }\n\n  return footnoteReference(state, {\n    type: 'footnoteReference',\n    identifier,\n    position: node.position\n  })\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `heading` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Heading} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function heading(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'h' + node.depth,\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').HTML} Html\n * @typedef {import('../state.js').State} State\n * @typedef {import('../../index.js').Raw} Raw\n */\n\n/**\n * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise\n * nothing).\n *\n * @param {State} state\n *   Info passed around.\n * @param {Html} node\n *   mdast node.\n * @returns {Raw | Element | null}\n *   hast node.\n */\nexport function html(state, node) {\n  if (state.dangerous) {\n    /** @type {Raw} */\n    const result = {type: 'raw', value: node.value}\n    state.patch(node, result)\n    return state.applyData(node, result)\n  }\n\n  // To do: next major: return `undefined`.\n  return null\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `imageReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ImageReference} node\n *   mdast node.\n * @returns {ElementContent | Array}\n *   hast node.\n */\nexport function imageReference(state, node) {\n  const def = state.definition(node.identifier)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(def.url || ''), alt: node.alt}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Image} Image\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `image` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Image} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function image(state, node) {\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(node.url)}\n\n  if (node.alt !== null && node.alt !== undefined) {\n    properties.alt = node.alt\n  }\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `inlineCode` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {InlineCode} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function inlineCode(state, node) {\n  /** @type {Text} */\n  const text = {type: 'text', value: node.value.replace(/\\r?\\n|\\r/g, ' ')}\n  state.patch(node, text)\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'code',\n    properties: {},\n    children: [text]\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `linkReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {LinkReference} node\n *   mdast node.\n * @returns {ElementContent | Array}\n *   hast node.\n */\nexport function linkReference(state, node) {\n  const def = state.definition(node.identifier)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(def.url || '')}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Link} Link\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `link` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Link} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function link(state, node) {\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(node.url)}\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').List} List\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `list` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {List} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function list(state, node) {\n  /** @type {Properties} */\n  const properties = {}\n  const results = state.all(node)\n  let index = -1\n\n  if (typeof node.start === 'number' && node.start !== 1) {\n    properties.start = node.start\n  }\n\n  // Like GitHub, add a class for custom styling.\n  while (++index < results.length) {\n    const child = results[index]\n\n    if (\n      child.type === 'element' &&\n      child.tagName === 'li' &&\n      child.properties &&\n      Array.isArray(child.properties.className) &&\n      child.properties.className.includes('task-list-item')\n    ) {\n      properties.className = ['contains-task-list']\n      break\n    }\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: node.ordered ? 'ol' : 'ul',\n    properties,\n    children: state.wrap(results, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `paragraph` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Paragraph} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function paragraph(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'p',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `root` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastRoot} node\n *   mdast node.\n * @returns {HastRoot | HastElement}\n *   hast node.\n */\nexport function root(state, node) {\n  /** @type {HastRoot} */\n  const result = {type: 'root', children: state.wrap(state.all(node))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `strong` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Strong} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strong(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'strong',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Table} Table\n * @typedef {import('../state.js').State} State\n */\n\nimport {pointStart, pointEnd} from 'unist-util-position'\n\n/**\n * Turn an mdast `table` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Table} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function table(state, node) {\n  const rows = state.all(node)\n  const firstRow = rows.shift()\n  /** @type {Array} */\n  const tableContent = []\n\n  if (firstRow) {\n    /** @type {Element} */\n    const head = {\n      type: 'element',\n      tagName: 'thead',\n      properties: {},\n      children: state.wrap([firstRow], true)\n    }\n    state.patch(node.children[0], head)\n    tableContent.push(head)\n  }\n\n  if (rows.length > 0) {\n    /** @type {Element} */\n    const body = {\n      type: 'element',\n      tagName: 'tbody',\n      properties: {},\n      children: state.wrap(rows, true)\n    }\n\n    const start = pointStart(node.children[1])\n    const end = pointEnd(node.children[node.children.length - 1])\n    if (start.line && end.line) body.position = {start, end}\n    tableContent.push(body)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'table',\n    properties: {},\n    children: state.wrap(tableContent, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `tableCell` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableCell} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function tableCell(state, node) {\n  // Note: this function is normally not called: see `table-row` for how rows\n  // and their cells are compiled.\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'td', // Assume body cell.\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').TableRow} TableRow\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} Parents\n */\n\n/**\n * Turn an mdast `tableRow` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableRow} node\n *   mdast node.\n * @param {Parents | null | undefined} parent\n *   Parent of `node`.\n * @returns {Element}\n *   hast node.\n */\nexport function tableRow(state, node, parent) {\n  const siblings = parent ? parent.children : undefined\n  // Generate a body row when without parent.\n  const rowIndex = siblings ? siblings.indexOf(node) : 1\n  const tagName = rowIndex === 0 ? 'th' : 'td'\n  const align = parent && parent.type === 'table' ? parent.align : undefined\n  const length = align ? align.length : node.children.length\n  let cellIndex = -1\n  /** @type {Array} */\n  const cells = []\n\n  while (++cellIndex < length) {\n    // Note: can also be undefined.\n    const cell = node.children[cellIndex]\n    /** @type {Properties} */\n    const properties = {}\n    const alignValue = align ? align[cellIndex] : undefined\n\n    if (alignValue) {\n      properties.align = alignValue\n    }\n\n    /** @type {Element} */\n    let result = {type: 'element', tagName, properties, children: []}\n\n    if (cell) {\n      result.children = state.all(cell)\n      state.patch(cell, result)\n      result = state.applyData(node, result)\n    }\n\n    cells.push(result)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'tr',\n    properties: {},\n    children: state.wrap(cells, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').Text} HastText\n * @typedef {import('mdast').Text} MdastText\n * @typedef {import('../state.js').State} State\n */\n\nimport {trimLines} from 'trim-lines'\n\n/**\n * Turn an mdast `text` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastText} node\n *   mdast node.\n * @returns {HastText | HastElement}\n *   hast node.\n */\nexport function text(state, node) {\n  /** @type {HastText} */\n  const result = {type: 'text', value: trimLines(String(node.value))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `thematicBreak` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ThematicBreak} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function thematicBreak(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'hr',\n    properties: {},\n    children: []\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Content} HastContent\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').ElementContent} HastElementContent\n * @typedef {import('hast').Properties} HastProperties\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('hast').Text} HastText\n *\n * @typedef {import('mdast').Content} MdastContent\n * @typedef {import('mdast').Definition} MdastDefinition\n * @typedef {import('mdast').FootnoteDefinition} MdastFootnoteDefinition\n * @typedef {import('mdast').Parent} MdastParent\n * @typedef {import('mdast').Root} MdastRoot\n */\n\n/**\n * @typedef {HastRoot | HastContent} HastNodes\n * @typedef {MdastRoot | MdastContent} MdastNodes\n * @typedef {Extract} MdastParents\n *\n * @typedef EmbeddedHastFields\n *   hast fields.\n * @property {string | null | undefined} [hName]\n *   Generate a specific element with this tag name instead.\n * @property {HastProperties | null | undefined} [hProperties]\n *   Generate an element with these properties instead.\n * @property {Array | null | undefined} [hChildren]\n *   Generate an element with this content instead.\n *\n * @typedef {Record & EmbeddedHastFields} MdastData\n *   mdast data with embedded hast fields.\n *\n * @typedef {MdastNodes & {data?: MdastData | null | undefined}} MdastNodeWithData\n *   mdast node with embedded hast data.\n *\n * @typedef PointLike\n *   Point-like value.\n * @property {number | null | undefined} [line]\n *   Line.\n * @property {number | null | undefined} [column]\n *   Column.\n * @property {number | null | undefined} [offset]\n *   Offset.\n *\n * @typedef PositionLike\n *   Position-like value.\n * @property {PointLike | null | undefined} [start]\n *   Point-like value.\n * @property {PointLike | null | undefined} [end]\n *   Point-like value.\n *\n * @callback Handler\n *   Handle a node.\n * @param {State} state\n *   Info passed around.\n * @param {any} node\n *   mdast node to handle.\n * @param {MdastParents | null | undefined} parent\n *   Parent of `node`.\n * @returns {HastElementContent | Array | null | undefined}\n *   hast node.\n *\n * @callback HFunctionProps\n *   Signature of `state` for when props are passed.\n * @param {MdastNodes | PositionLike | null | undefined} node\n *   mdast node or unist position.\n * @param {string} tagName\n *   HTML tag name.\n * @param {HastProperties} props\n *   Properties.\n * @param {Array | null | undefined} [children]\n *   hast content.\n * @returns {HastElement}\n *   Compiled element.\n *\n * @callback HFunctionNoProps\n *   Signature of `state` for when no props are passed.\n * @param {MdastNodes | PositionLike | null | undefined} node\n *   mdast node or unist position.\n * @param {string} tagName\n *   HTML tag name.\n * @param {Array | null | undefined} [children]\n *   hast content.\n * @returns {HastElement}\n *   Compiled element.\n *\n * @typedef HFields\n *   Info on `state`.\n * @property {boolean} dangerous\n *   Whether HTML is allowed.\n * @property {string} clobberPrefix\n *   Prefix to use to prevent DOM clobbering.\n * @property {string} footnoteLabel\n *   Label to use to introduce the footnote section.\n * @property {string} footnoteLabelTagName\n *   HTML used for the footnote label.\n * @property {HastProperties} footnoteLabelProperties\n *   Properties on the HTML tag used for the footnote label.\n * @property {string} footnoteBackLabel\n *   Label to use from backreferences back to their footnote call.\n * @property {(identifier: string) => MdastDefinition | null} definition\n *   Definition cache.\n * @property {Record} footnoteById\n *   Footnote definitions by their identifier.\n * @property {Array} footnoteOrder\n *   Identifiers of order when footnote calls first appear in tree order.\n * @property {Record} footnoteCounts\n *   Counts for how often the same footnote was called.\n * @property {Handlers} handlers\n *   Applied handlers.\n * @property {Handler} unknownHandler\n *   Handler for any none not in `passThrough` or otherwise handled.\n * @property {(from: MdastNodes, node: HastNodes) => void} patch\n *   Copy a node’s positional info.\n * @property {(from: MdastNodes, to: Type) => Type | HastElement} applyData\n *   Honor the `data` of `from`, and generate an element instead of `node`.\n * @property {(node: MdastNodes, parent: MdastParents | null | undefined) => HastElementContent | Array | null | undefined} one\n *   Transform an mdast node to hast.\n * @property {(node: MdastNodes) => Array} all\n *   Transform the children of an mdast parent to hast.\n * @property {(nodes: Array, loose?: boolean | null | undefined) => Array} wrap\n *   Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.\n * @property {(left: MdastNodeWithData | PositionLike | null | undefined, right: HastElementContent) => HastElementContent} augment\n *   Like `state` but lower-level and usable on non-elements.\n *   Deprecated: use `patch` and `applyData`.\n * @property {Array} passThrough\n *   List of node types to pass through untouched (except for their children).\n *\n * @typedef Options\n *   Configuration (optional).\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n *   Whether to persist raw HTML in markdown in the hast tree.\n * @property {string | null | undefined} [clobberPrefix='user-content-']\n *   Prefix to use before the `id` attribute on footnotes to prevent it from\n *   *clobbering*.\n * @property {string | null | undefined} [footnoteBackLabel='Back to content']\n *   Label to use from backreferences back to their footnote call (affects\n *   screen readers).\n * @property {string | null | undefined} [footnoteLabel='Footnotes']\n *   Label to use for the footnotes section (affects screen readers).\n * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]\n *   Properties to use on the footnote label (note that `id: 'footnote-label'`\n *   is always added as footnote calls use it with `aria-describedby` to\n *   provide an accessible label).\n * @property {string | null | undefined} [footnoteLabelTagName='h2']\n *   Tag name to use for the footnote label.\n * @property {Handlers | null | undefined} [handlers]\n *   Extra handlers for nodes.\n * @property {Array | null | undefined} [passThrough]\n *   List of custom mdast node types to pass through (keep) in hast (note that\n *   the node itself is passed, but eventual children are transformed).\n * @property {Handler | null | undefined} [unknownHandler]\n *   Handler for all unknown nodes.\n *\n * @typedef {Record} Handlers\n *   Handle nodes.\n *\n * @typedef {HFunctionProps & HFunctionNoProps & HFields} State\n *   Info passed around.\n */\n\nimport {visit} from 'unist-util-visit'\nimport {position, pointStart, pointEnd} from 'unist-util-position'\nimport {generated} from 'unist-util-generated'\nimport {definitions} from 'mdast-util-definitions'\nimport {handlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Create `state` from an mdast tree.\n *\n * @param {MdastNodes} tree\n *   mdast node to transform.\n * @param {Options | null | undefined} [options]\n *   Configuration.\n * @returns {State}\n *   `state` function.\n */\nexport function createState(tree, options) {\n  const settings = options || {}\n  const dangerous = settings.allowDangerousHtml || false\n  /** @type {Record} */\n  const footnoteById = {}\n\n  // To do: next major: add `options` to state, remove:\n  // `dangerous`, `clobberPrefix`, `footnoteLabel`, `footnoteLabelTagName`,\n  // `footnoteLabelProperties`, `footnoteBackLabel`, `passThrough`,\n  // `unknownHandler`.\n\n  // To do: next major: move to `state.options.allowDangerousHtml`.\n  state.dangerous = dangerous\n  // To do: next major: move to `state.options`.\n  state.clobberPrefix =\n    settings.clobberPrefix === undefined || settings.clobberPrefix === null\n      ? 'user-content-'\n      : settings.clobberPrefix\n  // To do: next major: move to `state.options`.\n  state.footnoteLabel = settings.footnoteLabel || 'Footnotes'\n  // To do: next major: move to `state.options`.\n  state.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2'\n  // To do: next major: move to `state.options`.\n  state.footnoteLabelProperties = settings.footnoteLabelProperties || {\n    className: ['sr-only']\n  }\n  // To do: next major: move to `state.options`.\n  state.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'\n  // To do: next major: move to `state.options`.\n  state.unknownHandler = settings.unknownHandler\n  // To do: next major: move to `state.options`.\n  state.passThrough = settings.passThrough\n\n  state.handlers = {...handlers, ...settings.handlers}\n\n  // To do: next major: replace utility with `definitionById` object, so we\n  // only walk once (as we need footnotes too).\n  state.definition = definitions(tree)\n  state.footnoteById = footnoteById\n  /** @type {Array} */\n  state.footnoteOrder = []\n  /** @type {Record} */\n  state.footnoteCounts = {}\n\n  state.patch = patch\n  state.applyData = applyData\n  state.one = oneBound\n  state.all = allBound\n  state.wrap = wrap\n  // To do: next major: remove `augment`.\n  state.augment = augment\n\n  visit(tree, 'footnoteDefinition', (definition) => {\n    const id = String(definition.identifier).toUpperCase()\n\n    // Mimick CM behavior of link definitions.\n    // See: .\n    if (!own.call(footnoteById, id)) {\n      footnoteById[id] = definition\n    }\n  })\n\n  // @ts-expect-error Hush, it’s fine!\n  return state\n\n  /**\n   * Finalise the created `right`, a hast node, from `left`, an mdast node.\n   *\n   * @param {MdastNodeWithData | PositionLike | null | undefined} left\n   * @param {HastElementContent} right\n   * @returns {HastElementContent}\n   */\n  /* c8 ignore start */\n  // To do: next major: remove.\n  function augment(left, right) {\n    // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n    if (left && 'data' in left && left.data) {\n      /** @type {MdastData} */\n      const data = left.data\n\n      if (data.hName) {\n        if (right.type !== 'element') {\n          right = {\n            type: 'element',\n            tagName: '',\n            properties: {},\n            children: []\n          }\n        }\n\n        right.tagName = data.hName\n      }\n\n      if (right.type === 'element' && data.hProperties) {\n        right.properties = {...right.properties, ...data.hProperties}\n      }\n\n      if ('children' in right && right.children && data.hChildren) {\n        right.children = data.hChildren\n      }\n    }\n\n    if (left) {\n      const ctx = 'type' in left ? left : {position: left}\n\n      if (!generated(ctx)) {\n        // @ts-expect-error: fine.\n        right.position = {start: pointStart(ctx), end: pointEnd(ctx)}\n      }\n    }\n\n    return right\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Create an element for `node`.\n   *\n   * @type {HFunctionProps}\n   */\n  /* c8 ignore start */\n  // To do: next major: remove.\n  function state(node, tagName, props, children) {\n    if (Array.isArray(props)) {\n      children = props\n      props = {}\n    }\n\n    // @ts-expect-error augmenting an element yields an element.\n    return augment(node, {\n      type: 'element',\n      tagName,\n      properties: props || {},\n      children: children || []\n    })\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Transform an mdast node into a hast node.\n   *\n   * @param {MdastNodes} node\n   *   mdast node.\n   * @param {MdastParents | null | undefined} [parent]\n   *   Parent of `node`.\n   * @returns {HastElementContent | Array | null | undefined}\n   *   Resulting hast node.\n   */\n  function oneBound(node, parent) {\n    // @ts-expect-error: that’s a state :)\n    return one(state, node, parent)\n  }\n\n  /**\n   * Transform the children of an mdast node into hast nodes.\n   *\n   * @param {MdastNodes} parent\n   *   mdast node to compile\n   * @returns {Array}\n   *   Resulting hast nodes.\n   */\n  function allBound(parent) {\n    // @ts-expect-error: that’s a state :)\n    return all(state, parent)\n  }\n}\n\n/**\n * Copy a node’s positional info.\n *\n * @param {MdastNodes} from\n *   mdast node to copy from.\n * @param {HastNodes} to\n *   hast node to copy into.\n * @returns {void}\n *   Nothing.\n */\nfunction patch(from, to) {\n  if (from.position) to.position = position(from)\n}\n\n/**\n * Honor the `data` of `from` and maybe generate an element instead of `to`.\n *\n * @template {HastNodes} Type\n *   Node type.\n * @param {MdastNodes} from\n *   mdast node to use data from.\n * @param {Type} to\n *   hast node to change.\n * @returns {Type | HastElement}\n *   Nothing.\n */\nfunction applyData(from, to) {\n  /** @type {Type | HastElement} */\n  let result = to\n\n  // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n  if (from && from.data) {\n    const hName = from.data.hName\n    const hChildren = from.data.hChildren\n    const hProperties = from.data.hProperties\n\n    if (typeof hName === 'string') {\n      // Transforming the node resulted in an element with a different name\n      // than wanted:\n      if (result.type === 'element') {\n        result.tagName = hName\n      }\n      // Transforming the node resulted in a non-element, which happens for\n      // raw, text, and root nodes (unless custom handlers are passed).\n      // The intent is likely to keep the content around (otherwise: pass\n      // `hChildren`).\n      else {\n        result = {\n          type: 'element',\n          tagName: hName,\n          properties: {},\n          children: []\n        }\n\n        // To do: next major: take the children from the `root`, or inject the\n        // raw/text/comment or so into the element?\n        // if ('children' in node) {\n        //   // @ts-expect-error: assume `children` are allowed in elements.\n        //   result.children = node.children\n        // } else {\n        //   // @ts-expect-error: assume `node` is allowed in elements.\n        //   result.children.push(node)\n        // }\n      }\n    }\n\n    if (result.type === 'element' && hProperties) {\n      result.properties = {...result.properties, ...hProperties}\n    }\n\n    if (\n      'children' in result &&\n      result.children &&\n      hChildren !== null &&\n      hChildren !== undefined\n    ) {\n      // @ts-expect-error: assume valid children are defined.\n      result.children = hChildren\n    }\n  }\n\n  return result\n}\n\n/**\n * Transform an mdast node into a hast node.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} node\n *   mdast node.\n * @param {MdastParents | null | undefined} [parent]\n *   Parent of `node`.\n * @returns {HastElementContent | Array | null | undefined}\n *   Resulting hast node.\n */\n// To do: next major: do not expose, keep bound.\nexport function one(state, node, parent) {\n  const type = node && node.type\n\n  // Fail on non-nodes.\n  if (!type) {\n    throw new Error('Expected node, got `' + node + '`')\n  }\n\n  if (own.call(state.handlers, type)) {\n    return state.handlers[type](state, node, parent)\n  }\n\n  if (state.passThrough && state.passThrough.includes(type)) {\n    // To do: next major: deep clone.\n    // @ts-expect-error: types of passed through nodes are expected to be added manually.\n    return 'children' in node ? {...node, children: all(state, node)} : node\n  }\n\n  if (state.unknownHandler) {\n    return state.unknownHandler(state, node, parent)\n  }\n\n  return defaultUnknownHandler(state, node)\n}\n\n/**\n * Transform the children of an mdast node into hast nodes.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} parent\n *   mdast node to compile\n * @returns {Array}\n *   Resulting hast nodes.\n */\n// To do: next major: do not expose, keep bound.\nexport function all(state, parent) {\n  /** @type {Array} */\n  const values = []\n\n  if ('children' in parent) {\n    const nodes = parent.children\n    let index = -1\n    while (++index < nodes.length) {\n      const result = one(state, nodes[index], parent)\n\n      // To do: see if we van clean this? Can we merge texts?\n      if (result) {\n        if (index && nodes[index - 1].type === 'break') {\n          if (!Array.isArray(result) && result.type === 'text') {\n            result.value = result.value.replace(/^\\s+/, '')\n          }\n\n          if (!Array.isArray(result) && result.type === 'element') {\n            const head = result.children[0]\n\n            if (head && head.type === 'text') {\n              head.value = head.value.replace(/^\\s+/, '')\n            }\n          }\n        }\n\n        if (Array.isArray(result)) {\n          values.push(...result)\n        } else {\n          values.push(result)\n        }\n      }\n    }\n  }\n\n  return values\n}\n\n/**\n * Transform an unknown node.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} node\n *   Unknown mdast node.\n * @returns {HastText | HastElement}\n *   Resulting hast node.\n */\nfunction defaultUnknownHandler(state, node) {\n  const data = node.data || {}\n  /** @type {HastText | HastElement} */\n  const result =\n    'value' in node &&\n    !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))\n      ? {type: 'text', value: node.value}\n      : {\n          type: 'element',\n          tagName: 'div',\n          properties: {},\n          children: all(state, node)\n        }\n\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n\n/**\n * Wrap `nodes` with line endings between each node.\n *\n * @template {HastContent} Type\n *   Node type.\n * @param {Array} nodes\n *   List of nodes to wrap.\n * @param {boolean | null | undefined} [loose=false]\n *   Whether to add line endings at start and end.\n * @returns {Array}\n *   Wrapped nodes.\n */\nexport function wrap(nodes, loose) {\n  /** @type {Array} */\n  const result = []\n  let index = -1\n\n  if (loose) {\n    result.push({type: 'text', value: '\\n'})\n  }\n\n  while (++index < nodes.length) {\n    if (index) result.push({type: 'text', value: '\\n'})\n    result.push(nodes[index])\n  }\n\n  if (loose && nodes.length > 0) {\n    result.push({type: 'text', value: '\\n'})\n  }\n\n  return result\n}\n","/**\n * @typedef {import('hast').Content} HastContent\n * @typedef {import('hast').Root} HastRoot\n *\n * @typedef {import('mdast').Content} MdastContent\n * @typedef {import('mdast').Root} MdastRoot\n *\n * @typedef {import('./state.js').Options} Options\n */\n\n/**\n * @typedef {HastRoot | HastContent} HastNodes\n * @typedef {MdastRoot | MdastContent} MdastNodes\n */\n\nimport {footer} from './footer.js'\nimport {createState} from './state.js'\n\n/**\n * Transform mdast to hast.\n *\n * ##### Notes\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most utilities ignore `raw` nodes but two notable ones don’t:\n *\n * *   `hast-util-to-html` also has an option `allowDangerousHtml` which will\n *     output the raw HTML.\n *     This is typically discouraged as noted by the option name but is useful\n *     if you completely trust authors\n * *   `hast-util-raw` can handle the raw embedded HTML strings by parsing them\n *     into standard hast nodes (`element`, `text`, etc).\n *     This is a heavy task as it needs a full HTML parser, but it is the only\n *     way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `mdast-util-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * 

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * Example: headings (DOM clobbering) in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn’t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `
` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {HastNodes | null | undefined}\n * hast tree.\n */\n// To do: next major: always return a single `root`.\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, null)\n const foot = footer(state)\n\n if (foot) {\n // @ts-expect-error If there’s a footer, there were definitions, meaning block\n // content.\n // So assume `node` is a parent node.\n node.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n // To do: next major: always return root?\n return Array.isArray(node) ? {type: 'root', children: node} : node\n}\n","/**\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef NodeLike\n * @property {PositionLike | null | undefined} [position]\n */\n\n/**\n * Check if `node` is generated.\n *\n * @param {NodeLike | null | undefined} [node]\n * Node to check.\n * @returns {boolean}\n * Whether `node` is generated (does not have positional info).\n */\nexport function generated(node) {\n return (\n !node ||\n !node.position ||\n !node.position.start ||\n !node.position.start.line ||\n !node.position.start.column ||\n !node.position.end ||\n !node.position.end.line ||\n !node.position.end.column\n )\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('./state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Generate a hast footer for called footnote definitions.\n *\n * @param {State} state\n * Info passed around.\n * @returns {Element | undefined}\n * `section` element or `undefined`.\n */\nexport function footer(state) {\n /** @type {Array} */\n const listItems = []\n let index = -1\n\n while (++index < state.footnoteOrder.length) {\n const def = state.footnoteById[state.footnoteOrder[index]]\n\n if (!def) {\n continue\n }\n\n const content = state.all(def)\n const id = String(def.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n let referenceIndex = 0\n /** @type {Array} */\n const backReferences = []\n\n while (++referenceIndex <= state.footnoteCounts[id]) {\n /** @type {Element} */\n const backReference = {\n type: 'element',\n tagName: 'a',\n properties: {\n href:\n '#' +\n state.clobberPrefix +\n 'fnref-' +\n safeId +\n (referenceIndex > 1 ? '-' + referenceIndex : ''),\n dataFootnoteBackref: true,\n className: ['data-footnote-backref'],\n ariaLabel: state.footnoteBackLabel\n },\n children: [{type: 'text', value: '↩'}]\n }\n\n if (referenceIndex > 1) {\n backReference.children.push({\n type: 'element',\n tagName: 'sup',\n children: [{type: 'text', value: String(referenceIndex)}]\n })\n }\n\n if (backReferences.length > 0) {\n backReferences.push({type: 'text', value: ' '})\n }\n\n backReferences.push(backReference)\n }\n\n const tail = content[content.length - 1]\n\n if (tail && tail.type === 'element' && tail.tagName === 'p') {\n const tailTail = tail.children[tail.children.length - 1]\n if (tailTail && tailTail.type === 'text') {\n tailTail.value += ' '\n } else {\n tail.children.push({type: 'text', value: ' '})\n }\n\n tail.children.push(...backReferences)\n } else {\n content.push(...backReferences)\n }\n\n /** @type {Element} */\n const listItem = {\n type: 'element',\n tagName: 'li',\n properties: {id: state.clobberPrefix + 'fn-' + safeId},\n children: state.wrap(content, true)\n }\n\n state.patch(def, listItem)\n\n listItems.push(listItem)\n }\n\n if (listItems.length === 0) {\n return\n }\n\n return {\n type: 'element',\n tagName: 'section',\n properties: {dataFootnotes: true, className: ['footnotes']},\n children: [\n {\n type: 'element',\n tagName: state.footnoteLabelTagName,\n properties: {\n // To do: use structured clone.\n ...JSON.parse(JSON.stringify(state.footnoteLabelProperties)),\n id: 'footnote-label'\n },\n children: [{type: 'text', value: state.footnoteLabel}]\n },\n {type: 'text', value: '\\n'},\n {\n type: 'element',\n tagName: 'ol',\n properties: {},\n children: state.wrap(listItems, true)\n },\n {type: 'text', value: '\\n'}\n ]\n }\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('mdast-util-to-hast').Options} Options\n * @typedef {import('unified').Processor} Processor\n *\n * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n// Note: the `` overload doesn’t seem to work :'(\n\n/**\n * Plugin that turns markdown into HTML to support rehype.\n *\n * * If a destination processor is given, that processor runs with a new HTML\n * (hast) tree (bridge-mode).\n * As the given processor runs with a hast tree, and rehype plugins support\n * hast, that means rehype plugins can be used with the given processor.\n * The hast tree is discarded in the end.\n * It’s highly unlikely that you want to do this.\n * * The common case is to not pass a destination processor, in which case the\n * current processor continues running with a new HTML (hast) tree\n * (mutate-mode).\n * As the current processor continues with a hast tree, and rehype plugins\n * support hast, that means rehype plugins can be used after\n * `remark-rehype`.\n * It’s likely that this is what you want to do.\n *\n * @param destination\n * Optional unified processor.\n * @param options\n * Options passed to `mdast-util-to-hast`.\n */\nconst remarkRehype =\n /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */\n (\n function (destination, options) {\n return destination && 'run' in destination\n ? bridge(destination, options)\n : mutate(destination || options)\n }\n )\n\nexport default remarkRehype\n\n/**\n * Bridge-mode.\n * Runs the destination with the new hast tree.\n *\n * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}\n */\nfunction bridge(destination, options) {\n return (node, file, next) => {\n destination.run(toHast(node, options), file, (error) => {\n next(error)\n })\n }\n}\n\n/**\n * Mutate-mode.\n * Further plugins run on the hast tree.\n *\n * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}\n */\nfunction mutate(options) {\n // @ts-expect-error: assume a corresponding node is returned by `toHast`.\n return (node) => toHast(node, options)\n}\n","/**\n * @typedef {import('./info.js').Info} Info\n * @typedef {Record} Properties\n * @typedef {Record} Normal\n */\n\nexport class Schema {\n /**\n * @constructor\n * @param {Properties} property\n * @param {Normal} normal\n * @param {string} [space]\n */\n constructor(property, normal, space) {\n this.property = property\n this.normal = normal\n if (space) {\n this.space = space\n }\n }\n}\n\n/** @type {Properties} */\nSchema.prototype.property = {}\n/** @type {Normal} */\nSchema.prototype.normal = {}\n/** @type {string|null} */\nSchema.prototype.space = null\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {Schema[]} definitions\n * @param {string} [space]\n * @returns {Schema}\n */\nexport function merge(definitions, space) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n let index = -1\n\n while (++index < definitions.length) {\n Object.assign(property, definitions[index].property)\n Object.assign(normal, definitions[index].normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * @param {string} value\n * @returns {string}\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","export class Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n */\n constructor(property, attribute) {\n /** @type {string} */\n this.property = property\n /** @type {string} */\n this.attribute = attribute\n }\n}\n\n/** @type {string|null} */\nInfo.prototype.space = null\nInfo.prototype.boolean = false\nInfo.prototype.booleanish = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.number = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.spaceSeparated = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.defined = false\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","import {Info} from './info.js'\nimport * as types from './types.js'\n\n/** @type {Array} */\n// @ts-expect-error: hush.\nconst checks = Object.keys(types)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n * @param {number|null} [mask]\n * @param {string} [space]\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @param {DefinedInfo} values\n * @param {string} key\n * @param {unknown} value\n */\nfunction mark(values, key, value) {\n if (value) {\n // @ts-expect-error: assume `value` matches the expected value of `key`.\n values[key] = value\n }\n}\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n *\n * @typedef {Record} Attributes\n *\n * @typedef {Object} Definition\n * @property {Record} properties\n * @property {(attributes: Attributes, property: string) => string} transform\n * @property {string} [space]\n * @property {Attributes} [attributes]\n * @property {Array} [mustUseProperty]\n */\n\nimport {normalize} from '../normalize.js'\nimport {Schema} from './schema.js'\nimport {DefinedInfo} from './defined-info.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * @param {Definition} definition\n * @returns {Schema}\n */\nexport function create(definition) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n /** @type {string} */\n let prop\n\n for (prop in definition.properties) {\n if (own.call(definition.properties, prop)) {\n const value = definition.properties[prop]\n const info = new DefinedInfo(\n prop,\n definition.transform(definition.attributes || {}, prop),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(prop)\n ) {\n info.mustUseProperty = true\n }\n\n property[prop] = info\n\n normal[normalize(prop)] = prop\n normal[normalize(info.attribute)] = prop\n }\n }\n\n return new Schema(property, normal, definition.space)\n}\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n space: 'xlink',\n transform(_, prop) {\n return 'xlink:' + prop.slice(5).toLowerCase()\n },\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n }\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n space: 'xml',\n transform(_, prop) {\n return 'xml:' + prop.slice(3).toLowerCase()\n },\n properties: {xmlLang: null, xmlBase: null, xmlSpace: null}\n})\n","/**\n * @param {Record} attributes\n * @param {string} attribute\n * @returns {string}\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record} attributes\n * @param {string} property\n * @returns {string}\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n space: 'xmlns',\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n transform: caseInsensitiveTransform,\n properties: {xmlns: null, xmlnsXLink: null}\n})\n","import {booleanish, number, spaceSeparated} from './util/types.js'\nimport {create} from './util/create.js'\n\nexport const aria = create({\n transform(_, prop) {\n return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase()\n },\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n }\n})\n","import {\n boolean,\n overloadedBoolean,\n booleanish,\n number,\n spaceSeparated,\n commaSeparated\n} from './util/types.js'\nimport {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const html = create({\n space: 'html',\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n transform: caseInsensitiveTransform,\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: boolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // ``. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // ``. List of URIs to archives\n axis: null, // `` and ``. Use `scope` on ``\n background: null, // ``. Use CSS `background-image` instead\n bgColor: null, // `` and table elements. Use CSS `background-color` instead\n border: number, // ``. Use CSS `border-width` instead,\n borderColor: null, // `
`. Use CSS `border-color` instead,\n bottomMargin: number, // ``\n cellPadding: null, // `
`\n cellSpacing: null, // `
`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // ``\n clear: null, // `
`. Use CSS `clear` instead\n code: null, // ``\n codeBase: null, // ``\n codeType: null, // ``\n color: null, // `` and `
`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // ``\n event: null, // `\n${'```'}`;\n}\n\nfunction ListIndex({ index }: { index: number }) {\n return (\n
\n {index}\n
\n );\n}\n\nexport function useWebSdkGuideModal() {\n const [visible, setVisible] = useState(false);\n const [scriptTagMd, setScriptTagMd] = useState('');\n\n const show = (params: WebSdkGuideParams) => {\n const md = getWebSdkScriptTagMD(params);\n setScriptTagMd(md);\n setVisible(true);\n };\n const close = () => setVisible(false);\n\n const node = (\n {I18n.t('app_publish_sdk_confirm')}\n }\n // z-index requires a Popover greater than publish-status.\n zIndex={2000}\n >\n \n \n {I18n.t('app_publish_sdk_step_1', {\n doc_link: (\n \n {I18n.t('app_publish_sdk_step_1_doc')}\n \n ),\n })}\n \n \n \n {I18n.t('app_publish_sdk_step_2')}\n \n \n \n \n {I18n.t('app_publish_sdk_step_3')}\n \n \n );\n\n return { node, show };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Tag, type TagProps, Typography } from '@coze-arch/coze-design';\n\nexport interface PublishStepTitleProps {\n title: string;\n tag?: string;\n color?: TagProps['color'];\n}\n\nexport function PublishStepTitle({ title, tag, color }: PublishStepTitleProps) {\n return (\n
\n \n {title}\n \n {typeof tag === 'string' ? (\n \n {tag}\n \n ) : null}\n
\n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n IconCozCheckMarkCircle,\n IconCozClock,\n IconCozClockFill,\n IconCozCrossCircle,\n IconCozWarningCircle,\n type OriginIconProps,\n} from '@coze-arch/coze-design/icons';\nimport { type StepProps } from '@coze-arch/coze-design';\n\nexport interface PublishStepIconProps {\n status: StepProps['status'] | 'warn';\n}\n\nexport function PublishStepIcon({ status }: PublishStepIconProps) {\n const iconProps: Pick = {\n width: '16px',\n height: '16px',\n };\n switch (status) {\n case 'wait':\n return ;\n case 'process':\n return ;\n case 'finish':\n return (\n \n );\n case 'warn':\n return (\n \n );\n case 'error':\n return ;\n default:\n return null;\n }\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type publish,\n ConnectorPublishStatus,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';\nimport {\n CozAvatar,\n Tag,\n type TagProps,\n Typography,\n} from '@coze-arch/coze-design';\n\nimport {\n MINI_PROGRAM_DOUYIN_DOWNLOAD_CONNECTOR_ID,\n MINI_PROGRAM_WECHAT_DOWNLOAD_CONNECTOR_ID,\n WEB_SDK_CONNECTOR_ID,\n} from '@/utils/constants';\n\nfunction getMiniProgramGuideUrl(connectorId?: string) {\n switch (connectorId) {\n case MINI_PROGRAM_DOUYIN_DOWNLOAD_CONNECTOR_ID:\n return '/docs/guides/publish_app_to_douyin_microapp';\n case MINI_PROGRAM_WECHAT_DOWNLOAD_CONNECTOR_ID:\n return '/docs/guides/publish_app_to_wechat_mini_program';\n default:\n return '';\n }\n}\n\nexport interface ConnectorStatusProps {\n result: publish.ConnectorPublishResult;\n showTag?: boolean;\n onShowWebSdkGuide?: (workflowId: string) => void;\n}\n\nconst ConnectorTagMap: Record<\n ConnectorPublishStatus,\n (Pick & { text: I18nKeysNoOptionsType }) | null\n> = {\n [ConnectorPublishStatus.Default]: {\n color: 'brand',\n text: 'project_releasing',\n },\n [ConnectorPublishStatus.Auditing]: {\n color: 'brand',\n text: 'under_review',\n },\n [ConnectorPublishStatus.Failed]: {\n color: 'red',\n text: 'project_release_failed',\n },\n [ConnectorPublishStatus.Success]: {\n color: 'green',\n text: 'project_release_success',\n },\n [ConnectorPublishStatus.Disable]: null, // The corresponding state will not be returned to the front end and will not be adapted.\n};\n\nexport function ConnectorStatus({\n result,\n showTag,\n onShowWebSdkGuide,\n}: ConnectorStatusProps) {\n const tagConfig = ConnectorTagMap[result.connector_publish_status ?? 0];\n // When the Web SDK channel is successfully released, the installation instructions will be displayed\n const shouldShowWebSdkGuide =\n result.connector_id === WEB_SDK_CONNECTOR_ID &&\n result.connector_publish_status === ConnectorPublishStatus.Success;\n const workflowId =\n result.connector_publish_config?.selected_workflows?.[0]?.workflow_id;\n const showWebSdkGuide = () => onShowWebSdkGuide?.(workflowId ?? '');\n return (\n \n \n \n {result.connector_name}\n \n {showTag !== false && tagConfig ? (\n \n {I18n.t(tagConfig.text)}\n \n ) : null}\n
\n {result.connector_publish_status_msg ? (\n \n {result.connector_publish_status_msg}\n \n ) : null}\n {/* Web SDK Channel - Installation Guide */}\n {shouldShowWebSdkGuide ? (\n \n {I18n.t('project_release_guide')}\n \n ) : null}\n {/* Mini Program Channel - Download Code & Installation Guide */}\n {result.download_link ? (\n <>\n \n {I18n.t('project_release_download_code')}\n \n \n {I18n.t('project_release_guide')}\n \n \n ) : null}\n {result.share_link ? (\n \n {I18n.t('project_release_open_in_store')}\n \n ) : null}\n
\n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useParams } from 'react-router-dom';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\n\nimport {\n ConnectorPublishStatus,\n type PublishRecordDetail,\n PublishRecordStatus,\n ResourceType,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { IconCozPlugin, IconCozWorkflow } from '@coze-arch/coze-design/icons';\nimport {\n type StepProps,\n Steps,\n TagGroup,\n Typography,\n} from '@coze-arch/coze-design';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { type UITagProps } from '@coze-arch/bot-semi';\n\nimport { useWebSdkGuideModal } from '@/web-sdk-guide';\nimport { WEB_SDK_CONNECTOR_ID } from '@/utils/constants';\nimport { type ProjectPublishStore } from '@/store';\n\nimport { PublishStepTitle } from './components/publish-step-title';\nimport { PublishStepIcon } from './components/publish-step-icon';\nimport {\n ConnectorStatus,\n type ConnectorStatusProps,\n} from './components/connector-status';\n\nfunction getDefaultStepProps(title: string): StepProps {\n return {\n icon: ,\n title: ,\n };\n}\n\nfunction toPackStepProps(\n record: PublishRecordDetail,\n tagGroupRef: React.RefObject,\n maxTagCount?: number,\n): StepProps {\n const title = I18n.t('project_release_package');\n if (typeof record.publish_status !== 'number') {\n return getDefaultStepProps(title);\n }\n switch (record.publish_status) {\n case PublishRecordStatus.Packing: {\n return {\n icon: ,\n title: (\n \n ),\n };\n }\n case PublishRecordStatus.PackFailed: {\n const tags: UITagProps[] | undefined =\n record.publish_status_detail?.pack_failed_detail?.map(item => ({\n tagKey: item.entity_id,\n className: 'pack-status-tag',\n prefixIcon:\n item.entity_type === ResourceType.Workflow ? (\n \n ) : (\n \n ),\n children: item.entity_name,\n }));\n return {\n icon: ,\n title: (\n \n ),\n description: tags ? (\n
\n \n {I18n.t('project_release_pack_fail_reason')}\n \n \n
\n ) : null,\n };\n }\n default: {\n return {\n icon: ,\n title: (\n \n ),\n };\n }\n }\n}\n\nfunction PackStep(props: { record: PublishRecordDetail }) {\n const ref = useRef(null);\n const [maxTagCount, setMaxTagCount] = useState(undefined);\n const stepProps = toPackStepProps(props.record, ref, maxTagCount);\n\n /**\n * TagGroup only supports setting maxTagCount to control the number of display tags, not the number of display rows.\n * Here, the number of rows it is in is determined by iterating over the offsetTop of all Tags, and maxTagCount\n * Set to just enough to display the number of two rows.\n */\n useLayoutEffect(() => {\n if (!ref.current) {\n return;\n }\n const tags = ref.current.getElementsByClassName(\n 'pack-status-tag',\n ) as HTMLCollectionOf;\n if (tags.length <= 0) {\n return;\n }\n let top = -1;\n let rowCount = 0;\n for (let i = 0; i < tags.length; i++) {\n const tagTop = tags[i].offsetTop;\n if (top !== tagTop) {\n top = tagTop;\n rowCount++;\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers -- offsetTop The third change, the current Tag is in the third line\n if (rowCount >= 3) {\n setMaxTagCount(i);\n break;\n }\n }\n }\n }, [props.record.publish_status_detail?.pack_failed_detail]);\n\n return ;\n}\n\nfunction toAuditStepProps(record: PublishRecordDetail): StepProps {\n const title = I18n.t('project_release_coze_audit');\n if (typeof record.publish_status !== 'number') {\n return getDefaultStepProps(title);\n }\n switch (record.publish_status) {\n case PublishRecordStatus.Packing:\n case PublishRecordStatus.PackFailed: {\n return getDefaultStepProps(title);\n }\n case PublishRecordStatus.Auditing: {\n return {\n status: 'process',\n icon: ,\n title: (\n \n ),\n };\n }\n case PublishRecordStatus.AuditNotPass: {\n return {\n status: 'error',\n icon: ,\n title: (\n \n ),\n };\n }\n default: {\n return {\n status: 'finish',\n icon: ,\n title: (\n \n ),\n };\n }\n }\n}\n\nfunction getConnectorsPublishStatus(\n record: ProjectPublishStore['publishRecordDetail'],\n) {\n const connectorResults = record.connector_publish_result ?? [];\n if (connectorResults.length <= 0) {\n return 'wait';\n }\n const failedCount = connectorResults.filter(\n item => item.connector_publish_status === ConnectorPublishStatus.Failed,\n ).length;\n if (failedCount > 0) {\n // All channels failed with a red cross; some channels failed with a yellow exclamation mark\n return failedCount === connectorResults.length ? 'error' : 'warn';\n }\n const publishingCount = connectorResults.filter(\n item =>\n item.connector_publish_status === ConnectorPublishStatus.Default ||\n item.connector_publish_status === ConnectorPublishStatus.Auditing,\n ).length;\n if (publishingCount > 0) {\n // Some channels are in the release, showing the clock icon.\n return 'process';\n }\n return 'finish';\n}\n\nfunction toPublishStepProps(\n record: ProjectPublishStore['publishRecordDetail'],\n onShowWebSdkGuide: ConnectorStatusProps['onShowWebSdkGuide'],\n): StepProps {\n const title = I18n.t('project_release_channel');\n if (typeof record.publish_status !== 'number') {\n return getDefaultStepProps(title);\n }\n // The \"Channel Review and Publish\" step has not been reached, the default gray clock icon is displayed\n if (record.publish_status < PublishRecordStatus.ConnectorPublishing) {\n return {\n ...getDefaultStepProps(title),\n description: record.connector_publish_result?.map(item => (\n \n )),\n };\n }\n return {\n icon: ,\n title: (\n \n ),\n description: record.connector_publish_result?.map(item => (\n \n )),\n };\n}\n\nfunction PublishStep(props: { record: PublishRecordDetail }) {\n const { project_id = '' } = useParams();\n const { node, show: showWebSdkGuideModal } = useWebSdkGuideModal();\n const onShowWebSdkGuide = (workflowId: string) =>\n showWebSdkGuideModal({\n projectId: project_id,\n workflowId,\n version: props.record.connector_publish_result?.find(\n item => item.connector_id === WEB_SDK_CONNECTOR_ID,\n )?.connector_bind_info?.sdk_version,\n });\n const stepProps = toPublishStepProps(props.record, onShowWebSdkGuide);\n return (\n <>\n \n {node}\n \n );\n}\n\nexport interface ProjectPublishProgressProps {\n record: ProjectPublishStore['publishRecordDetail'];\n}\n\nexport function ProjectPublishProgress({\n record,\n}: ProjectPublishProgressProps) {\n return (\n \n \n \n \n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { NavLink } from 'react-router-dom';\nimport { type FC } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { IntelligenceType } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { useFlags } from '@coze-arch/bot-flags';\nimport { useIsPublishRecordReady } from '@coze-studio/publish-manage-hooks';\nimport { IconCozCheckMarkCircle } from '@coze-arch/coze-design/icons';\n\nimport { useProjectPublishStore } from '../store';\nimport { ProjectPublishProgress } from '../publish-progress';\n\nexport const PublishRecord: FC<{\n projectId: string;\n spaceId: string;\n}> = ({ projectId, spaceId }) => {\n const { publishRecordDetail } = useProjectPublishStore(\n useShallow(state => ({\n publishRecordDetail: state.publishRecordDetail,\n })),\n );\n\n const [FLAGS] = useFlags();\n\n const { ready, inited } = useIsPublishRecordReady({\n type: IntelligenceType.Project,\n spaceId,\n intelligenceId: projectId,\n // Support soon, so stay tuned.\n enable: FLAGS['bot.studio.publish_management'] && !IS_OPEN_SOURCE,\n });\n\n return (\n
\n
\n \n
\n {I18n.t('project_release_already_released')}\n
\n
\n {I18n.t('project_release_already_released_desc')}\n
\n {/* Support soon, so stay tuned. */}\n {FLAGS['bot.studio.publish_management'] && !IS_OPEN_SOURCE ? (\n
\n {I18n.t('release_management_detail1', {\n button: (\n {\n if (!ready) {\n e.preventDefault();\n }\n }}\n to={`/space/${spaceId}/publish/app/${projectId}`}\n >\n {I18n.t('release_management')}\n {ready || !inited\n ? null\n : `(${I18n.t('release_management_generating')})`}\n \n ),\n })}\n
\n ) : null}\n
\n\n
\n \n
\n
\n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable max-lines-per-function */\nimport { type RefObject, useEffect, useRef, useState } from 'react';\n\nimport { useDebounceFn } from 'ahooks';\nimport { ConnectorClassification } from '@coze-arch/idl/intelligence_api';\n\nimport { usePublishContainer } from '../../context/publish-container-context';\n\nexport type ConnectorRefMap = Record<\n ConnectorClassification,\n RefObject\n>;\n\nconst useConnectorRefMap = (): ConnectorRefMap => ({\n [ConnectorClassification.APIOrSDK]: useRef(null),\n [ConnectorClassification.MiniProgram]: useRef(null),\n [ConnectorClassification.SocialPlatform]: useRef(null),\n [ConnectorClassification.Coze]: useRef(null),\n [ConnectorClassification.CozeSpaceExtensionLibrary]:\n useRef(null),\n});\n\nconst getActiveConnectorTarget = ({\n containerScrollTop,\n connectorRefMap,\n connectorBarHeight,\n publishHeaderHeight,\n}: {\n containerScrollTop: number;\n connectorBarHeight: number;\n connectorRefMap: ConnectorRefMap;\n publishHeaderHeight: number;\n}) => {\n const connectorTargetLis = Object.entries(connectorRefMap)\n .map(([, ref]) => ref.current)\n .filter((element): element is HTMLDivElement => Boolean(element));\n\n const offsetTopList = connectorTargetLis.map(target => ({\n offsetTop:\n target.offsetTop -\n containerScrollTop -\n publishHeaderHeight -\n connectorBarHeight,\n target,\n }));\n\n const sortedTopList = offsetTopList.sort(\n (prev, cur) => prev.offsetTop - cur.offsetTop,\n );\n const preActiveConnectorList = sortedTopList.filter(\n item => item.offsetTop <= 0,\n );\n const activeConnector = preActiveConnectorList.length\n ? preActiveConnectorList.at(-1)\n : sortedTopList.at(0);\n\n return activeConnector?.target;\n};\n/** experience point */\nconst LOCK_TIME = 300;\n\nexport const useConnectorScroll = () => {\n const [activeConnectorTarget, setActiveConnectorTarget] =\n useState();\n const connectorBarRef = useRef(null);\n\n const { getContainerRef } = usePublishContainer();\n\n const connectorRefMap = useConnectorRefMap();\n\n const { publishHeaderHeight } = usePublishContainer();\n\n const [animationStateMap, setAnimationMap] = useState<\n Record\n >({\n [ConnectorClassification.APIOrSDK]: false,\n [ConnectorClassification.MiniProgram]: false,\n [ConnectorClassification.SocialPlatform]: false,\n [ConnectorClassification.Coze]: false,\n [ConnectorClassification.CozeSpaceExtensionLibrary]: false,\n });\n\n /**\n * All three conditions need to be met simultaneously\n * 1. As the page scrolls to different anchors, the tab bar activates the button for the corresponding area\n * 2. Click the tab bar, activate the corresponding button, and scroll directly to the corresponding area of the page\n * 3. When the page height is insufficient to scroll, click the tab bar to activate the corresponding button\n *\n * Since the scroll is a smooth effect, conditions 2 and 3 will conflict, and the lock needs to be performed when the user clicks the tab bar to scroll.\n * Condition 1 does not fire when locked\n * Need to give condition 3 an unlocking mechanism with a bottom line\n */\n const manualScrollLockRef = useRef(false);\n\n const manualScrollLock = () => {\n manualScrollLockRef.current = true;\n };\n\n const manualScrollUnLock = () => {\n manualScrollLockRef.current = false;\n };\n\n /** Unlock after LOCK_TIME */\n const manualScrollUnLockDebounce = useDebounceFn(manualScrollUnLock, {\n wait: LOCK_TIME,\n });\n\n /** The bottom unlocking mechanism, if the user clicks the tab bar but does not unlock the LOCK_TIME should also be unlocked */\n const baseUnLockDebounce = useDebounceFn(manualScrollUnLock, {\n wait: LOCK_TIME,\n });\n\n useEffect(() => {\n const containerTarget = getContainerRef()?.current;\n const connectorBarTarget = connectorBarRef.current;\n if (!containerTarget || !connectorBarTarget) {\n return;\n }\n const changeActiveConnectorTarget = () => {\n if (manualScrollLockRef.current) {\n return;\n }\n setActiveConnectorTarget(\n getActiveConnectorTarget({\n containerScrollTop: containerTarget.scrollTop,\n connectorRefMap,\n connectorBarHeight: connectorBarTarget.offsetHeight,\n publishHeaderHeight,\n }),\n );\n };\n\n changeActiveConnectorTarget();\n\n const onScroll = () => {\n // If the page scrolls, no safety net mechanism is required\n baseUnLockDebounce.cancel();\n manualScrollUnLockDebounce.run();\n changeActiveConnectorTarget();\n };\n\n containerTarget.addEventListener('scroll', onScroll);\n return () => {\n containerTarget.removeEventListener('scroll', onScroll);\n };\n }, [getContainerRef, connectorRefMap, publishHeaderHeight]);\n\n const startAnimation = (classification: ConnectorClassification) => {\n setAnimationMap(prev => ({ ...prev, [classification]: true }));\n };\n\n const closeAnimation = (classification: ConnectorClassification) => {\n setAnimationMap(prev => ({ ...prev, [classification]: false }));\n };\n\n const scrollToConnector = (classification: ConnectorClassification) => {\n const barTarget = connectorBarRef.current;\n const containerTarget = getContainerRef()?.current;\n const connectorTarget = connectorRefMap[classification].current;\n if (!barTarget || !containerTarget || !connectorTarget) {\n return;\n }\n\n containerTarget.scrollTo({\n behavior: 'smooth',\n top:\n connectorTarget.offsetTop -\n publishHeaderHeight -\n barTarget.offsetHeight,\n });\n startAnimation(classification);\n setActiveConnectorTarget(connectorTarget);\n manualScrollLock();\n baseUnLockDebounce.run();\n };\n\n return {\n connectorRefMap,\n activeConnectorTarget,\n connectorBarRef,\n scrollToConnector,\n closeAnimation,\n animationStateMap,\n };\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod';\nimport { produce } from 'immer';\nimport { typeSafeJSONParse } from '@coze-arch/bot-utils';\n\nconst publishAnchorDataSchema = z.object({\n projectId: z.string(),\n connectorIdBeforeRedirect: z.string(),\n});\n\nconst publishAnchorSchema = z.record(publishAnchorDataSchema);\n\ntype PublishAnchorData = z.infer;\n\ntype PublishAnchorType = z.infer;\n\nclass PublishAnchorService {\n private PUBLISH_ANCHOR_KEY = 'coz_project_publish_anchor';\n anchorValues: PublishAnchorType = {};\n\n private load = () => {\n try {\n const stringifyLocalData = localStorage.getItem(this.PUBLISH_ANCHOR_KEY);\n const localData = typeSafeJSONParse(stringifyLocalData);\n const validData = publishAnchorSchema.parse(localData);\n // Using zod to type-check localData\n this.anchorValues = validData;\n } catch {\n this.anchorValues = {};\n }\n };\n\n private save = () => {\n localStorage.setItem(\n this.PUBLISH_ANCHOR_KEY,\n JSON.stringify(this.anchorValues),\n );\n };\n\n setAnchor: (params: {\n userId: string;\n projectId: string;\n connectorId: string;\n }) => void = ({ userId, projectId, connectorId }) => {\n this.anchorValues = produce(this.anchorValues, draft => {\n draft[userId] = {\n projectId,\n connectorIdBeforeRedirect: connectorId,\n };\n });\n this.save();\n };\n getAnchor: (params: {\n userId: string;\n projectId: string;\n }) => PublishAnchorData | undefined = ({ userId, projectId }) => {\n const userData = this.anchorValues[userId];\n if (userData?.projectId === projectId) {\n return userData;\n }\n };\n\n removeAnchor: (params: { userId: string; projectId: string }) => void = ({\n userId,\n projectId,\n }) => {\n const hasAnchor = Boolean(this.getAnchor({ userId, projectId }));\n if (!hasAnchor) {\n return;\n }\n delete this.anchorValues[userId];\n this.save();\n };\n\n clearAll = () => {\n localStorage.removeItem(this.PUBLISH_ANCHOR_KEY);\n this.anchorValues = {};\n };\n\n constructor() {\n this.load();\n }\n}\n\nexport const publishAnchorService = new PublishAnchorService();\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useUserInfo } from '@coze-arch/foundation-sdk';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { useParams } from 'react-router-dom';\n\nimport { publishAnchorService } from '@/service/connector-anchor';\n\nexport const useBizConnectorAnchor = () => {\n const userId = useUserInfo()?.user_id_str;\n const projectId = useParams().project_id;\n\n const setAnchor = (connectorId: string) => {\n if (!userId || !projectId) {\n return;\n }\n return publishAnchorService.setAnchor({ projectId, userId, connectorId });\n };\n\n const getAnchor = () => {\n if (!userId || !projectId) {\n return;\n }\n return publishAnchorService.getAnchor({ userId, projectId });\n };\n\n const removeAnchor = () => {\n if (!userId || !projectId) {\n return;\n }\n return publishAnchorService.removeAnchor({ userId, projectId });\n };\n\n return {\n setAnchor,\n getAnchor,\n removeAnchor,\n };\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect } from 'react';\n\nimport { useProjectPublishStore } from '@/store';\nimport { useBizConnectorAnchor } from '@/hooks/use-biz-connector-anchor';\n\nimport { type ConnectorGroup } from '../utils/format-connector-groups';\nimport { usePublishContainer } from '../../context/publish-container-context';\nimport { type ConnectorRefMap } from './use-connector-scroll';\n\nexport const useAutoScrollToConnector = ({\n connectorGroupList,\n connectorRefMap,\n}: {\n connectorRefMap: ConnectorRefMap;\n connectorGroupList: ConnectorGroup[];\n}) => {\n const { getAnchor, removeAnchor } = useBizConnectorAnchor();\n const { getContainerRef } = usePublishContainer();\n\n useEffect(() => {\n const anchor = getAnchor();\n\n if (!anchor) {\n return;\n }\n\n const targetGroup = connectorGroupList.find(group =>\n group.connectors.some(\n connector => connector.id === anchor.connectorIdBeforeRedirect,\n ),\n );\n\n if (!targetGroup) {\n return;\n }\n\n const connectorRef = connectorRefMap[targetGroup.type];\n const { updateSelectedConnectorIds } = useProjectPublishStore.getState();\n updateSelectedConnectorIds(prev => {\n if (prev.some(id => id === anchor.connectorIdBeforeRedirect)) {\n return prev;\n }\n return prev.concat(anchor.connectorIdBeforeRedirect);\n });\n getContainerRef()?.current?.scrollTo({\n top: connectorRef.current?.offsetTop,\n behavior: 'smooth',\n });\n\n removeAnchor();\n }, [connectorGroupList, connectorRefMap]);\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useRequest } from 'ahooks';\nimport { type CheckType, WorkflowMode } from '@coze-arch/idl/workflow_api';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { workflowApi } from '@coze-arch/bot-api';\nimport { useParams } from 'react-router-dom';\n\nexport interface ChatflowOptionProps {\n value: string;\n label: string;\n disabled?: boolean;\n tooltip?: string;\n}\n\nexport function useChatflowOptions(checkType?: CheckType) {\n const needsCheck = typeof checkType !== 'undefined';\n const { space_id = '', project_id = '' } = useParams();\n const { data: chatflowOptions, loading } = useRequest(async () => {\n const res = await workflowApi.GetWorkFlowList({\n space_id,\n project_id,\n flow_mode: WorkflowMode.ChatFlow,\n page: 1,\n size: 100,\n checker: needsCheck ? [checkType] : undefined,\n });\n return res.data.workflow_list?.map(item => ({\n label: item.name,\n value: item.workflow_id,\n disabled: needsCheck\n ? item.check_result?.find(r => r.type === checkType)?.is_pass !== true\n : false,\n tooltip: item.check_result?.find(r => r.type === checkType)?.reason,\n })) as ChatflowOptionProps[];\n });\n return { chatflowOptions, loading };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type PropsWithChildren } from 'react';\n\nimport classNames from 'classnames';\nimport { IconCozCheckMarkFill } from '@coze-arch/coze-design/icons';\nimport {\n type optionRenderProps,\n Tooltip,\n Typography,\n} from '@coze-arch/coze-design';\n\nexport type OptionWithTooltipProps = PropsWithChildren<{\n option: optionRenderProps;\n tooltip?: string;\n}>;\n\nexport function OptionWithTooltip({\n option,\n tooltip,\n children,\n}: OptionWithTooltipProps) {\n const optionNode = (\n \n
\n {option.selected ? (\n \n ) : null}\n
\n {children ?? (\n \n {option.label}\n \n )}\n \n );\n return tooltip ? (\n \n {optionNode}\n \n ) : (\n optionNode\n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { CheckType } from '@coze-arch/idl/workflow_api';\nimport { ConnectorClassification } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { FormSelect, type optionRenderProps } from '@coze-arch/coze-design';\n\nimport { useProjectPublishStore } from '@/store';\n\nimport {\n type ChatflowOptionProps,\n useChatflowOptions,\n} from '../hooks/use-chatflow-options';\nimport { OptionWithTooltip } from './option-with-tooltip';\n\nexport const SocialPlatformChatflow: React.FC<{ className?: string }> = ({\n className,\n}) => {\n const {\n connectorList,\n selectedConnectorIds,\n socialPlatformChatflow,\n setProjectPublishInfo,\n } = useProjectPublishStore(\n useShallow(state => ({\n connectorList: state.connectorList,\n selectedConnectorIds: state.selectedConnectorIds,\n socialPlatformChatflow: state.socialPlatformChatflow,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n const hasSelectedSocialPlatforms = connectorList.some(\n c =>\n selectedConnectorIds.includes(c.id) &&\n c.connector_classification === ConnectorClassification.SocialPlatform,\n );\n\n const { chatflowOptions } = useChatflowOptions(CheckType.SocialPublish);\n\n const handleSelectChatflow = (option: ChatflowOptionProps) => {\n setProjectPublishInfo({\n socialPlatformChatflow: {\n selected_workflows: [\n {\n workflow_id: option.value,\n workflow_name: option.label,\n },\n ],\n },\n });\n };\n\n return (\n
\n (\n \n )}\n onSelect={(_: unknown, option: unknown) =>\n handleSelectChatflow(option as ChatflowOptionProps)\n }\n rules={[\n // Chatflow is required when SocialPlatform is selected\n { required: hasSelectedSocialPlatforms },\n // Verify that the selected chatflow exists & & is not disabled\n {\n validator: (_rule: unknown, value: unknown) => {\n if (!hasSelectedSocialPlatforms) {\n return true;\n }\n const selected = chatflowOptions?.find(\n option => option.value === (value as string),\n );\n if (!selected) {\n return new Error(I18n.t('project_release_chatflow3'));\n }\n if (selected.disabled) {\n return new Error(selected.tooltip);\n }\n return true;\n },\n },\n ]}\n />\n
\n );\n};\n","\n import API from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type CSSProperties, forwardRef, type PropsWithChildren } from 'react';\n\nimport classNames from 'classnames';\nimport { Badge, Button } from '@coze-arch/coze-design';\n\nimport styles from './index.module.less';\n\nexport interface TabbarItemProps {\n onClick: () => void;\n isActive: boolean;\n selectedConnectorCount: number;\n}\nexport const ConnectorTabbarItem: React.FC<\n PropsWithChildren\n> = ({ onClick, isActive, children, selectedConnectorCount }) => (\n \n {children}\n {selectedConnectorCount > 0 ? (\n \n ) : null}\n \n);\n\nexport interface ConnectorTabbarProps {\n className?: string;\n style?: CSSProperties;\n}\n\nexport const ConnectorTabbar = forwardRef<\n HTMLDivElement,\n PropsWithChildren\n>(({ className, style, children }, ref) => (\n \n {children}\n \n));\n","\n import API from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./connector-group-header.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./connector-group-header.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type AnimationEventHandler } from 'react';\n\nimport classNames from 'classnames';\nimport { ConnectorClassification } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport {\n IconCozInfoCircle,\n IconCozDiamondFill,\n} from '@coze-arch/coze-design/icons';\nimport { Tooltip, Space } from '@coze-arch/coze-design';\nimport {\n useBenefitAvailable,\n PremiumPaywallScene,\n usePremiumPaywallModal,\n} from '@coze-studio/premium-components-adapter';\n\nimport styles from './connector-group-header.module.less';\n\ninterface ConnectorGroupHeaderProps {\n label: string;\n tooltipContent: string;\n showTooltipInfo: boolean;\n isHighlight: boolean;\n type: ConnectorClassification;\n onAnimationEnd: AnimationEventHandler;\n}\n\nexport function ConnectorGroupHeader({\n label,\n tooltipContent,\n showTooltipInfo,\n isHighlight,\n type,\n onAnimationEnd,\n}: ConnectorGroupHeaderProps) {\n // paywall\n const isAPIOrSDK = type === ConnectorClassification.APIOrSDK;\n const isAvailable = useBenefitAvailable({\n scene: PremiumPaywallScene.API,\n });\n const { node: premiumPaywallModal, open: openPremiumPaywallModal } =\n usePremiumPaywallModal({ scene: PremiumPaywallScene.API });\n\n return (\n \n

{label}

\n {isAPIOrSDK && !isAvailable ? (\n \n \n {I18n.t('coze_quota_exemption_notice', {\n link: (\n \n {I18n.t('coze_upgrade_package')}\n \n ),\n })}\n \n ) : null}\n {showTooltipInfo ? (\n \n \n \n ) : null}\n {premiumPaywallModal}\n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type StoreBindKey } from '@/store';\n\ntype SelfMapping = {\n [K in T]: K; // Key syntax: Mapping each literal type to itself\n};\n\ntype KeyMapping = SelfMapping;\n\nexport const isStoreBindConfigured = (\n config: Record,\n): boolean => {\n // Prevent StoreBindKey changes from causing bugs\n const { category_id, display_screen }: KeyMapping = {\n category_id: 'category_id',\n display_screen: 'display_screen',\n };\n return Boolean(config[category_id]) && Boolean(config[display_screen]);\n};\n","import baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport baseUniq from './_baseUniq.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nexport default union;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable complexity */\n/* eslint-disable @coze-arch/max-line-per-function */\nimport { useParams } from 'react-router-dom';\nimport { useState, useRef } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport { debounce, union, find } from 'lodash-es';\nimport { useInfiniteScroll } from 'ahooks';\nimport {\n CheckType,\n WorkflowMode,\n type Workflow,\n} from '@coze-arch/idl/workflow_api';\nimport {\n type PublishConnectorInfo,\n ConnectorConfigStatus,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { IconCozInfoCircle, IconCozEmpty } from '@coze-arch/coze-design/icons';\nimport {\n Modal,\n Search,\n Checkbox,\n Divider,\n Spin,\n Tooltip,\n Space,\n EmptyState,\n} from '@coze-arch/coze-design';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { workflowApi } from '@coze-arch/bot-api';\n\nimport { useProjectPublishStore } from '@/store';\n\nexport interface DataList {\n list: Workflow[];\n hasMore?: boolean;\n nextCursorId?: string;\n total: number;\n nextPageIndex: number;\n}\n\nconst debounceTimer = 500;\n\nexport const UseMcpConfigModal = ({\n record,\n}: {\n record: PublishConnectorInfo;\n}) => {\n const [visible, setVisible] = useState(false);\n const [searchVal, setSearchVal] = useState('');\n const [checkedList, setCheckedList] = useState([]);\n const { space_id = '', project_id = '' } = useParams();\n\n const {\n connectorPublishConfig,\n setProjectPublishInfo,\n connectorList,\n selectedConnectorIds,\n } = useProjectPublishStore(\n useShallow(state => ({\n connectorPublishConfig: state.connectorPublishConfig,\n setProjectPublishInfo: state.setProjectPublishInfo,\n connectorList: state.connectorList,\n selectedConnectorIds: state.selectedConnectorIds,\n })),\n );\n\n const containerRef = useRef(null);\n\n const { loading, data, loadingMore } = useInfiniteScroll(\n async d => {\n const res = await workflowApi.GetWorkFlowList({\n space_id,\n project_id,\n flow_mode: WorkflowMode.All,\n checker: [CheckType.MCPPublish],\n size: 15,\n page: d?.nextPageIndex ?? 1,\n name: searchVal,\n });\n return {\n list: res.data?.workflow_list ?? [],\n total: Number(res.data?.total ?? 0),\n nextPageIndex: (d?.nextPageIndex || 1) + 1,\n };\n },\n {\n target: containerRef,\n reloadDeps: [searchVal],\n isNoMore: dataSource =>\n Boolean(\n !dataSource?.total ||\n (dataSource.nextPageIndex - 1) * 15 >= dataSource.total,\n ),\n },\n );\n\n // Only undisabled workflows can be selected.\n const filterPassList = data?.list?.filter(\n item =>\n find(item?.check_result, {\n type: CheckType.MCPPublish,\n })?.is_pass,\n );\n //Half selection state\n const indeterminate =\n checkedList.length > 0 &&\n checkedList.length < (filterPassList?.length || 0);\n //Select All\n const checkAll = checkedList.length === (filterPassList?.length || 0);\n\n const close = () => {\n setVisible(false);\n };\n\n const handleConfirm = () => {\n setProjectPublishInfo({\n connectorPublishConfig: {\n ...connectorPublishConfig,\n [record.id]: {\n selected_workflows: checkedList.map(item => {\n const res = find(data?.list, {\n workflow_id: item,\n });\n return {\n workflow_id: res?.workflow_id,\n workflow_name: res?.name,\n };\n }),\n },\n },\n connectorList: connectorList.map(item => {\n if (item.id === record.id) {\n return {\n ...item,\n config_status: ConnectorConfigStatus.Configured,\n };\n }\n return item;\n }),\n selectedConnectorIds: union(selectedConnectorIds, [record.id]), //ID merge deduplicate\n });\n close();\n };\n\n return {\n open: () => {\n setVisible(true);\n const ids = connectorPublishConfig?.[record.id]?.selected_workflows;\n setCheckedList(ids?.map(item => item.workflow_id ?? '') ?? []);\n },\n close,\n node: (\n \n
\n {I18n.t('app_publish_connector_space_mcp_config_dialog_desc')}\n
\n \n
\n {I18n.t('app_publish_connector_space_mcp_config_dialog_desc2')}\n
\n\n \n {I18n.t(\n 'app_publish_connector_space_mcp_config_dialog_hover_wf_constraints',\n )}\n \n }\n >\n \n \n
\n
\n {I18n.t('app_publish_connector_space_mcp_config_dialog_choose_wf')}\n *\n
\n
\n
\n {\n setSearchVal(v);\n }, debounceTimer)}\n />\n
\n\n \n\n
\n {data?.list.length ? (\n {\n setCheckedList(\n e.target.checked\n ? filterPassList?.map(item => item.workflow_id || '') ||\n []\n : [],\n );\n }}\n >\n {I18n.t(\n 'app_publish_connector_space_mcp_config_dialog_filter_all',\n )}\n \n ) : null}\n \n \n {data?.list?.map(option => {\n const mcpOpt = find(option?.check_result, {\n type: CheckType.MCPPublish,\n });\n return (\n \n {mcpOpt?.is_pass ? (\n option.name\n ) : (\n \n {option.name}\n \n )}\n \n );\n })}\n \n\n {/* Loading */}\n {loadingMore && data?.list.length ? (\n
\n \n
\n ) : null}\n\n {/* empty state */}\n {!data?.list.length ? (\n }\n title={I18n.t(\n 'app_publish_connector_space_mcp_config_dialog_no_results_found',\n )}\n />\n ) : null}\n
\n
\n \n \n ),\n };\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type PublishConnectorInfo,\n ConnectorConfigStatus,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { Button } from '@coze-arch/coze-design';\n\nimport { UseMcpConfigModal } from '@/hooks/use-mcp-config-modal';\n\n/** MCP configuration button + pop-up window */\nexport const McpConfigBtn = ({ record }: { record: PublishConnectorInfo }) => {\n const { node, open } = UseMcpConfigModal({ record });\n return (\n {\n e.stopPropagation();\n }}\n >\n {\n open();\n }}\n >\n {record.config_status === ConnectorConfigStatus.Configured\n ? I18n.t('enterprise_sso_seetings_page_desc_button1')\n : I18n.t('bot_publish_action_configure')}\n \n {node}\n \n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useShallow } from 'zustand/react/shallow';\nimport { type PublishConnectorInfo } from '@coze-arch/idl/intelligence_api';\nimport { FormSelect } from '@coze-arch/coze-design';\nimport { IconCozArrowDown } from '@coze-arch/bot-icons';\n\nimport { useProjectPublishStore } from '@/store';\n\ninterface UnionSelectProps {\n record: PublishConnectorInfo;\n}\n\nexport const UnionSelect = ({ record }: UnionSelectProps) => {\n const { connectorUnionMap, unions, setProjectPublishInfo } =\n useProjectPublishStore(\n useShallow(state => ({\n connectorUnionMap: state.connectorUnionMap,\n unions: state.unions,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n const unionId = record.connector_union_id ?? '';\n const unionConnectors = connectorUnionMap[unionId]?.connector_options ?? [];\n const unionOptionList = unionConnectors.map(c => ({\n label: c.show_name,\n value: c.connector_id,\n }));\n\n const onSelectUnion = (selectedId: string) => {\n setProjectPublishInfo({\n unions: {\n ...unions,\n [unionId]: selectedId,\n },\n });\n };\n\n return (\n
e.stopPropagation()}>\n }\n onSelect={(val: unknown) => onSelectUnion(val as string)}\n />\n
\n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type MouseEventHandler } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { type PublishConnectorInfo } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { FormSelect, type optionRenderProps } from '@coze-arch/coze-design';\n\nimport { useProjectPublishStore } from '@/store';\nimport {\n type ChatflowOptionProps,\n useChatflowOptions,\n} from '@/publish-main/hooks/use-chatflow-options';\n\nimport { OptionWithTooltip } from '../option-with-tooltip';\n\nexport interface WebSdkBindProps {\n checked: boolean;\n record: PublishConnectorInfo;\n onClick: MouseEventHandler;\n}\n\nexport function WebSdkBind({ checked, record, onClick }: WebSdkBindProps) {\n const { connectorPublishConfig, setProjectPublishInfo } =\n useProjectPublishStore(\n useShallow(state => ({\n connectorPublishConfig: state.connectorPublishConfig,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n const lastSelectedChatflow =\n connectorPublishConfig?.[record.id]?.selected_workflows?.[0]?.workflow_id;\n\n const { chatflowOptions } = useChatflowOptions();\n\n const handleChatflowSelect = (option: ChatflowOptionProps) => {\n setProjectPublishInfo({\n connectorPublishConfig: {\n ...connectorPublishConfig,\n [record.id]: {\n selected_workflows: [\n {\n workflow_id: option.value,\n workflow_name: option.label,\n },\n ],\n },\n },\n });\n };\n\n const removePublishConfig = () => {\n useProjectPublishStore.getState().setProjectPublishInfoByImmer(draft => {\n const target = draft[record.id];\n if (!target?.selected_workflows) {\n return;\n }\n delete target.selected_workflows;\n });\n };\n\n return (\n
\n (\n \n )}\n // onChange is responsible for handling the logic of data emptying\n // onSelect handles data selection logic\n onChange={values => {\n if (typeof values !== 'undefined') {\n return;\n }\n removePublishConfig();\n }}\n onSelect={(_: unknown, option: unknown) =>\n handleChatflowSelect(option as ChatflowOptionProps)\n }\n rules={[\n {\n required: checked,\n message: I18n.t('project_release_Please_select'),\n },\n // Verify that the selected chatflow exists & & is not disabled\n {\n validator: (_rule: unknown, value: unknown) => {\n if (!checked) {\n return true;\n }\n const selected = chatflowOptions?.find(\n option => option.value === (value as string),\n );\n if (!selected) {\n return new Error(I18n.t('project_release_chatflow3'));\n }\n if (selected.disabled) {\n return new Error(selected.tooltip);\n }\n return true;\n },\n },\n ]}\n />\n
\n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UIPreviewType } from '@coze-arch/idl/product_api';\nimport { type UIOption } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\n\nexport enum DisplayScreen {\n Web = 'web',\n Mobile = 'mobile',\n}\n\nexport interface DisplayScreenOption {\n label: string;\n value: DisplayScreen;\n disabled?: boolean;\n tooltip?: string;\n}\n\nexport function toDisplayScreenOption(uiOption: UIOption): DisplayScreenOption {\n const publicProps = {\n disabled: uiOption.available === false,\n tooltip: uiOption.unavailable_reason,\n };\n if (uiOption.ui_channel === UIPreviewType.Web.toString()) {\n return {\n value: DisplayScreen.Web,\n label: I18n.t('builder_canvas_tools_pc'),\n ...publicProps,\n };\n }\n return {\n value: DisplayScreen.Mobile,\n label: I18n.t('builder_canvas_tools_phone'),\n ...publicProps,\n };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ProductStatus, type EntityInfoData } from '@coze-arch/idl/product_api';\nimport { type UIOption } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { type FileItem } from '@coze-arch/bot-semi/Upload';\n\nimport {\n type DisplayScreen,\n toDisplayScreenOption,\n} from '@/publish-main/utils/display-screen-option';\n\nexport interface TemplateBindInfo {\n title: string;\n cover_uri: string;\n description: string;\n readme: string;\n display_screen: DisplayScreen;\n category_id: string;\n [k: string]: string;\n}\n\nexport interface TemplateForm {\n agreement: boolean;\n name: string;\n covers: Partial[];\n description: string;\n // EditorFullInput plain text form value, only to meet the type requirements, not used in business\n readme_text: string;\n // The editor-kit rich text content that actually needs to be passed to the backend\n readme: string;\n preview_type: DisplayScreen;\n category: string;\n}\n\nfunction stringToDeltaSet(str?: string) {\n if (!str) {\n return '';\n }\n return `{\"0\":{\"ops\":[{\"insert\":\"${str}\\\\n\"}],\"zoneId\":\"0\",\"zoneType\":\"Z\"}}`;\n}\n\nexport function entityInfoToTemplateForm(\n info: EntityInfoData,\n uiOption?: UIOption,\n): Partial {\n const isZh = I18n.language.startsWith('zh');\n const meta = info.meta_info ?? {};\n const form: Partial = {\n // By default, check Agree to the template payment agreement: already on the shelves, or already configured template information (readme is not empty)\n agreement: meta.status !== ProductStatus.NeverListed || meta.readme !== '',\n name: meta.name,\n covers: meta.covers?.map(c => ({\n url: c.url,\n response: c,\n // Supplements other properties of FileItem for form validation\n status: 'success',\n _sizeInvalid: false,\n })),\n description: meta.description?.substring(0, isZh ? 100 : 300),\n readme: meta.readme || stringToDeltaSet(meta.description),\n category: meta.category?.id,\n };\n if (uiOption) {\n form.preview_type = toDisplayScreenOption(uiOption).value;\n }\n return form;\n}\n\nexport function templateFormToBindInfo(form: TemplateForm): TemplateBindInfo {\n return {\n title: form.name,\n cover_uri: form.covers?.[0].response?.uri ?? '',\n description: form.description,\n readme: form.readme,\n display_screen: form.preview_type,\n category_id: form.category ?? '',\n };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AxiosError } from 'axios';\nimport { type UploadProps } from '@coze-arch/coze-design';\nimport { upLoadFile } from '@coze-arch/bot-utils';\nimport { ProductApi } from '@coze-arch/bot-api';\n\nfunction fileToBase64(file: File): Promise {\n return new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = event => {\n const result = event.target?.result;\n if (typeof result === 'string') {\n resolve(result.slice(result.indexOf(',') + 1));\n } else {\n reject(new Error('readAsDataURL failed'));\n }\n };\n fileReader.readAsDataURL(file);\n });\n}\n\nexport const uploadCustomRequest: UploadProps['customRequest'] = async args => {\n const { fileInstance, onProgress, onSuccess, onError } = args;\n try {\n if (!fileInstance) {\n throw new Error('no file to upload');\n }\n const result = await ProductApi.PublicUploadImage(\n { data: await fileToBase64(fileInstance) },\n {\n onUploadProgress: e =>\n onProgress({ total: e.total ?? fileInstance.size, loaded: e.loaded }),\n },\n );\n onSuccess(result.data);\n } catch (e) {\n if (e instanceof AxiosError) {\n onError(e.request);\n } else {\n onError({});\n }\n }\n};\n\nexport const uploadCustomRequestImageX: UploadProps['customRequest'] =\n async args => {\n const { fileInstance, onProgress, onSuccess, onError } = args;\n try {\n if (!fileInstance) {\n throw new Error('no file to upload');\n }\n const uri = await upLoadFile({\n biz: 'store',\n file: fileInstance,\n fileType: 'image',\n getUploadAuthToken: async () => {\n const { data } = await ProductApi.PublicGetImageUploadToken();\n return {\n data: {\n service_id: data?.service_id || '',\n upload_host: data?.upload_host || '',\n auth: {\n current_time: data?.current_time || '',\n expired_time: data?.expired_time || '',\n session_token: data?.session_token || '',\n access_key_id: data?.access_key_id || '',\n secret_access_key: data?.secret_access_key || '',\n },\n },\n };\n },\n getProgress: progress => {\n onProgress({ total: fileInstance.size, loaded: progress });\n },\n });\n const res = await ProductApi.PublicGetImageURL({ uri });\n onSuccess({ uri, url: res.data?.url });\n } catch (e) {\n if (e instanceof AxiosError) {\n onError(e.request);\n } else {\n onError({});\n }\n }\n };\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useRequest } from 'ahooks';\nimport { type ProductEntityType } from '@coze-arch/bot-api/product_api';\nimport { ProductApi } from '@coze-arch/bot-api';\n\nexport interface CategoryOptions {\n label: string;\n value: string;\n}\n\nexport function useProductCategoryOptions(entityType: ProductEntityType) {\n const { data: categoryOptions, loading } = useRequest(async () => {\n const res = await ProductApi.PublicGetProductCategoryList({\n need_empty_category: true,\n entity_type: entityType,\n });\n return res.data?.categories?.map(item => ({\n label: item.name,\n value: item.id,\n })) as CategoryOptions[];\n });\n return { categoryOptions, loading };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AvatarName } from '@coze-studio/components';\nimport { type UserInfo } from '@coze-arch/idl/product_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { IconCozImage } from '@coze-arch/coze-design/icons';\nimport { Image, Typography } from '@coze-arch/coze-design';\n\nexport interface TemplatePreviewCardProps {\n userInfo?: UserInfo;\n cover?: string;\n name?: string;\n description?: string;\n}\n\n// Basically copied packages/studio/template/pages/src/components/template-list-card/index.tsx\nexport function TemplatePreviewCard({\n userInfo,\n cover,\n name,\n description,\n}: TemplatePreviewCardProps) {\n const userLabel = userInfo?.user_label\n ? {\n name: userInfo.user_label.label_name,\n icon: userInfo.user_label.icon_url,\n href: userInfo.user_label.jump_link,\n }\n : undefined;\n\n return (\n
\n
\n }\n />\n
\n\n
\n
\n \n {name ?? I18n.t('project_release_template_info_name')}\n \n
\n\n \n\n
\n \n {description ?? I18n.t('project_release_template_info_desc')}\n \n
\n
\n
\n );\n}\n","\n import API from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n forwardRef,\n useImperativeHandle,\n useRef,\n useState,\n Suspense,\n} from 'react';\n\nimport classNames from 'classnames';\nimport { ProductEntityType, type UserInfo } from '@coze-arch/idl/product_api';\nimport { type PublishConnectorInfo } from '@coze-arch/idl/intelligence_api';\nimport { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';\nimport { typeSafeJSONParse } from '@coze-arch/bot-utils';\nimport { useFlags } from '@coze-arch/bot-flags';\nimport {\n LazyEditorFullInput,\n DeltaSet,\n type DeltaSetOptions,\n type Editor,\n EditorEventType,\n normalizeSchema,\n} from '@coze-common/md-editor-adapter';\nimport { IconCozPlus } from '@coze-arch/coze-design/icons';\nimport {\n type FileItem,\n Form,\n FormInput,\n FormSelect,\n Typography,\n type optionRenderProps,\n} from '@coze-arch/coze-design';\n\nimport {\n uploadCustomRequest,\n uploadCustomRequestImageX,\n} from '@/utils/upload-custom-request';\nimport { toDisplayScreenOption } from '@/publish-main/utils/display-screen-option';\nimport { useProductCategoryOptions } from '@/publish-main/hooks/use-product-category-options';\n\nimport { OptionWithTooltip } from '../../option-with-tooltip';\nimport { type TemplateForm } from './types';\nimport { TemplatePreviewCard } from './template-preview-card';\n\nimport s from './index.module.less';\n\nfunction getRequiredRules(type: I18nKeysNoOptionsType) {\n return [\n {\n required: true,\n message: I18n.t('project_release_template_info_not', {\n template_info_type: I18n.t(type),\n }),\n },\n ];\n}\n\nexport interface TemplateConfigFormRef {\n fillInitialValues: (values: Partial) => void;\n validate: () => Promise | undefined;\n}\n\nexport interface TemplateConfigFormProps {\n record: PublishConnectorInfo;\n userInfo?: UserInfo;\n}\n\nexport const TemplateConfigForm = forwardRef<\n TemplateConfigFormRef,\n TemplateConfigFormProps\n // eslint-disable-next-line @coze-arch/max-line-per-function\n>(({ record, userInfo }, ref) => {\n const [FLAGS] = useFlags();\n // Support soon, so stay tuned.\n const customRequest = FLAGS['bot.studio.project_publish_imagex']\n ? uploadCustomRequestImageX\n : uploadCustomRequest;\n const uiChannelOptions = record.UIOptions?.map(toDisplayScreenOption) ?? [];\n const formRef = useRef>(null);\n const [formValues, setFormValues] = useState>({});\n const editorRef = useRef();\n const onEditorInit = (editor: Editor) => {\n editorRef.current = editor;\n // EditorFullInput's form value is plain text, but here you need to submit editor-kit rich text content\n editor.on(EditorEventType.CONTENT_CHANGE, _ => {\n formRef.current?.formApi?.setValue(\n 'readme',\n JSON.stringify(editor.getContent().deltas),\n );\n });\n };\n const { categoryOptions } = useProductCategoryOptions(\n ProductEntityType.TemplateCommon,\n );\n\n useImperativeHandle(ref, () => ({\n fillInitialValues: values => {\n const formApi = formRef.current?.formApi;\n if (!formApi) {\n return;\n }\n formApi.setValues(values, { isOverride: true });\n const readme = typeSafeJSONParse(values.readme);\n if (readme) {\n editorRef.current?.setContent(\n new DeltaSet(normalizeSchema(readme as DeltaSetOptions)),\n );\n }\n // @ts-expect-error -- values is the TemplateForm type\n Object.keys(values).forEach(key => formApi.setError(key, null));\n },\n validate: () => formRef.current?.formApi?.validate(),\n }));\n\n const isZh = I18n.language.startsWith('zh');\n\n return (\n \n ref={formRef}\n className={classNames('flex gap-[24px]', s['template-form'])}\n onValueChange={values => setFormValues({ ...values })}\n >\n
\n \n \n (value as boolean) === true,\n message: I18n.t('template_buy_paid_agreement_toast'),\n },\n ]}\n >\n \n {I18n.t('template_buy_paid_agreement_action')}\n \n {I18n.t('template_buy_paid_agreement_detail')}\n \n \n \n
\n
\n
\n \n \n (value as FileItem[] | undefined)?.every(\n item => !item._sizeInvalid && item.status === 'success',\n ) === true,\n message: '', // Verify whether the file size meets the limit & & whether the upload was successful, the Upload component will display an error message\n },\n ]}\n >\n \n \n \n \n \n \n (\n \n )}\n fieldClassName=\"w-full\"\n className=\"w-full\"\n rules={getRequiredRules('project_release_template_info_display')}\n />\n \n
\n \n );\n});\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// @File open source version does not support template channel binding for future expansion\nimport { useParams } from 'react-router-dom';\nimport { type MouseEventHandler, useEffect, useRef, useState } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { ProductEntityType, type UserInfo } from '@coze-arch/idl/product_api';\nimport { type PublishConnectorInfo } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { ProductApi } from '@coze-arch/bot-api';\nimport { Button, Modal } from '@coze-arch/coze-design';\n\nimport { useProjectPublishStore } from '@/store';\n\nimport {\n entityInfoToTemplateForm,\n type TemplateForm,\n templateFormToBindInfo,\n} from './types';\nimport {\n TemplateConfigForm,\n type TemplateConfigFormRef,\n} from './template-config-form';\n\ninterface TemplateBindProps {\n record: PublishConnectorInfo;\n onClick: MouseEventHandler;\n}\n\nexport function TemplateBind({\n record,\n onClick: inputOnClick,\n}: TemplateBindProps) {\n const [modalVisible, setModalVisible] = useState(false);\n const [userInfo, setUserInfo] = useState();\n const templateConfigForm = useRef(null);\n const [savedValues, setSavedValues] = useState>();\n\n const { connectors, setProjectPublishInfo } = useProjectPublishStore(\n useShallow(state => ({\n connectors: state.connectors,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n\n const { project_id = '' } = useParams();\n\n // Backfill template configuration\n const fillTemplateFrom = async () => {\n const productInfo = await ProductApi.PublicGetProductEntityInfo({\n entity_id: project_id,\n entity_type: ProductEntityType.ProjectTemplate,\n });\n if (productInfo.data.meta_info?.name) {\n const formValues = entityInfoToTemplateForm(\n productInfo.data,\n record.UIOptions?.find(item => item.available),\n );\n setSavedValues(formValues);\n setProjectPublishInfo({\n templateConfigured: formValues.agreement === true,\n connectors: {\n ...connectors,\n // @ts-expect-error can accept Partial\n [record.id]: templateFormToBindInfo(formValues),\n },\n });\n }\n if (productInfo.data.meta_info?.user_info) {\n setUserInfo(productInfo.data.meta_info.user_info);\n }\n };\n\n useEffect(() => {\n fillTemplateFrom();\n }, []);\n\n const showModal = () => {\n templateConfigForm.current?.fillInitialValues(savedValues ?? {});\n setModalVisible(true);\n };\n const closeModal = () => {\n setModalVisible(false);\n };\n\n const handleSubmit = async () => {\n const formValues = await templateConfigForm.current?.validate();\n if (!formValues) {\n return;\n }\n setSavedValues(formValues);\n setProjectPublishInfo({\n templateConfigured: true,\n connectors: {\n ...connectors,\n [record.id]: templateFormToBindInfo(formValues),\n },\n });\n closeModal();\n };\n\n return (\n \n \n \n \n \n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// @File open source version does not support store channel binding for future expansion\nimport { type MouseEventHandler } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { type PublishConnectorInfo } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { ProductEntityType } from '@coze-arch/bot-api/product_api';\nimport { FormSelect, type optionRenderProps } from '@coze-arch/coze-design';\n\nimport { type StoreBindKey, useProjectPublishStore } from '@/store';\nimport { toDisplayScreenOption } from '@/publish-main/utils/display-screen-option';\nimport { useProductCategoryOptions } from '@/publish-main/hooks/use-product-category-options';\n\nimport { OptionWithTooltip } from '../option-with-tooltip';\n\nexport interface StoreBindProps {\n checked: boolean;\n record: PublishConnectorInfo;\n onClick: MouseEventHandler;\n}\n\nexport const StoreBind = ({\n checked,\n record,\n onClick: inputOnClick,\n}: StoreBindProps) => {\n const { bind_info, id = '', UIOptions } = record;\n const displayScreenOptions = UIOptions?.map(toDisplayScreenOption) ?? [];\n const defaultDisplayScreen = bind_info?.display_screen;\n const { connectors, setProjectPublishInfo } = useProjectPublishStore(\n useShallow(state => ({\n connectors: state.connectors,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n\n const { categoryOptions } = useProductCategoryOptions(ProductEntityType.Bot);\n\n const handleSelect = (key: StoreBindKey, value: string) => {\n setProjectPublishInfo({\n connectors: {\n ...connectors,\n [id]: {\n ...bind_info,\n ...connectors[id],\n [key]: value,\n },\n },\n });\n };\n\n return (\n \n (\n \n )}\n rules={[{ required: checked }]}\n onSelect={(value: unknown) =>\n handleSelect('display_screen', value as string)\n }\n />\n \n handleSelect('category_id', value as string)\n }\n />\n \n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type MouseEventHandler } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport {\n ConnectorBindType,\n type PublishConnectorInfo,\n ConnectorConfigStatus,\n ConnectorStatus,\n} from '@coze-arch/idl/intelligence_api';\nimport { KvBindButton } from '@coze-agent-ide/space-bot/component/connector-action';\nimport { AuthorizeButton } from '@coze-agent-ide/space-bot/component/authorize-button';\n\nimport { TEMPLATE_CONNECTOR_ID } from '@/utils/constants';\n\nimport { useProjectPublishStore } from '../../store';\nimport { useBizConnectorAnchor } from '../../hooks/use-biz-connector-anchor';\nimport { WebSdkBind } from './bind-actions/web-sdk-bind';\nimport { TemplateBind } from './bind-actions/template-bind';\nimport { StoreBind } from './bind-actions/store-bind';\n// import { ApiBind } from './bind-actions/api-bind';\n\ninterface ConnectorActionProps {\n record: PublishConnectorInfo;\n checked: boolean;\n authActionWrapperClassName?: string;\n}\nexport function ConnectorAction(props: ConnectorActionProps) {\n const { record, checked, authActionWrapperClassName } = props;\n\n const { setProjectPublishInfo, connectorList, selectedConnectorIds } =\n useProjectPublishStore(\n useShallow(state => ({\n setProjectPublishInfo: state.setProjectPublishInfo,\n connectorList: state.connectorList,\n selectedConnectorIds: state.selectedConnectorIds,\n })),\n );\n\n const { setAnchor } = useBizConnectorAnchor();\n const stopEventPropagation: MouseEventHandler = mouseEvent => {\n mouseEvent.stopPropagation();\n };\n\n // The bind/unbind is the same callback, which can be distinguished by whether the bind_id is empty or not\n const kvBindSuccessCallback = (value?: PublishConnectorInfo) => {\n if (value) {\n const isUnbind = !value.bind_id;\n const newValue: PublishConnectorInfo = {\n ...value,\n config_status: isUnbind\n ? ConnectorConfigStatus.NotConfigured\n : ConnectorConfigStatus.Configured,\n connector_status: isUnbind\n ? ConnectorStatus.Normal\n : value.connector_status,\n };\n setProjectPublishInfo({\n connectorList: connectorList.map(item =>\n item.id === value.id ? newValue : item,\n ),\n });\n }\n };\n\n const authRevokeSuccess = () => {\n setProjectPublishInfo({\n connectorList: connectorList.map(item => {\n if (item.id === record.id) {\n return {\n ...item,\n config_status: ConnectorConfigStatus.NotConfigured,\n };\n }\n return item;\n }),\n selectedConnectorIds: selectedConnectorIds.filter(\n item => item !== record.id,\n ),\n });\n };\n\n switch (record.bind_type) {\n case ConnectorBindType.KvBind:\n case ConnectorBindType.KvAuthBind:\n return (\n // Force flex row wrap with basis-full\n \n
\n \n
\n \n );\n case ConnectorBindType.AuthBind:\n return (\n \n
\n {\n setAnchor(id);\n }}\n revokeSuccess={authRevokeSuccess}\n authInfo={record?.auth_login_info ?? {}}\n isV2\n v2ButtonProps={{\n color: 'primary',\n size: 'small',\n }}\n />\n
\n \n );\n case ConnectorBindType.WebSDKBind:\n return (\n \n );\n // The open-source version does not support store channel binding for the time being, for future expansion\n case ConnectorBindType.StoreBind:\n return (\n \n );\n // The open-source version does not support template channel binding for future expansion\n // bind_type = 9 is used as the logo of the first-party channel of the button, and the binding method needs to be displayed according to the channel ID.\n // TODO backend updates ConnectorBindType type definition\n case ConnectorBindType.TemplateBind: {\n if (record.id === TEMPLATE_CONNECTOR_ID) {\n return ;\n }\n return null;\n }\n default:\n return null;\n }\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ConnectorBindType,\n ConnectorConfigStatus,\n type PublishConnectorInfo,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { type TagProps } from '@coze-arch/coze-design';\n\ninterface ConfigStatusUI {\n text: string;\n color: TagProps['color'];\n}\n\nexport const getConfigStatus = (\n record: PublishConnectorInfo,\n): ConfigStatusUI => {\n const { bind_type } = record;\n\n if (\n bind_type === ConnectorBindType.KvBind ||\n bind_type === ConnectorBindType.KvAuthBind ||\n bind_type === ConnectorBindType.TemplateBind\n ) {\n return getKvBindStatus(record);\n }\n\n return getDefaultStatus(record);\n};\n\nconst getKvBindStatus = (record: PublishConnectorInfo): ConfigStatusUI => {\n const { config_status = ConnectorConfigStatus.Configured } = record;\n\n const couldPublish = config_status === ConnectorConfigStatus.Configured;\n const color = couldPublish ? 'green' : 'primary';\n\n const textMap = {\n [ConnectorConfigStatus.Configured]: I18n.t(\n 'bot_publish_columns_status_configured',\n ),\n [ConnectorConfigStatus.NotConfigured]: I18n.t(\n 'bot_publish_columns_status_not_configured',\n ),\n // Business will not go to the following 3 cases\n [ConnectorConfigStatus.Configuring]: '',\n [ConnectorConfigStatus.Disconnected]: '',\n [ConnectorConfigStatus.NeedReconfiguring]: '',\n };\n\n return {\n text: textMap[config_status],\n color,\n };\n};\n\nconst getDefaultStatus = (record: PublishConnectorInfo): ConfigStatusUI => {\n const { config_status = ConnectorConfigStatus.Configured } = record;\n const couldPublish = config_status === ConnectorConfigStatus.Configured;\n const color = couldPublish ? 'green' : 'primary';\n\n const textMap = {\n [ConnectorConfigStatus.Configured]: I18n.t(\n 'bot_publish_columns_status_authorized',\n ),\n [ConnectorConfigStatus.NotConfigured]: I18n.t(\n 'bot_publish_columns_status_unauthorized',\n ),\n [ConnectorConfigStatus.Configuring]: I18n.t('publish_douyin_config_ing'),\n [ConnectorConfigStatus.Disconnected]: '',\n [ConnectorConfigStatus.NeedReconfiguring]: '',\n };\n\n return {\n text: textMap[config_status],\n color,\n };\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ConnectorBindType,\n ConnectorClassification,\n ConnectorStatus,\n type PublishConnectorInfo,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { IconCozInfoCircle } from '@coze-arch/coze-design/icons';\nimport { Tag, type TagProps, Tooltip } from '@coze-arch/coze-design';\n\nimport { getConfigStatus } from '../utils/get-config-status';\n\ninterface TipTagProps {\n showText: string;\n tip: string;\n tagProps?: TagProps;\n}\n\nconst TipTag: React.FC = ({ showText, tip, tagProps }) => (\n \n {showText ? (\n \n {showText}\n \n \n ) : (\n \n )}\n \n);\n\n/** Channel categories that need to display configuration status */\nconst Classes = [\n ConnectorClassification.SocialPlatform,\n ConnectorClassification.MiniProgram,\n ConnectorClassification.CozeSpaceExtensionLibrary,\n];\n\nexport const ConfigStatus = ({ record }: { record: PublishConnectorInfo }) => {\n if (\n !Classes.includes(record.connector_classification) ||\n record.bind_type === ConnectorBindType.NoBindRequired\n ) {\n return null;\n }\n\n const { text, color } = getConfigStatus(record);\n\n return (\n
\n {/* configuration status */}\n \n {text}\n \n {record?.connector_status === ConnectorStatus.Normal ? null : (\n \n )}\n
\n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type MouseEventHandler } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { I18n } from '@coze-arch/i18n';\nimport { Button, Modal } from '@coze-arch/coze-design';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { DeveloperApi } from '@coze-arch/bot-api';\nimport { useParams } from 'react-router-dom';\n\nimport { useProjectPublishStore } from '../../../store';\n\ninterface UnbindButtonProps {\n bindId: string;\n checked: boolean;\n connectorId: string;\n className?: string;\n onClick: MouseEventHandler;\n}\n\nconst PROJECT_AGENT_TYPE = 1;\n\n// Unpublish for APIs or WebSDKs\nexport const UndoButton = (props: UnbindButtonProps) => {\n const {\n bindId,\n checked,\n connectorId,\n className,\n onClick: inputOnclick,\n } = props;\n const { space_id = '', project_id = '' } = useParams();\n\n const { setProjectPublishInfo, selectedConnectorIds, connectorList } =\n useProjectPublishStore(\n useShallow(state => ({\n selectedConnectorIds: state.selectedConnectorIds,\n setProjectPublishInfo: state.setProjectPublishInfo,\n connectorList: state.connectorList,\n })),\n );\n\n const handleUnbind: MouseEventHandler = e => {\n inputOnclick(e);\n Modal.confirm({\n title: I18n.t('project_release_cancel1'),\n content: I18n.t('project_release_cancel1_desc'),\n okText: I18n.t('project_release_cancel'),\n okButtonColor: 'red',\n cancelText: I18n.t('Cancel'),\n onOk: async () => {\n await DeveloperApi.UnBindConnector({\n bind_id: bindId,\n agent_type: PROJECT_AGENT_TYPE,\n space_id,\n bot_id: project_id,\n connector_id: connectorId,\n });\n setProjectPublishInfo({\n selectedConnectorIds: selectedConnectorIds.filter(\n id => id !== connectorId,\n ),\n connectorList: connectorList.map(item => {\n if (item.id === connectorId) {\n return {\n ...item,\n bind_id: '',\n };\n }\n return item;\n }),\n });\n },\n });\n };\n return bindId && checked ? (\n \n {I18n.t('project_release_cancel')}\n \n ) : null;\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable complexity */\nimport ReactMarkdown from 'react-markdown';\nimport { type MouseEventHandler, useEffect, useRef } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { useHover } from 'ahooks';\nimport {\n ConnectorBindType,\n ConnectorClassification,\n ConnectorConfigStatus,\n type ConnectorPublishConfig,\n type PublishConnectorInfo,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { Checkbox, Tooltip, Typography } from '@coze-arch/coze-design';\nimport { typeSafeJSONParse } from '@coze-arch/bot-utils';\nimport { type TextProps } from '@coze-arch/bot-semi/Typography';\n\nimport { TEMPLATE_CONNECTOR_ID } from '@/utils/constants';\nimport { useProjectPublishStore } from '@/store';\n\nimport { isStoreBindConfigured } from '../utils/is-store-bind-configured';\nimport { getConnectorNotConfigured } from '../utils/connector-disabled-publish';\nimport { McpConfigBtn } from './mcp-config-btn';\nimport { UnionSelect } from './connector-union-select';\nimport { ConnectorAction } from './connector-action';\nimport { ConfigStatus } from './config-status';\nimport { UndoButton } from './bind-actions/undo-button';\n\nenum DisabledReason {\n /** Chatflow is not selected for social channels. */\n SocialPlatform,\n /** Unbound, Unauthorized */\n NotConfigured,\n /** The reason for the back-end delivery */\n NotAllowed,\n /** No template configured */\n Template,\n}\n\ninterface ConnectorDisabledConfig {\n reason: DisabledReason;\n text?: string;\n}\n\nfunction getConnectorDisabledConfig({\n connector,\n socialPlatformConfig,\n templateConfigured,\n connectorPublishConfig,\n connectorConfigMap,\n}: {\n connector: PublishConnectorInfo;\n socialPlatformConfig: ConnectorPublishConfig | undefined;\n templateConfigured: boolean | undefined;\n connectorPublishConfig: Record;\n connectorConfigMap: Record>;\n}): ConnectorDisabledConfig | undefined {\n if (\n connector.connector_classification ===\n ConnectorClassification.SocialPlatform &&\n !socialPlatformConfig?.selected_workflows?.[0]?.workflow_id\n ) {\n // Post to social channels without Chatflow selected.\n return {\n reason: DisabledReason.SocialPlatform,\n text: I18n.t('project_release_chatflow4'),\n };\n }\n const notConfigured = {\n reason: DisabledReason.NotConfigured,\n text: I18n.t('project_release_set_desc'),\n };\n // Unbound, Unauthorized\n if (getConnectorNotConfigured(connector)) {\n return notConfigured;\n }\n // The reason why it cannot be released after being issued by the backend.\n if (!connector.allow_publish && connector.not_allow_publish_reason) {\n return {\n reason: DisabledReason.NotAllowed,\n text: connector.not_allow_publish_reason,\n };\n }\n // No template configured\n if (connector.id === TEMPLATE_CONNECTOR_ID && !templateConfigured) {\n return {\n reason: DisabledReason.Template,\n text: I18n.t('project_release_template_info'),\n };\n }\n\n const isWebSDK =\n connector.connector_classification === ConnectorClassification.APIOrSDK &&\n connector.bind_type === ConnectorBindType.WebSDKBind;\n\n const isSdkChatFlowConfigured = Boolean(\n connectorPublishConfig[connector.id]?.selected_workflows,\n );\n\n if (isWebSDK && !isSdkChatFlowConfigured) {\n return notConfigured;\n }\n const isStorePublish =\n connector.connector_classification === ConnectorClassification.Coze &&\n connector.bind_type === ConnectorBindType.StoreBind;\n const storeConfig = connectorConfigMap[connector.id];\n if (isStorePublish && (!storeConfig || !isStoreBindConfigured(storeConfig))) {\n return notConfigured;\n }\n}\n\n// Additional descriptive information agreed upon with the backend\ninterface DescriptionExtra {\n // Channel name hover tooltip\n text?: string;\n}\n\nexport interface ConnectorCardProps {\n connectorInfo: PublishConnectorInfo;\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n onShowWebSdkGuide: () => void;\n}\n\n// eslint-disable-next-line @coze-arch/max-line-per-function -- it's complex\nexport function ConnectorCard({\n connectorInfo,\n checked,\n onCheckedChange,\n onShowWebSdkGuide,\n}: ConnectorCardProps) {\n const { id, name, description, bind_id = '' } = connectorInfo;\n\n const {\n templateConfigured,\n socialPlatformChatflow,\n connectorPublishConfig,\n connectors,\n } = useProjectPublishStore(\n useShallow(state => ({\n templateConfigured: state.templateConfigured,\n socialPlatformChatflow: state.socialPlatformChatflow,\n connectorPublishConfig: state.connectorPublishConfig,\n connectors: state.connectors,\n })),\n );\n const divRef = useRef(null);\n const isHover = useHover(divRef.current);\n\n const disabledConfig = getConnectorDisabledConfig({\n connector: connectorInfo,\n socialPlatformConfig: socialPlatformChatflow,\n templateConfigured,\n connectorPublishConfig,\n connectorConfigMap: connectors,\n });\n // The open-source version does not support social platform channels for future expansion.\n // When the social channel does not select \"Process message conversation flow\", the entire card needs to be displayed as disabled.\n const cardDisabled = disabledConfig?.reason === DisabledReason.SocialPlatform;\n\n const descriptionExtra = (typeSafeJSONParse(\n connectorInfo.description_extra,\n ) ?? {}) as DescriptionExtra;\n\n // If the disabled status changes, uncheck the current channel\n useEffect(() => {\n if (checked && disabledConfig) {\n onCheckedChange(false);\n }\n }, [checked, disabledConfig]);\n\n const connectorCheckbox = (\n {\n if (!disabledConfig) {\n onCheckedChange(!checked);\n }\n }}\n data-testid=\"project.publish.select.connector\"\n disabled={Boolean(disabledConfig)}\n />\n );\n const stopEventPropagation: MouseEventHandler = mouseEvent => {\n mouseEvent.stopPropagation();\n };\n\n const getIsShowAction = () => {\n const isConnectorAuth = [\n ConnectorBindType.KvBind,\n ConnectorBindType.KvAuthBind,\n ConnectorBindType.AuthBind,\n ].includes(connectorInfo.bind_type);\n const isConnectorAuthConfigured =\n connectorInfo.config_status === ConnectorConfigStatus.Configured;\n\n if (isConnectorAuth) {\n return (\n !isConnectorAuthConfigured || (isConnectorAuthConfigured && isHover)\n );\n }\n\n return true;\n };\n\n const isShowAction = getIsShowAction();\n\n const connectorCard = (\n {\n if (!disabledConfig) {\n onCheckedChange(!checked);\n }\n }}\n >\n \n
\n \n {descriptionExtra.text ? (\n (\n \n ),\n }}\n >\n {descriptionExtra.text}\n \n }\n >\n
{name}
\n \n ) : (\n
{name}
\n )}\n \n
\n
\n {description ? (\n (\n \n {props.children}\n \n ),\n a: props => {\n const textProps: TextProps =\n props.href === 'coze://web-sdk-guide'\n ? {\n link: true,\n onClick: e => {\n stopEventPropagation(e);\n onShowWebSdkGuide();\n },\n }\n : {\n link: {\n href: props.href,\n target: '_blank',\n onClick: stopEventPropagation,\n },\n };\n return (\n \n {props.children}\n \n );\n },\n }}\n >\n {description}\n \n ) : null}\n
\n
\n {connectorInfo.connector_union_id ? (\n \n ) : null}\n \n {connectorInfo.connector_classification ===\n ConnectorClassification.APIOrSDK ? (\n \n ) : null}\n {/* The open-source version does not support MCP service channels for future expansion */}\n {connectorInfo.connector_classification ===\n ConnectorClassification.CozeSpaceExtensionLibrary &&\n connectorInfo.bind_type === ConnectorBindType.TemplateBind && (\n \n )}\n
\n \n\n
\n {disabledConfig && !cardDisabled ? (\n \n {connectorCheckbox}\n \n ) : (\n connectorCheckbox\n )}\n
\n \n );\n\n return (\n \n {connectorCard}\n \n );\n}\n","\n import API from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useParams } from 'react-router-dom';\nimport { useMemo } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { MonetizePublishInfo } from '@coze-studio/components/monetize';\nimport {\n ConnectorClassification,\n type PublishConnectorInfo,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { PublishTermService } from '@coze-agent-ide/agent-ide-commons';\nimport { IconCozEmpty } from '@coze-arch/coze-design/icons';\nimport { Form } from '@coze-arch/coze-design';\n\nimport { useWebSdkGuideModal } from '@/web-sdk-guide';\nimport { WEB_SDK_CONNECTOR_ID } from '@/utils/constants';\nimport { useProjectPublishStore } from '@/store';\n\nimport { CONNECTOR_TAB_BAR_Z_INDEX } from '../utils/constants';\nimport { usePublishContainer } from '../context/publish-container-context';\nimport { formatConnectorGroups } from './utils/format-connector-groups';\nimport { useConnectorScroll } from './hooks/use-connector-scroll';\nimport { useAutoScrollToConnector } from './hooks/use-auto-scroll-to-connector';\nimport { SocialPlatformChatflow } from './components/social-platform-chatflow';\nimport {\n ConnectorTabbar,\n ConnectorTabbarItem,\n} from './components/connector-tab-bar';\nimport { ConnectorGroupHeader } from './components/connector-group-header';\nimport { ConnectorCard } from './components/connector-card';\n\nimport s from './index.module.less';\n\nconst getTermServiceData = (connectorList: PublishConnectorInfo[]) =>\n connectorList\n .filter(item => item.privacy_policy || item.user_agreement)\n .map(i => ({\n name: i.name,\n icon: i.icon_url,\n privacy_policy: i.privacy_policy,\n user_agreement: i.user_agreement,\n }));\n\n// eslint-disable-next-line @coze-arch/max-line-per-function\nexport function PublishConnectors() {\n const { project_id = '' } = useParams();\n\n const {\n connectorList, // The open-source version only supports API and Chat SDK channels\n connectorUnionMap,\n monetizeConfig,\n selectedConnectorIds,\n connectorPublishConfig,\n unions,\n updateSelectedConnectorIds,\n } = useProjectPublishStore(\n useShallow(state => ({\n connectorList: state.connectorList,\n connectorUnionMap: state.connectorUnionMap,\n monetizeConfig: state.monetizeConfig,\n selectedConnectorIds: state.selectedConnectorIds,\n connectorPublishConfig: state.connectorPublishConfig,\n unions: state.unions,\n updateSelectedConnectorIds: state.updateSelectedConnectorIds,\n })),\n );\n\n const termServiceData = useMemo(\n () => getTermServiceData(connectorList),\n [connectorList],\n );\n\n const connectorGroups = useMemo(\n () =>\n formatConnectorGroups(connectorList, connectorUnionMap, unions).filter(\n item => item.connectors.length > 0,\n ),\n [connectorList, connectorUnionMap, unions],\n );\n const { publishHeaderHeight } = usePublishContainer();\n const {\n connectorRefMap,\n activeConnectorTarget,\n connectorBarRef,\n scrollToConnector,\n closeAnimation,\n animationStateMap,\n } = useConnectorScroll();\n\n useAutoScrollToConnector({\n connectorGroupList: connectorGroups,\n connectorRefMap,\n });\n\n const isConnectorChecked = (c: PublishConnectorInfo) =>\n selectedConnectorIds.includes(c.connector_union_id ?? c.id);\n\n const onCheckConnector = (c: PublishConnectorInfo, checked: boolean) => {\n const id = c.connector_union_id ?? c.id;\n if (checked) {\n updateSelectedConnectorIds(prev => prev.concat(id));\n } else {\n updateSelectedConnectorIds(prev => prev.filter(i => i !== id));\n }\n };\n\n // Collapse Panel does not display the icon of the selected channel in the header when expanded\n const getGroupHeaderList = (groupId: ConnectorClassification) => {\n const group = connectorGroups.find(g => g.type === groupId);\n if (!group) {\n return [];\n }\n return group.connectors.filter(c =>\n selectedConnectorIds.includes(c.connector_union_id ?? c.id),\n );\n };\n\n const { node: guideModal, show: showWebSdkGuide } = useWebSdkGuideModal();\n const onShowWebSdkGuide = () => {\n const sdkConnector = connectorList.find(c => c.id === WEB_SDK_CONNECTOR_ID);\n const sdkConfig = connectorPublishConfig[WEB_SDK_CONNECTOR_ID];\n showWebSdkGuide({\n projectId: project_id,\n workflowId: sdkConfig?.selected_workflows?.[0]?.workflow_id ?? '',\n version: sdkConnector?.bind_info?.sdk_version ?? '',\n });\n };\n\n return (\n
\n
\n \n {I18n.t('bot_publish_select_title')}\n \n {IS_OVERSEA && monetizeConfig ? (\n c.support_monetization)\n .map(c => ({ id: c.id, name: c.name, icon: c.icon_url }))}\n />\n ) : null}\n
\n {termServiceData.length ? (\n \n ) : null}\n \n {connectorGroups.map(connector => (\n scrollToConnector(connector.type)}\n >\n {connector.label}\n \n ))}\n \n {connectorGroups.map((i, index) => {\n // The open-source version does not support social platform channels for the time being\n const isSocialPlatform =\n i.type === ConnectorClassification.SocialPlatform;\n return (\n \n {\n closeAnimation(i.type);\n }}\n />\n {/* The open-source version does not support social platform channels for the time being */}\n {isSocialPlatform ? (\n \n ) : null}\n \n {i.connectors.map(c => (\n onCheckConnector(c, checked)}\n onShowWebSdkGuide={onShowWebSdkGuide}\n />\n ))}\n
\n \n );\n })}\n {!connectorList.length ? (\n
\n \n
\n {I18n.t('publish_page_no_channel_status_title')}\n
\n
\n {I18n.t('publish_page_no_channel_status_desc')}\n
\n
\n ) : null}\n {guideModal}\n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type ConnectorUnionInfo,\n ConnectorClassification,\n type PublishConnectorInfo,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\n\nexport interface ConnectorGroup {\n type: ConnectorClassification;\n label: string;\n desc: string;\n connectors: PublishConnectorInfo[];\n}\n\nexport function formatConnectorGroups(\n connectors: PublishConnectorInfo[],\n unionMap: Record,\n unions: Record,\n) {\n const groups: ConnectorGroup[] = [\n {\n type: ConnectorClassification.APIOrSDK,\n label: I18n.t('project_release_api1'),\n desc: I18n.t('project_release_api_sdk_desc'),\n connectors: [],\n },\n {\n type: ConnectorClassification.MiniProgram,\n label: I18n.t('project_release_miniprogram1'),\n desc: I18n.t('project_release_h5_desc'),\n connectors: [],\n },\n {\n type: ConnectorClassification.SocialPlatform,\n label: I18n.t('project_release_social1'),\n desc: I18n.t('project_release_social_desc1'),\n connectors: [],\n },\n {\n type: ConnectorClassification.Coze,\n label: I18n.t('project_release_coze1'),\n desc: I18n.t('project_release_ts_desc'),\n connectors: [],\n },\n {\n type: ConnectorClassification.CozeSpaceExtensionLibrary,\n label: I18n.t('app_publish_connector_mcp'),\n desc: I18n.t('app_publish_connector_mcp'),\n connectors: [],\n },\n ];\n for (const c of connectors) {\n const group = groups.find(g => g.type === c.connector_classification);\n if (!group) {\n continue;\n }\n if (c.connector_union_id) {\n const unionId = c.connector_union_id;\n // If the current union_id has already been added to the group, skip\n if (group.connectors.some(i => i.connector_union_id === unionId)) {\n continue;\n }\n let connectorInfo = c;\n // Give priority to the connector selected by the union, otherwise take the first one.\n const unionSelection = connectors.find(i => i.id === unions[unionId]);\n if (unionSelection) {\n connectorInfo = unionSelection;\n } else {\n const firstId = unionMap[unionId].connector_options[0].connector_id;\n const firstConnector = connectors.find(i => i.id === firstId);\n if (firstConnector) {\n connectorInfo = firstConnector;\n }\n }\n const unionInfo = unionMap[unionId];\n group.connectors.push({\n ...connectorInfo,\n name: unionInfo.name,\n description: unionInfo.description,\n icon_url: unionInfo.icon_url,\n });\n } else {\n group.connectors.push(c);\n }\n }\n return groups;\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { I18n } from '@coze-arch/i18n';\nimport { intelligenceApi } from '@coze-arch/bot-api';\n\nexport async function checkVersionNum(\n versionNumber: string,\n projectId: string,\n) {\n if (!versionNumber) {\n return I18n.t('project_release_example2');\n }\n const { data } = await intelligenceApi.CheckProjectVersionNumber({\n project_id: projectId,\n version_number: versionNumber,\n });\n\n if (data?.is_duplicate) {\n return I18n.t('project_release_example3');\n } else {\n return '';\n }\n}\n","\n import API from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type CSSProperties, useEffect, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\nimport {\n type CommonFieldProps,\n Input,\n TextArea,\n type TextAreaProps,\n withField,\n} from '@coze-arch/coze-design';\n\nimport styles from './index.module.less';\n\nexport interface VersionDescInputProps\n extends Pick<\n TextAreaProps,\n 'placeholder' | 'maxLength' | 'maxCount' | 'wrapperClassName' | 'value'\n > {\n onChange?: (value: string) => void;\n inputClassName?: string;\n textAreaClassName?: string;\n textAreaStyle?: CSSProperties;\n}\n\nconst VersionDescInput: React.FC = ({\n inputClassName,\n textAreaClassName,\n wrapperClassName,\n textAreaStyle,\n ...props\n}) => {\n const [mode, setMode] = useState<'input' | 'textarea'>('input');\n const textAreaRef = useRef(null);\n\n useEffect(() => {\n const target = textAreaRef.current;\n if (mode !== 'textarea' || !target) {\n return;\n }\n const valueLength = props.value?.length;\n target.focus();\n if (!valueLength) {\n return;\n }\n target.setSelectionRange(valueLength, valueLength);\n }, [mode]);\n\n if (mode === 'input') {\n return (\n {\n setMode('textarea');\n }}\n />\n );\n }\n\n return (\n
\n {\n setMode('input');\n }}\n />\n
\n );\n};\n\nexport const FormVersionDescInput: React.FC<\n CommonFieldProps & VersionDescInputProps\n> = withField(VersionDescInput);\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useShallow } from 'zustand/react/shallow';\nimport classNames from 'classnames';\nimport { I18n } from '@coze-arch/i18n';\nimport { Form } from '@coze-arch/coze-design';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { useParams } from 'react-router-dom';\n\nimport { CONNECTOR_TAB_BAR_Z_INDEX } from '../utils/constants';\nimport { useProjectPublishStore } from '../store';\nimport { checkVersionNum } from './utils/version-number-check';\nimport { FormVersionDescInput } from './components/version-desc-input';\n\nexport function PublishBasicInfo() {\n const { project_id = '' } = useParams();\n const {\n lastVersionNumber,\n versionNumber,\n versionDescription,\n setProjectPublishInfo,\n } = useProjectPublishStore(\n useShallow(state => ({\n lastVersionNumber: state.lastVersionNumber,\n versionNumber: state.versionNumber,\n versionDescription: state.versionDescription,\n setProjectPublishInfo: state.setProjectPublishInfo,\n })),\n );\n\n const inputBaseCls = '';\n\n return (\n
\n
\n {I18n.t('project_release_version_info')}\n
\n
\n \n {I18n.t('builder_publish_version_label')}\n \n }\n placeholder={\n lastVersionNumber\n ? I18n.t('project_release_example1', {\n version: lastVersionNumber,\n })\n : I18n.t('project_release_example')\n }\n initValue={versionNumber}\n className=\"bg-transparent coz-stroke-plus\"\n rules={[\n { required: true, message: I18n.t('project_release_example2') },\n ]}\n onChange={value => {\n setProjectPublishInfo({\n versionNumber: value,\n });\n }}\n validate={val => checkVersionNum(val, project_id)}\n trigger={'blur'}\n maxLength={20}\n />\n \n {I18n.t('builder_publish_changelog_label')}\n \n }\n placeholder={I18n.t('builder_publish_changelog_placeholder')}\n initValue={versionDescription}\n maxLength={800}\n maxCount={800}\n wrapperClassName=\"relative overflow-visible\"\n inputClassName={inputBaseCls}\n textAreaClassName={classNames(\n inputBaseCls,\n 'absolute',\n 'top-0',\n 'left-0',\n '!coz-bg-max',\n )}\n // It is higher than the channel tab to avoid occlusion.\n textAreaStyle={{ zIndex: CONNECTOR_TAB_BAR_Z_INDEX + 1 }}\n onChange={value => {\n setProjectPublishInfo({\n versionDescription: value,\n });\n }}\n />\n
\n
\n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type PropsWithChildren, useRef, useState } from 'react';\n\nimport { DEFAULT_PUBLISH_HEADER_HEIGHT } from '../../../utils/constants';\nimport { PublishContainerContext } from '../../../context/publish-container-context';\n\nexport const PublishContainer: React.FC = ({ children }) => {\n const ref = useRef(null);\n const [publishHeaderHeight, setPublishHeaderHeight] = useState(\n DEFAULT_PUBLISH_HEADER_HEIGHT,\n );\n\n const getContainerRef = () => ref;\n\n return (\n \n \n {children}\n \n \n );\n};\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect } from 'react';\n\nimport { useShallow } from 'zustand/react/shallow';\nimport { useErrorHandler } from '@coze-arch/logger';\nimport { Form, Spin } from '@coze-arch/coze-design';\nimport { type DynamicParams } from '@coze-arch/bot-typings/teamspace';\nimport { useParams } from 'react-router-dom';\n\nimport { useProjectPublishStore } from '../store';\nimport {\n loadProjectPublishDraft,\n saveProjectPublishDraft,\n} from './utils/publish-draft';\nimport { initPublishStore } from './utils/init-publish-store';\nimport { PublishTitleBar } from './publish-title-bar';\nimport { PublishRecord } from './publish-record';\nimport { PublishConnectors } from './publish-connectors';\nimport { PublishBasicInfo } from './publish-basic-info';\nimport { PublishContainer } from './components/publish-container';\n\nimport s from './index.module.less';\n\nexport function ProjectPublish(): JSX.Element {\n const { project_id = '', space_id = '' } = useParams();\n const {\n showPublishResult,\n pageLoading,\n resetProjectPublishInfo,\n exportDraft,\n } = useProjectPublishStore(\n useShallow(state => ({\n showPublishResult: state.showPublishResult,\n pageLoading: state.pageLoading,\n resetProjectPublishInfo: state.resetProjectPublishInfo,\n exportDraft: state.exportDraft,\n })),\n );\n const errorHandle = useErrorHandler();\n\n useEffect(() => {\n const saveDraft = () => {\n saveProjectPublishDraft(exportDraft(project_id));\n };\n window.addEventListener('beforeunload', saveDraft);\n return () => {\n window.removeEventListener('beforeunload', saveDraft);\n };\n }, [exportDraft, project_id]);\n\n useEffect(() => {\n initPublishStore(\n project_id,\n errorHandle,\n loadProjectPublishDraft(project_id),\n );\n return () => {\n resetProjectPublishInfo();\n };\n }, []);\n\n return !pageLoading ? (\n \n >\n className={s.project}\n showValidateIcon={false}\n >\n \n {!showPublishResult ? (\n
\n
\n \n \n
\n
\n ) : (\n \n )}\n \n
\n ) : (\n \n );\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect, useState } from 'react';\n\nimport { useRequest } from 'ahooks';\nimport {\n ConnectorPublishStatus,\n PublishRecordStatus,\n type PublishRecordDetail,\n} from '@coze-arch/idl/intelligence_api';\nimport { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';\nimport {\n IconCozCheckMarkCircle,\n IconCozClock,\n IconCozCrossCircle,\n} from '@coze-arch/coze-design/icons';\nimport { Modal, Select, Tag, type TagProps } from '@coze-arch/coze-design';\nimport { type OptionProps } from '@coze-arch/bot-semi/Select';\nimport { intelligenceApi } from '@coze-arch/bot-api';\nimport { EProjectPermission, useProjectAuth } from '@coze-common/auth';\n\nimport { isPublishFinish } from '../utils/is-publish-finish';\nimport { ProjectPublishProgress } from '../publish-progress';\n\nenum PublishStatus {\n Publishing,\n Failed,\n Success,\n}\n\nconst PublishStatusMap: Record<\n PublishStatus,\n Pick & { text: I18nKeysNoOptionsType }\n> = {\n [PublishStatus.Publishing]: {\n prefixIcon: ,\n color: 'brand',\n text: 'project_releasing',\n },\n [PublishStatus.Failed]: {\n prefixIcon: ,\n color: 'red',\n text: 'project_release_failed',\n },\n [PublishStatus.Success]: {\n prefixIcon: ,\n color: 'green',\n text: 'project_release_success',\n },\n};\n\nfunction toPublishStatus(record: PublishRecordDetail) {\n const projectFailed =\n record.publish_status === PublishRecordStatus.PackFailed ||\n record.publish_status === PublishRecordStatus.AuditNotPass;\n const connectorsFailed =\n record.connector_publish_result?.some(\n item => item.connector_publish_status === ConnectorPublishStatus.Failed,\n ) ?? false;\n // The project itself failed, or some channels failed to publish - > overall failed\n if (projectFailed || connectorsFailed) {\n return PublishStatus.Failed;\n }\n const projectPublishing =\n record.publish_status === PublishRecordStatus.Packing ||\n record.publish_status === PublishRecordStatus.Auditing ||\n record.publish_status === PublishRecordStatus.ConnectorPublishing;\n const connectorsPublishing =\n record.connector_publish_result?.some(\n item =>\n item.connector_publish_status === ConnectorPublishStatus.Default ||\n item.connector_publish_status === ConnectorPublishStatus.Auditing,\n ) ?? false;\n // The project itself is being released, or some channels are being released - > the overall release is in progress\n if (projectPublishing || connectorsPublishing) {\n return PublishStatus.Publishing;\n }\n return PublishStatus.Success;\n}\n\nexport interface ProjectPublishStatusProps {\n spaceId: string;\n projectId: string;\n defaultRecordID?: string;\n}\n\n/* eslint @coze-arch/max-line-per-function: [\"error\", {\"max\": 300}] */\nexport function usePublishStatus({\n spaceId,\n projectId,\n defaultRecordID,\n}: ProjectPublishStatusProps) {\n const [status, setStatus] = useState();\n const [latestRecord, setLatestRecord] = useState();\n const [recordList, setRecordList] = useState([]);\n const [selectedVersion, setSelectedVersion] = useState(defaultRecordID);\n const [selectedRecord, setSelectedRecord] = useState();\n\n const [modalVisible, setModalVisible] = useState(false);\n\n // Polling the latest release history until it stops when it is not in the \"In Release\" state\n const latestRecordRequest = useRequest(\n () => intelligenceApi.GetPublishRecordDetail({ project_id: projectId }),\n {\n manual: true,\n pollingInterval: 5000,\n pollingWhenHidden: false,\n pollingErrorRetryCount: 3,\n onSuccess: res => {\n const record = res.data;\n // Stop polling when no record is published\n if (!record || typeof record.publish_status !== 'number') {\n latestRecordRequest.cancel();\n return;\n }\n setStatus(toPublishStatus(record));\n setLatestRecord(record);\n // After first requesting the latest release record, its version number is selected by default\n if (!selectedVersion) {\n setRecordList([\n { value: record.publish_record_id, label: record.version_number },\n ]);\n setSelectedVersion(record.publish_record_id ?? '');\n } else if (selectedVersion === record.publish_record_id) {\n setSelectedRecord(record);\n }\n if (isPublishFinish(record)) {\n latestRecordRequest.cancel();\n }\n },\n },\n );\n\n // Get a list of publication records\n const recordListRequest = useRequest(\n () => intelligenceApi.GetPublishRecordList({ project_id: projectId }),\n {\n manual: true,\n onSuccess: res => {\n setRecordList(\n res.data?.map(item => ({\n value: item.publish_record_id,\n label: item.version_number,\n })) ?? [],\n );\n },\n },\n );\n\n const hasPermission = useProjectAuth(\n EProjectPermission.PUBLISH,\n projectId,\n spaceId,\n );\n\n // When the user has \"publish\" permission, start polling\n useEffect(() => {\n if (!hasPermission || defaultRecordID) {\n return;\n }\n latestRecordRequest.run();\n }, [hasPermission, defaultRecordID]);\n\n // Manually request selected release records\n const recordDetailRequest = useRequest(\n (recordId: string) =>\n intelligenceApi.GetPublishRecordDetail({\n project_id: projectId,\n publish_record_id: recordId,\n }),\n {\n manual: true,\n onSuccess: res => {\n const record = res.data;\n setSelectedRecord(record);\n if (record?.publish_record_id === latestRecord?.publish_record_id) {\n setLatestRecord(record);\n }\n },\n },\n );\n\n const tagConfig = PublishStatusMap[status ?? PublishStatus.Failed];\n const showingRecord = selectedRecord ?? latestRecord;\n\n const open = async () => {\n await recordListRequest.runAsync();\n if (defaultRecordID) {\n await changeVersion(defaultRecordID);\n }\n setModalVisible(true);\n };\n\n const close = () => {\n setModalVisible(false);\n };\n\n const changeVersion = async (version: string) => {\n setSelectedVersion(version);\n await recordDetailRequest.run(version);\n };\n\n return {\n latestVersion: latestRecord,\n currentVersion: recordList.find(item => item.value === selectedVersion),\n\n open,\n\n close,\n\n modal: (\n setModalVisible(false)}\n >\n
\n {\n if (typeof version === 'string') {\n changeVersion(version);\n }\n }}\n />\n {showingRecord ? (\n \n ) : null}\n
\n \n ),\n tag: (\n 1 will cause its height to be larger than the Tag itself\n className=\"flex !px-[3px] font-medium\"\n >\n {I18n.t(tagConfig.text)}\n \n ),\n };\n}\n","/*\n * Copyright 2025 coze-dev Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable complexity */\n/* eslint-disable react-hooks/exhaustive-deps */\nimport { useNavigate } from 'react-router-dom';\nimport React, { type ReactNode, useCallback } from 'react';\n\nimport { useIsPublishRecordReady } from '@coze-studio/publish-manage-hooks';\nimport {\n useProjectAuth,\n EProjectPermission,\n useProjectRole,\n} from '@coze-common/auth';\nimport { IntelligenceType } from '@coze-arch/idl/intelligence_api';\nimport { I18n } from '@coze-arch/i18n';\nimport {\n IconCozAnalytics,\n IconCozArrowDown,\n IconCozArrowRight,\n IconCozDocument,\n IconCozLongArrowTopRight,\n IconCozTrigger,\n} from '@coze-arch/coze-design/icons';\nimport {\n Button,\n Divider,\n IconButton,\n Menu,\n Popover,\n Tooltip,\n} from '@coze-arch/coze-design';\nimport { useFlags } from '@coze-arch/bot-flags';\n\nimport { usePublishStatus } from '../hooks/use-publish-status';\nimport { useBizConnectorAnchor } from '../hooks/use-biz-connector-anchor';\n\nconst isLocalDevMode = () => {\n const searchParams = new URLSearchParams(location.search);\n return searchParams.has('devBlock');\n};\n\n/* eslint @coze-arch/max-line-per-function: [\"error\", {\"max\": 300}] */\nexport const PublishButton = ({\n spaceId,\n projectId,\n hasPublished,\n}: {\n spaceId: string;\n projectId: string;\n hasPublished: boolean;\n}) => {\n const navigate = useNavigate();\n\n const { modal, tag, latestVersion, open } = usePublishStatus({\n spaceId,\n projectId,\n });\n\n const hasPublishPermission = useProjectAuth(\n EProjectPermission.PUBLISH,\n projectId,\n spaceId,\n );\n const { removeAnchor } = useBizConnectorAnchor();\n\n const handlePublish = useCallback(() => {\n removeAnchor();\n navigate(`/space/${spaceId}/project-ide/${projectId}/publish`);\n }, [spaceId, projectId, removeAnchor]);\n\n const projectRoles = useProjectRole(projectId);\n\n const [FLAGS] = useFlags();\n\n const { ready, inited } = useIsPublishRecordReady({\n type: IntelligenceType.Project,\n intelligenceId: projectId,\n spaceId,\n enable: !!(\n // Support soon, so stay tuned.\n (\n FLAGS['bot.studio.publish_management'] &&\n hasPublished &&\n projectRoles.length &&\n !IS_OPEN_SOURCE\n )\n ),\n });\n\n const menuAnalysis = (\n {\n navigate(`/space/${spaceId}/publish/app/${projectId}?tab=analysis`);\n }}\n text={I18n.t('analytics_page_title')}\n prefix={\n \n }\n />\n );\n\n const menuLogs = (\n {\n navigate(`/space/${spaceId}/publish/app/${projectId}?tab=logs`);\n }}\n text={I18n.t('release_management_trace')}\n prefix={\n \n }\n />\n );\n\n const menuTriggers = (\n {\n navigate(`/space/${spaceId}/publish/app/${projectId}?tab=triggers`);\n }}\n text={I18n.t('release_management_trigger')}\n prefix={\n \n }\n />\n );\n\n if (!hasPublishPermission) {\n return null;\n }\n\n if (!hasPublished) {\n return (\n \n {I18n.t('project_ide_frame_publish')}\n \n );\n }\n\n return (\n <>\n {modal}\n \n {latestVersion?.version_number ? (\n open()}\n >\n \n {`${I18n.t('app_ide_publish_modal_recent_publication')} ${\n latestVersion?.version_number\n }`}\n \n {tag}\n }\n color=\"secondary\"\n />\n \n ) : null}\n\n
\n \n
\n\n {/* Support soon, so stay tuned. */}\n {FLAGS['bot.studio.publish_management'] && !IS_OPEN_SOURCE ? (\n
\n
\n {I18n.t('app_ide_publish_modal_publish_management')}\n
\n \n {ready || !inited ? (\n menuAnalysis\n ) : (\n \n
{menuAnalysis}
\n \n )}\n {ready || !inited ? (\n menuLogs\n ) : (\n \n
{menuLogs}
\n \n )}\n {ready || !inited ? (\n menuTriggers\n ) : (\n \n
{menuTriggers}
\n \n )}\n
\n
\n ) : null}\n\n
\n \n {I18n.t('app_ide_publish_modal_publish_button')}\n \n
\n \n }\n >\n \n \n \n );\n};\n\nconst MenuItem = ({\n prefix,\n text,\n onClick,\n disabled,\n}: {\n prefix?: ReactNode;\n text?: string;\n onClick?: () => void;\n disabled?: boolean;\n}) => (\n \n
\n {prefix}\n {text}\n \n
\n \n);\n","\n import API from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[10].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[10].use[2]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[10].use[3]!../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+plugin-less@1.1.1_@rsbuild+core@1.1.13/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[10].use[4]!./index.module.less\";\n export default content && content.locals ? content.locals : undefined;\n","import * as React from \"react\";\nconst SvgDiffEmpty = props => ;\nexport { SvgDiffEmpty as ReactComponent };\nexport default \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04LjMzMzk4IDIuOTk5OTJDOC4zMzM5OCAxLjUyNzE2IDkuNTI3ODkgMC4zMzMyNTIgMTEuMDAwNyAwLjMzMzI1MkgyNy4wMDA2QzI4LjQ3MzQgMC4zMzMyNTIgMjkuNjY3MyAxLjUyNzE2IDI5LjY2NzMgMi45OTk5MlYxOC45OTk5QzI5LjY2NzMgMjAuNDcyNyAyOC40NzM0IDIxLjY2NjYgMjcuMDAwNiAyMS42NjY2SDIxLjY2NzNWMjYuOTk5OUMyMS42NjczIDI4LjQ3MjcgMjAuNDczNCAyOS42NjY2IDE5LjAwMDcgMjkuNjY2NkgzLjAwMDY1QzEuNTI3ODkgMjkuNjY2NiAwLjMzMzk4NCAyOC40NzI3IDAuMzMzOTg0IDI2Ljk5OTlWMTAuOTk5OUMwLjMzMzk4NCA5LjUyNzE2IDEuNTI3ODkgOC4zMzMyNSAzLjAwMDY1IDguMzMzMjVIOC4zMzM5OFYyLjk5OTkyWk04LjMzMzk4IDEwLjk5OTlIMy4wMDA2NVYyNi45OTk5SDE5LjAwMDdWMjEuNjY2NkgxMS4wMDA3QzkuNTI3ODkgMjEuNjY2NiA4LjMzMzk4IDIwLjQ3MjcgOC4zMzM5OCAxOC45OTk5VjEwLjk5OTlaTTE5LjAwMDcgMTguOTk5OUgxMS4wMDA3VjEwLjk5OTlIMTkuMDAwN1YxOC45OTk5Wk0yMS42NjczIDE4Ljk5OTlWMTAuOTk5OUMyMS42NjczIDkuNTI3MTYgMjAuNDczNCA4LjMzMzI1IDE5LjAwMDcgOC4zMzMyNUgxMS4wMDA3VjIuOTk5OTJIMjcuMDAwNlYxOC45OTk5SDIxLjY2NzNaIiBmaWxsPSIjMUQxQzIzIiBmaWxsLW9wYWNpdHk9IjAuMzUiLz4KPC9zdmc+Cg==\";","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.editor-container-JPBTxq{height:100%;position:relative}.editor-VinOIJ{background-color:#fff;border:1px solid rgba(29,28,35,.12);border-radius:8px;height:100%;padding:0}.editor-VinOIJ .monaco-editor .scroll-decoration{box-shadow:unset}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"editor-container\": `editor-container-JPBTxq`,\n\t\"editorContainer\": `editor-container-JPBTxq`,\n\t\"editor\": `editor-VinOIJ`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.multiline-text-GVNO_v{word-break:break-word;white-space:pre-wrap}.multiline-container-uIOXgz{flex:1;grid-template-columns:100px 36px 100px;display:grid;overflow:hidden}.editor-container-YQ76sR{border:1px solid var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));border-radius:8px;min-height:400px;margin-top:20px;overflow:hidden}.editor-header-rVNsYI{border-bottom:1px solid var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));width:100%;display:flex}.editor-title-TtUkQu{color:var(--Fg-COZ-fg-primary,rgba(6,7,9,.8));flex:1;padding:12px;font-size:14px;font-weight:500;overflow:hidden}.editor-divider-sAapKP{width:1px;height:46px;color:var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1))}.editor-cj3RsF{background-color:transparent;min-height:400px;max-height:600px}.editor-cj3RsF .monaco-editor-background{background-color:#f9f9f9!important}.editor-cj3RsF .monaco-editor .vertical{box-shadow:0 0 0 0 var(--guide-color)inset!important}.editor-cj3RsF .margin{background-color:#f9f9f9!important}.editor-cj3RsF .monaco-diff-editor.side-by-side .editor.modified{border-left:1px solid var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));box-shadow:none!important}.editor-cj3RsF .mtk1{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.6))}.editor-cj3RsF .margin-view-overlays .line-numbers{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3));width:24px!important}.editor-cj3RsF .monaco-editor .diagonal-fill{background-size:8px 8px;background-image:linear-gradient(-45deg,rgba(34,34,34,.1) 12.5%,transparent 12.5%,transparent 50%,rgba(34,34,34,.1) 50%,rgba(34,34,34,.1) 62.5%,transparent 62.5%,transparent 100%)!important}.editor-cj3RsF .margin-view-overlays:after{pointer-events:none;background:var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));width:1px;position:absolute;top:0;bottom:0;right:3px;content:\" \"!important}.editor-cj3RsF .line-numbers.active-line-number{color:var(--Fg-COZ-fg-primary,rgba(6,7,9,.8))!important}.editor-cj3RsF .monaco-editor .delete-sign{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3))!important;font-size:8px!important;font-weight:900!important;left:29px!important}.editor-cj3RsF .monaco-editor .insert-sign{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3))!important;font-size:8px!important;font-weight:900!important;left:29px!important}.editor-cj3RsF .monaco-editor .view-overlays .current-line{border:0!important}.editor-cj3RsF .monaco-scrollable-element>.scrollbar>.slider{background:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3));border-radius:3px;width:8px!important}.editor-cj3RsF .decorationsOverviewRuler{display:none!important}.editor-cj3RsF .modified .slider{left:6px!important}.editor-cj3RsF .modified .presentation{width:12px!important;right:-4px!important}.editor-cj3RsF .original .slider{left:6px!important}.editor-cj3RsF .original .presentation{width:12px!important;left:3px!important}.editor-cj3RsF .gutter-insert{background-color:var(--vscode-diffEditor-insertedLineBackground,var(--vscode-diffEditor-insertedTextBackground))!important}.editor-cj3RsF .gutter-delete{background-color:var(--vscode-diffEditor-removedLineBackground,var(--vscode-diffEditor-removedTextBackground))!important}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"multiline-text\": `multiline-text-GVNO_v`,\n\t\"multilineText\": `multiline-text-GVNO_v`,\n\t\"multiline-container\": `multiline-container-uIOXgz`,\n\t\"multilineContainer\": `multiline-container-uIOXgz`,\n\t\"editor-container\": `editor-container-YQ76sR`,\n\t\"editorContainer\": `editor-container-YQ76sR`,\n\t\"editor-header\": `editor-header-rVNsYI`,\n\t\"editorHeader\": `editor-header-rVNsYI`,\n\t\"editor-title\": `editor-title-TtUkQu`,\n\t\"editorTitle\": `editor-title-TtUkQu`,\n\t\"editor-divider\": `editor-divider-sAapKP`,\n\t\"editorDivider\": `editor-divider-sAapKP`,\n\t\"editor\": `editor-cj3RsF`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.list-utyqSJ{padding:.75rem 0 .75rem .75rem}.list-utyqSJ .semi-list-item-body-header{flex:1;width:0;overflow:hidden}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"list\": `list-utyqSJ`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.error-container-_IyY_2 .error-link-Pq2VWp .error-link-underline-EVkAXO{color:var(--semi-color-danger);max-width:200px;margin-left:2px;font-size:14px;text-decoration:underline}.error-container-_IyY_2 .error-link-Pq2VWp .error-link-underline-EVkAXO a{color:var(--semi-color-danger)}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"error-container\": `error-container-_IyY_2`,\n\t\"errorContainer\": `error-container-_IyY_2`,\n\t\"error-link\": `error-link-Pq2VWp`,\n\t\"errorLink\": `error-link-Pq2VWp`,\n\t\"error-link-underline\": `error-link-underline-EVkAXO`,\n\t\"errorLinkUnderline\": `error-link-underline-EVkAXO`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.disable-field-jMLuez{padding:12px 0 24px}.disable-field-jMLuez .title-s26PF2{margin-bottom:8px;font-size:14px;font-weight:600}.input-XYeEI3.input-XYeEI3{padding-top:4px}.input-XYeEI3 .semi-input-suffix{cursor:pointer;padding:8px}.link-button-tWRlPA.link-button-tWRlPA.link-button-tWRlPA{background-color:transparent}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"disable-field\": `disable-field-jMLuez`,\n\t\"disableField\": `disable-field-jMLuez`,\n\t\"title\": `title-s26PF2`,\n\t\"input\": `input-XYeEI3`,\n\t\"link-button\": `link-button-tWRlPA`,\n\t\"linkButton\": `link-button-tWRlPA`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.step-order-La7ARW{background:var(--light-color-brand-brand-5,#4d53e8);width:16px;height:16px;color:var(--light-color-white-white,#fff);border-radius:50%;justify-content:center;align-items:center;margin-top:2px;font-size:10px;font-weight:600;display:flex}.step-title-vWRtVL{color:#000;margin-bottom:8px;font-size:14px;font-weight:600;line-height:22px}.markdown-qLZ0zo{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"step-order\": `step-order-La7ARW`,\n\t\"stepOrder\": `step-order-La7ARW`,\n\t\"step-title\": `step-title-vWRtVL`,\n\t\"stepTitle\": `step-title-vWRtVL`,\n\t\"markdown\": `markdown-qLZ0zo`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.start-text-pXfZ2p{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}.config-link-HEiJGW{color:var(--light-color-brand-brand-5,#4d53e8);font-size:12px;line-height:16px}.markdown-PFR8kZ{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}.guide-XLqN5c{margin-bottom:32px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"start-text\": `start-text-pXfZ2p`,\n\t\"startText\": `start-text-pXfZ2p`,\n\t\"config-link\": `config-link-HEiJGW`,\n\t\"configLink\": `config-link-HEiJGW`,\n\t\"markdown\": `markdown-PFR8kZ`,\n\t\"guide\": `guide-XLqN5c`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.step-order-kS8rzB{background:var(--light-color-brand-brand-5,#4d53e8);width:16px;height:16px;color:var(--light-color-white-white,#fff);border-radius:50%;justify-content:center;align-items:center;margin-top:2px;font-size:10px;font-weight:600;display:flex}.step-title-fbaFcC{color:#000;margin-bottom:8px;font-size:14px;font-weight:600;line-height:22px}.markdown-ihOOii{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}.link-area-yqpTLT .link-list-hCIt6h{margin-top:16px}.link-area-yqpTLT .link-list-hCIt6h .title-HQq6si{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;font-weight:600;line-height:22px}.link-area-yqpTLT .link-list-hCIt6h .link-zMA1OB{word-break:break-word}.link-area-yqpTLT .link-list-hCIt6h .semi-form-field-error-message-ig2k1h{position:absolute}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"step-order\": `step-order-kS8rzB`,\n\t\"stepOrder\": `step-order-kS8rzB`,\n\t\"step-title\": `step-title-fbaFcC`,\n\t\"stepTitle\": `step-title-fbaFcC`,\n\t\"markdown\": `markdown-ihOOii`,\n\t\"link-area\": `link-area-yqpTLT`,\n\t\"linkArea\": `link-area-yqpTLT`,\n\t\"link-list\": `link-list-hCIt6h`,\n\t\"linkList\": `link-list-hCIt6h`,\n\t\"title\": `title-HQq6si`,\n\t\"link\": `link-zMA1OB`,\n\t\"semi-form-field-error-message\": `semi-form-field-error-message-ig2k1h`,\n\t\"semiFormFieldErrorMessage\": `semi-form-field-error-message-ig2k1h`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.info-title-hM03fu{margin-bottom:8px;font-size:16px;font-weight:600}.info-subtitle-xJLDxa{margin-top:12px;margin-bottom:8px;font-size:14px;font-weight:500}.container-LF_kv1{width:100%;height:100%}.diff-table-tF4K3Z{margin-bottom:24px}.diff-table-tF4K3Z .semi-table-row-head{border-bottom:1px solid var(--semi-color-border);font-size:12px;background-color:rgba(46,46,56,.04)!important;padding:4px 8px!important}.diff-table-tF4K3Z .semi-table-row-cell{font-size:12px;padding:10px 8px!important}.cell-span-H_nQzL{word-break:break-word;font-weight:400;font-size:12px!important}.property-tooltip-ji9W4V{word-break:break-word}.empty-container-YLcORh{flex-direction:column;justify-content:center;align-items:center;height:100%;min-height:200px;display:flex}.empty-info-q193R7{margin-top:4px}.list-BE2Xcy{border-radius:8px;border:1px solid var(--Stroke-COZ-stroke-plus,rgba(6,7,9,.15))!important;background-color:#fff!important}.list-BE2Xcy .semi-list-item{border-bottom:1px solid var(--Stroke-COZ-stroke-plus,rgba(6,7,9,.15))!important}.list-BE2Xcy .semi-list-item:last-child{border-bottom:none!important}.list-item-vLj8Sw{grid-template-columns:280px 120px 1fr;align-items:center;display:grid}.tag-1-aqUUN6{color:#3ec254;background-color:#d2f3d5}.tag-2-CdvW0P,.tag-4-MC5w82{color:#ff441e;background-color:#ffe0d2}.tag-3-KTmcm_{color:#ff9600;background-color:#fff1cc}.property-title-Tuf6E1{color:var(--Fg-COZ-fg-primary,rgba(6,7,9,.8));font-size:12px;font-weight:500}.info-block-s33QB0:not(:first-child){margin-top:24px}.mask-U3tgbz{pointer-events:none;background:linear-gradient(to top,rgba(var(--coze-bg-2),1)0,rgba(var(--coze-bg-2),0)100%);width:100%;height:32px;position:absolute;bottom:80px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"info-title\": `info-title-hM03fu`,\n\t\"infoTitle\": `info-title-hM03fu`,\n\t\"info-subtitle\": `info-subtitle-xJLDxa`,\n\t\"infoSubtitle\": `info-subtitle-xJLDxa`,\n\t\"container\": `container-LF_kv1`,\n\t\"diff-table\": `diff-table-tF4K3Z`,\n\t\"diffTable\": `diff-table-tF4K3Z`,\n\t\"cell-span\": `cell-span-H_nQzL`,\n\t\"cellSpan\": `cell-span-H_nQzL`,\n\t\"property-tooltip\": `property-tooltip-ji9W4V`,\n\t\"propertyTooltip\": `property-tooltip-ji9W4V`,\n\t\"empty-container\": `empty-container-YLcORh`,\n\t\"emptyContainer\": `empty-container-YLcORh`,\n\t\"empty-info\": `empty-info-q193R7`,\n\t\"emptyInfo\": `empty-info-q193R7`,\n\t\"list\": `list-BE2Xcy`,\n\t\"list-item\": `list-item-vLj8Sw`,\n\t\"listItem\": `list-item-vLj8Sw`,\n\t\"tag-1\": `tag-1-aqUUN6`,\n\t\"tag1\": `tag-1-aqUUN6`,\n\t\"tag-2\": `tag-2-CdvW0P`,\n\t\"tag2\": `tag-2-CdvW0P`,\n\t\"tag-4\": `tag-4-MC5w82`,\n\t\"tag4\": `tag-4-MC5w82`,\n\t\"tag-3\": `tag-3-KTmcm_`,\n\t\"tag3\": `tag-3-KTmcm_`,\n\t\"property-title\": `property-title-Tuf6E1`,\n\t\"propertyTitle\": `property-title-Tuf6E1`,\n\t\"info-block\": `info-block-s33QB0`,\n\t\"infoBlock\": `info-block-s33QB0`,\n\t\"mask\": `mask-U3tgbz`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.resource-group-YhQutA .resource-group-header-dQYzYW{cursor:pointer;justify-content:space-between;align-items:center;height:36px;padding:0 14px 0 17px;display:flex}.resource-group-YhQutA .resource-group-header-dQYzYW .header-left-PI8WU3{align-items:center;gap:4px;display:flex}.resource-group-YhQutA .resource-group-header-dQYzYW .header-title-m6jh2J{font-size:14px;font-weight:500;line-height:20px}.resource-group-YhQutA .resource-group-header-dQYzYW .action-group-wHBVve{align-items:center;gap:2px;display:flex}.resource-group-YhQutA .resource-group-content-s59UBy{padding:0 6px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"resource-group\": `resource-group-YhQutA`,\n\t\"resourceGroup\": `resource-group-YhQutA`,\n\t\"resource-group-header\": `resource-group-header-dQYzYW`,\n\t\"resourceGroupHeader\": `resource-group-header-dQYzYW`,\n\t\"header-left\": `header-left-PI8WU3`,\n\t\"headerLeft\": `header-left-PI8WU3`,\n\t\"header-title\": `header-title-m6jh2J`,\n\t\"headerTitle\": `header-title-m6jh2J`,\n\t\"action-group\": `action-group-wHBVve`,\n\t\"actionGroup\": `action-group-wHBVve`,\n\t\"resource-group-content\": `resource-group-content-s59UBy`,\n\t\"resourceGroupContent\": `resource-group-content-s59UBy`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.resource-list-UL45IN{width:100%;height:100%}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .item-is-selected{background-color:var(--coz-mg-primary)}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .item-is-selected:hover{background-color:var(--coz-mg-secondary-hovered)}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .item-is-temp-selected.item-is-selected{background-color:var(--coz-mg-primary)}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .base-item-hover-class:hover{background-color:var(--coz-mg-secondary-hovered)}.shortcut-lk6Mtn{color:var(--coz-fg-dim);font-family:Inter,sans-serif;font-size:12px;font-weight:700}.file-list-wrapper-EnRR5A{border:1px solid var(--coz-stroke-primary);border-radius:var(--coze-8);max-height:124px;margin-top:4px;overflow:auto}.file-list-wrapper-EnRR5A::-webkit-scrollbar{background:0 0;width:0;height:10px}.file-list-wrapper-EnRR5A::-webkit-scrollbar:hover{background:0 0}.file-list-wrapper-EnRR5A::-webkit-scrollbar-thumb{background:0 0}.file-list-wrapper-EnRR5A::-webkit-scrollbar-corner{background:0 0}.file-list-Ve2P05{flex-direction:column;align-items:flex-start;padding:6px 0;display:flex}.file-list-Ve2P05 .file-item-pzkzjD{text-overflow:ellipsis;white-space:nowrap;width:100%;height:22px;padding:0 8px;overflow:hidden}.file-list-Ve2P05 .file-item-pzkzjD .file-icon-n_bTZZ{color:var(--coz-fg-secondary);margin-right:4px;position:relative;top:2px}.file-list-Ve2P05 .file-item-pzkzjD .file-name-Ijw7og{color:var(--coz-fg-primary);font-size:14px}.empty-RIYl2e{flex-direction:column;justify-content:center;align-items:center;gap:12px;width:232px;height:80px;margin:0 auto;display:flex}.empty-RIYl2e .empty-card-gahwex{background-color:var(--coz-bg-max);border-radius:var(--coze-4);border:.5px solid #f0f0f0;flex-direction:row;justify-content:flex-start;align-items:center;gap:4px;padding:4.5px;display:flex}.empty-RIYl2e .empty-icon-TXAZwQ{background-color:var(--coz-mg-primary);border-radius:var(--coze-3);width:15px;height:15px}.empty-RIYl2e .empty-skeleton-DONg5h{opacity:.12;flex-direction:column;align-items:flex-start;gap:2.5px;display:flex}.empty-RIYl2e .empty-skeleton-DONg5h span{background-color:var(--coz-fg-secondary);border-radius:var(--coze-2);height:4.5px}.empty-RIYl2e .empty-skeleton-DONg5h span:first-child{width:20px}.empty-RIYl2e .empty-skeleton-DONg5h span:last-child{width:33px}.empty-RIYl2e .empty-title-NilH4m{color:var(--coz-fg-dim);font-size:12px;font-weight:400;line-height:16px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"resource-list\": `resource-list-UL45IN`,\n\t\"resourceList\": `resource-list-UL45IN`,\n\t\"resource-folder-coze\": `resource-folder-coze-XUy3TX`,\n\t\"resourceFolderCoze\": `resource-folder-coze-XUy3TX`,\n\t\"shortcut\": `shortcut-lk6Mtn`,\n\t\"file-list-wrapper\": `file-list-wrapper-EnRR5A`,\n\t\"fileListWrapper\": `file-list-wrapper-EnRR5A`,\n\t\"file-list\": `file-list-Ve2P05`,\n\t\"fileList\": `file-list-Ve2P05`,\n\t\"file-item\": `file-item-pzkzjD`,\n\t\"fileItem\": `file-item-pzkzjD`,\n\t\"file-icon\": `file-icon-n_bTZZ`,\n\t\"fileIcon\": `file-icon-n_bTZZ`,\n\t\"file-name\": `file-name-Ijw7og`,\n\t\"fileName\": `file-name-Ijw7og`,\n\t\"empty\": `empty-RIYl2e`,\n\t\"empty-card\": `empty-card-gahwex`,\n\t\"emptyCard\": `empty-card-gahwex`,\n\t\"empty-icon\": `empty-icon-TXAZwQ`,\n\t\"emptyIcon\": `empty-icon-TXAZwQ`,\n\t\"empty-skeleton\": `empty-skeleton-DONg5h`,\n\t\"emptySkeleton\": `empty-skeleton-DONg5h`,\n\t\"empty-title\": `empty-title-NilH4m`,\n\t\"emptyTitle\": `empty-title-NilH4m`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.resource-list-wrapper-mXc1nd{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%}.resource-list-wrapper-mXc1nd .resource-list-custom-event-wrapper{width:100%;height:100%}.resource-list-wrapper-mXc1nd .resource-list-scroll-container{height:100%;overflow-x:hidden;overflow-y:auto}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper{height:100%}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-wrapper{border-radius:4px;position:relative}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-wrapper .item-wrapper-indent-line{border-left-style:solid;border-left-width:1px;transition:all .2s ease-in-out;position:absolute}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-hover-class:hover{background-color:rgba(6,7,9,.08)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-is-temp-selected{background-color:rgba(6,7,9,.04);border-radius:0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-is-in-edit{background-color:rgba(6,7,9,.04)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-is-selected{background-color:rgba(6,7,9,.14)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .dragging-hover-class{background-color:rgba(148,152,247,.44);border-radius:0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item{align-items:center;width:100%;padding-right:8px;transition:all .1s ease-in-out;display:flex}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-icon{align-items:center;margin-right:4px;display:flex}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input{align-items:center;width:100%;display:flex;position:relative}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input .semi-input-wrapper{border-radius:6px;height:20px;line-height:20px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input .semi-input-wrapper-focus{background-color:#fff}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input [class~=semi-input]{height:20px;padding:0 4px;line-height:20px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input .base-item-name-input-error-msg-absolute{z-index:999;color:rgba(6,7,9,.5);background-color:#fff1f2;border:1px solid #f22435;border-radius:6px;align-items:center;width:100%;padding:2px 4px;font-size:12px;font-weight:700;line-height:16px;display:flex;position:absolute;top:26px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input-error [class~=semi-input-wrapper]{border-color:#f22435}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-more-hover-display-class{display:none}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item:hover .base-item-more-hover-display-class{display:flex}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-more-btn{color:rgba(6,7,9,.96);background-color:transparent;justify-content:center;align-items:center;width:16px;min-width:16px;height:16px;padding-left:0;padding-right:0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-more-btn:hover{background-color:rgba(6,7,9,.14)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-more-btn svg{width:12px;height:12px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-radius-class-first{border-radius:4px 4px 0 0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-radius-class-last{border-radius:0 0 4px 4px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-radius-class-single{border-radius:4px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"resource-list-wrapper\": `resource-list-wrapper-mXc1nd`,\n\t\"resourceListWrapper\": `resource-list-wrapper-mXc1nd`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.config-container-_jKhXq{background:var(--coz-bg-max);border:1px solid var(--coz-stroke-primary);border-top:none;border-radius:0 0 8px 8px;width:100%;height:100%;overflow:hidden}.config-container-_jKhXq .primary-sidebar-header-GIDj0H{justify-content:space-between;align-items:center;width:100%;padding:0 14px;font-size:14px;line-height:20px;display:flex}.config-container-_jKhXq .primary-sidebar-header-GIDj0H .title-FeuhvF{color:var(--coz-fg-plus);font-weight:500}.config-container-_jKhXq .item-WJQ3kG{color:var(--coz-fg-primary);border-radius:8px;align-items:center;margin:0 8px;padding:4px 8px 4px 20px;font-size:14px;line-height:1.5;display:flex}.config-container-_jKhXq .item-WJQ3kG:hover,.config-container-_jKhXq .item-WJQ3kG.activate-uBUYqB{cursor:pointer;color:var(--coz-fg-plus);background-color:var(--coz-mg-primary)}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"config-container\": `config-container-_jKhXq`,\n\t\"configContainer\": `config-container-_jKhXq`,\n\t\"primary-sidebar-header\": `primary-sidebar-header-GIDj0H`,\n\t\"primarySidebarHeader\": `primary-sidebar-header-GIDj0H`,\n\t\"title\": `title-FeuhvF`,\n\t\"item\": `item-WJQ3kG`,\n\t\"activate\": `activate-uBUYqB`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.global-loading-orDTkw{background:var(--coz-bg-max);justify-content:center;align-items:center;width:100%;height:100vh;display:flex;position:fixed;top:0;left:0}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"global-loading\": `global-loading-orDTkw`,\n\t\"globalLoading\": `global-loading-orDTkw`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.content-ixXohr{color:var(--coz-fg-secondary);margin-top:4px;font-size:14px;line-height:20px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"content\": `content-ixXohr`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.content-bHOPf6{color:var(--coz-fg-secondary);margin-top:4px;font-size:14px;line-height:20px}.content-bHOPf6 .error-container-_Y28mV{white-space:pre-wrap;flex-direction:column;flex:1 0 0;justify-content:center;align-items:center;gap:22px;margin:24px 0 22px;display:flex}.content-bHOPf6 .description-container-NlI420{text-align:center;flex-direction:column;justify-content:center;align-items:center;margin:28px 0 12px;display:flex}.content-bHOPf6 .description-container-NlI420 .spin-oAh06F{margin-bottom:12px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"content\": `content-bHOPf6`,\n\t\"error-container\": `error-container-_Y28mV`,\n\t\"errorContainer\": `error-container-_Y28mV`,\n\t\"description-container\": `description-container-NlI420`,\n\t\"descriptionContainer\": `description-container-NlI420`,\n\t\"spin\": `spin-oAh06F`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.primary-sidebar-HKe_Js{background:var(--coz-bg-max);border:1px solid var(--coz-stroke-primary);border-bottom:none;border-radius:8px 8px 0 0;width:100%;height:100%;overflow:hidden}.primary-sidebar-header-LcvDBK{justify-content:space-between;align-items:center;width:100%;padding:0 14px;font-size:14px;line-height:20px;display:flex}.primary-sidebar-header-LcvDBK .title-ugz3Nx{color:var(--coz-fg-plus);font-weight:500}.resource-list-wrapper-JlJNdV{overflow-y:auto}.resource-list-wrapper-JlJNdV::-webkit-scrollbar{background:0 0;width:0;height:10px}.resource-list-wrapper-JlJNdV::-webkit-scrollbar:hover{background:0 0}.resource-list-wrapper-JlJNdV::-webkit-scrollbar-thumb{background:0 0}.resource-list-wrapper-JlJNdV::-webkit-scrollbar-corner{background:0 0}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"primary-sidebar\": `primary-sidebar-HKe_Js`,\n\t\"primarySidebar\": `primary-sidebar-HKe_Js`,\n\t\"primary-sidebar-header\": `primary-sidebar-header-LcvDBK`,\n\t\"primarySidebarHeader\": `primary-sidebar-header-LcvDBK`,\n\t\"title\": `title-ugz3Nx`,\n\t\"resource-list-wrapper\": `resource-list-wrapper-JlJNdV`,\n\t\"resourceListWrapper\": `resource-list-wrapper-JlJNdV`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.icon-button-rjXhPW{margin-right:6px}.icon-button-rjXhPW.icon-button-rjXhPW.icon-button-rjXhPW{background-color:var(--coz-bg-max)}.icon-button-rjXhPW.icon-button-rjXhPW.icon-button-rjXhPW:hover{background-color:var(--coz-bg-6)}.icon-button-rjXhPW.icon-button-rjXhPW.icon-button-rjXhPW:active{background-color:var(--coz-bg-8)}.sidebar-wrapper-sSaaGq{width:282px;height:calc(100vh - 114px)}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"icon-button\": `icon-button-rjXhPW`,\n\t\"iconButton\": `icon-button-rjXhPW`,\n\t\"sidebar-wrapper\": `sidebar-wrapper-sSaaGq`,\n\t\"sidebarWrapper\": `sidebar-wrapper-sSaaGq`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.full-screen-button-ZxxIiN{border:1px solid var(--coz-stroke-primary);justify-content:center;align-items:center;display:flex}.shortcut-tE6S6S{justify-content:space-between;align-items:center;display:flex}.shortcut-tE6S6S .label-bhLPgL{font-size:14px;line-height:20px}.shortcut-tE6S6S .keybinding-jC_YMY{color:var(--coz-fg-dim);font-weight:700}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"full-screen-button\": `full-screen-button-ZxxIiN`,\n\t\"fullScreenButton\": `full-screen-button-ZxxIiN`,\n\t\"shortcut\": `shortcut-tE6S6S`,\n\t\"label\": `label-bhLPgL`,\n\t\"keybinding\": `keybinding-jC_YMY`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.project-info-lhSc0J{align-items:center;display:flex}.project-info-lhSc0J .title-kATuFD{color:var(--coz-fg-plus);margin:0 4px 0 8px;font-size:16px;font-weight:500;line-height:22px}.project-info-lhSc0J .check-icon-IOuXVa{background-color:#fff;border-radius:50%;justify-content:center;align-items:center;width:16px;height:16px;display:flex;position:absolute;top:31px;left:54px}.icon-xLquXQ.icon-xLquXQ.icon-xLquXQ{background-color:var(--coz-bg-plus)}.icon-xLquXQ.icon-xLquXQ.icon-xLquXQ:hover{background-color:var(--coz-bg-6)}.icon-xLquXQ.icon-xLquXQ.icon-xLquXQ:active{background-color:var(--coz-bg-8)}.content-ViYH65{flex-direction:column;justify-content:center;align-items:center;min-width:252px;max-width:320px;padding:16px;display:flex}.content-ViYH65 .title-kATuFD{word-break:break-all;margin:16px 0 2px;font-size:16px;font-weight:500;line-height:22px}.content-ViYH65 .description-OERQCC{word-break:break-all;font-size:14px;line-height:20px}.content-ViYH65 .tag-container-dngyT5{-moz-column-gap:4px;column-gap:4px;margin-top:8px;font-weight:500;display:flex}.content-ViYH65 .tag-container-dngyT5 .tag-daM42A{padding:2px 6px}.content-ViYH65 .owner-container-mJpSns{-moz-column-gap:4px;color:var(--coz-fg-secondary);align-items:center;column-gap:4px;margin-top:24px;font-size:12px;display:flex}.content-ViYH65 .time-IOV6xS{color:var(--coz-fg-secondary);word-break:break-all;margin-top:6px;font-size:12px;line-height:16px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"project-info\": `project-info-lhSc0J`,\n\t\"projectInfo\": `project-info-lhSc0J`,\n\t\"title\": `title-kATuFD`,\n\t\"check-icon\": `check-icon-IOuXVa`,\n\t\"checkIcon\": `check-icon-IOuXVa`,\n\t\"icon\": `icon-xLquXQ`,\n\t\"content\": `content-ViYH65`,\n\t\"description\": `description-OERQCC`,\n\t\"tag-container\": `tag-container-dngyT5`,\n\t\"tagContainer\": `tag-container-dngyT5`,\n\t\"tag\": `tag-daM42A`,\n\t\"owner-container\": `owner-container-mJpSns`,\n\t\"ownerContainer\": `owner-container-mJpSns`,\n\t\"time\": `time-IOV6xS`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.container-bkmzif{width:100%;height:100%;height:-moz-fit-content;flex-direction:column;height:fit-content;display:flex}.container-bkmzif .banner-a1qDt3{justify-content:center;align-items:center;width:100%;height:36px;display:flex}.top-bar-PkNJU7{align-items:center;width:100%;height:56px;display:flex}.top-bar-PkNJU7 .left-col-JvoTh0{-moz-column-gap:4px;align-items:center;column-gap:4px;height:100%;padding-left:4px;display:flex}.top-bar-PkNJU7 .middle-col-Xvqg6n{justify-content:center;align-items:center;height:100%;display:flex}.top-bar-PkNJU7 .right-col-bh6Ml1{-moz-column-gap:8px;justify-content:flex-end;align-items:center;column-gap:8px;height:100%;display:flex}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"container\": `container-bkmzif`,\n\t\"banner\": `banner-a1qDt3`,\n\t\"top-bar\": `top-bar-PkNJU7`,\n\t\"topBar\": `top-bar-PkNJU7`,\n\t\"left-col\": `left-col-JvoTh0`,\n\t\"leftCol\": `left-col-JvoTh0`,\n\t\"middle-col\": `middle-col-Xvqg6n`,\n\t\"middleCol\": `middle-col-Xvqg6n`,\n\t\"right-col\": `right-col-bh6Ml1`,\n\t\"rightCol\": `right-col-bh6Ml1`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.shortcut-item-yQPPVF{justify-content:space-between;align-items:center;margin-bottom:8px;display:flex}.shortcut-item-yQPPVF .label-R4NN_Y{font-size:14px;font-weight:500;line-height:20px}.shortcut-item-yQPPVF .keybinding-iByntU{display:flex}.shortcut-item-yQPPVF .keybinding-iByntU .keybinding-block-x6N_fk{min-width:20px;height:20px;color:var(--coz-fg-secondary);background:var(--coz-mg-primary);border:.5px solid var(--coz-stroke-primary);border-radius:4px;justify-content:center;align-items:center;margin-left:6px;font-family:SF Pro Text,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:9px;font-weight:800;display:flex}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"shortcut-item\": `shortcut-item-yQPPVF`,\n\t\"shortcutItem\": `shortcut-item-yQPPVF`,\n\t\"label\": `label-R4NN_Y`,\n\t\"keybinding\": `keybinding-iByntU`,\n\t\"keybinding-block\": `keybinding-block-x6N_fk`,\n\t\"keybindingBlock\": `keybinding-block-x6N_fk`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.default-container-diUeCI{background:rgba(0,0,0,.03);flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.default-container-diUeCI img{pointer-events:none}.default-container-diUeCI .title-DpF6rw{font-size:28px;font-weight:700;line-height:36px}.default-container-diUeCI .sub-title-LLGSdG{color:var(--coz-fg-secondary,rgba(6,7,9,.5));margin-bottom:40px;font-size:14px;line-height:20px}.default-container-diUeCI .gallery-ZgGwgK{justify-content:center;gap:12px;width:100%;display:flex}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH{cursor:pointer;flex-direction:column;width:320px;display:flex}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .gallery-image-D9NPd3{border:1px solid var(--coz-stroke-primary);border-radius:12px;flex-shrink:0}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .gallery-title-hOnIe8{font-size:16px;font-weight:500;font-weight:22px;margin:12px 0 8px}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .gallery-description-Vyu9aR{font-size:14px;font-weight:20px;color:var(--coz-fg-secondary,rgba(6,7,9,.05))}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .doc-search-i1EWnU{visibility:hidden;margin-top:12px}.default-container-diUeCI .gallery-block-zSgEFH:hover>.doc-search-i1EWnU{visibility:visible}.default-container-diUeCI .item-WeupOT{cursor:pointer;background-color:var(--coz-bg-max);border:1px solid var(--coz-stroke-primary);border-radius:8px;justify-content:space-between;align-items:center;width:320px;height:48px;margin-bottom:16px;padding:8px 12px 8px 8px;display:flex}.default-container-diUeCI .item-WeupOT:hover{background-color:var(--coz-bg-6)}.default-container-diUeCI .item-WeupOT:active{background-color:var(--coz-bg-8)}.default-container-diUeCI .item-WeupOT .item-pre-xa2oun{align-items:center;display:flex}.default-container-diUeCI .item-WeupOT .item-text-RDDB7K{margin-left:8px;font-size:14px;font-weight:500;line-height:20px}.default-container-diUeCI .icon-expand-nkgAqW{position:absolute;top:6px;left:8px}.default-container-diUeCI .full-screen-A096_5{position:absolute;top:6px;right:8px}.default-container-diUeCI .shortcuts-list-tL2iMa{flex-direction:column;width:320px;margin-top:48px;display:flex}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"default-container\": `default-container-diUeCI`,\n\t\"defaultContainer\": `default-container-diUeCI`,\n\t\"title\": `title-DpF6rw`,\n\t\"sub-title\": `sub-title-LLGSdG`,\n\t\"subTitle\": `sub-title-LLGSdG`,\n\t\"gallery\": `gallery-ZgGwgK`,\n\t\"gallery-block\": `gallery-block-zSgEFH`,\n\t\"galleryBlock\": `gallery-block-zSgEFH`,\n\t\"gallery-image\": `gallery-image-D9NPd3`,\n\t\"galleryImage\": `gallery-image-D9NPd3`,\n\t\"gallery-title\": `gallery-title-hOnIe8`,\n\t\"galleryTitle\": `gallery-title-hOnIe8`,\n\t\"gallery-description\": `gallery-description-Vyu9aR`,\n\t\"galleryDescription\": `gallery-description-Vyu9aR`,\n\t\"doc-search\": `doc-search-i1EWnU`,\n\t\"docSearch\": `doc-search-i1EWnU`,\n\t\"item\": `item-WeupOT`,\n\t\"item-pre\": `item-pre-xa2oun`,\n\t\"itemPre\": `item-pre-xa2oun`,\n\t\"item-text\": `item-text-RDDB7K`,\n\t\"itemText\": `item-text-RDDB7K`,\n\t\"icon-expand\": `icon-expand-nkgAqW`,\n\t\"iconExpand\": `icon-expand-nkgAqW`,\n\t\"full-screen\": `full-screen-A096_5`,\n\t\"fullScreen\": `full-screen-A096_5`,\n\t\"shortcuts-list\": `shortcuts-list-tL2iMa`,\n\t\"shortcutsList\": `shortcuts-list-tL2iMa`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.title-container-yiq3lB{margin:0 8px}.widget-title-lxpZLH{justify-content:space-between;align-items:center;display:flex}.widget-title-lxpZLH .semi-spin.coz-loading-wrapper{line-height:0}.title-label-IGa1w0{-moz-column-gap:8px;flex-grow:1;flex-shrink:1;align-items:center;column-gap:8px;width:0;display:flex}.label-icon-Lq44hT{align-items:center;display:flex}.label-text-DGsQEw{flex-grow:1;flex-shrink:1;width:0;line-height:20px}.close-icon-hwNTjH{cursor:pointer;align-items:center;display:flex}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"title-container\": `title-container-yiq3lB`,\n\t\"titleContainer\": `title-container-yiq3lB`,\n\t\"widget-title\": `widget-title-lxpZLH`,\n\t\"widgetTitle\": `widget-title-lxpZLH`,\n\t\"title-label\": `title-label-IGa1w0`,\n\t\"titleLabel\": `title-label-IGa1w0`,\n\t\"label-icon\": `label-icon-Lq44hT`,\n\t\"labelIcon\": `label-icon-Lq44hT`,\n\t\"label-text\": `label-text-DGsQEw`,\n\t\"labelText\": `label-text-DGsQEw`,\n\t\"close-icon\": `close-icon-hwNTjH`,\n\t\"closeIcon\": `close-icon-hwNTjH`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `body{overscroll-behavior:none;background:var(--coz-bg-primary)}.flowide-container{padding:0 8px 8px;background:var(--coz-bg-primary)!important}.flowide-container .gedit-playground{background-color:transparent!important}.flowide-container .project-ide-workflow-playground{background-color:rgba(0,0,0,.03)!important}.flowide-container #flowide-top-bar{background:var(--coz-bg-primary)!important;border-bottom:none!important;min-height:56px!important}.flowide-container #flowide-main-panel{border-radius:8px;background:var(--coz-bg-primary)!important}.flowide-container #flowide-secondary-sidebar{min-width:250px;max-width:250px;background:var(--coz-bg-primary)!important;border:none!important}.flowide-container .lm-DockPanel-widget{border-radius:0 0 8px 8px;min-width:360px!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar{background:var(--coz-bg-primary)!important;border:none!important;width:268px!important;min-width:268px!important;max-width:500px!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-child{min-height:44px}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle{border-right:1px solid var(--coz-stroke-primary);border-left:1px solid var(--coz-stroke-primary);transition:transform .2s ease-in-out;background:linear-gradient(to right,white 6px,var(--coz-stroke-primary)6px,var(--coz-stroke-primary)calc(100% - 6px),white calc(100% - 6px))!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle:after{margin-right:6px;min-height:4px!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle:hover:after,.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle:active:after{background:linear-gradient(to right,white 6px,var(--coz-stroke-hglt)6px,var(--coz-stroke-hglt)calc(100% - 6px),white calc(100% - 6px))!important}.flowide-container .lm-TabBar{padding:6px 8px;background:rgba(0,0,0,.03)!important;border-radius:8px 8px 0 0!important;height:44px!important;min-height:44px!important;max-height:44px!important}.flowide-container .lm-DockPanel-overlay{background:rgba(148,152,247,.16);border:none;border-radius:0 0 8px 8px;margin-top:44px}.flowide-container .lm-DockPanel-handle{opacity:0;transition:opacity .35s ease-out;background:0 0!important}.flowide-container .lm-DockPanel-handle:hover,.flowide-container .lm-DockPanel-handle:active{opacity:1;background:linear-gradient(to right,var(--coz-bg-plus)0,var(--coz-bg-plus)1px,var(--coz-stroke-hglt)1px,var(--coz-stroke-hglt)5px,var(--coz-bg-plus)5px)!important}.flowide-container .lm-TabBar-tab{border-radius:6px;position:relative;min-height:32px!important;max-height:32px!important;margin:0 4px!important;padding:0!important;overflow:visible!important}.flowide-container .lm-TabBar-tab:not(:first-child):after{content:\"\";background:var(--coz-stroke-primary);width:1px;height:16px;position:absolute;top:8px;left:-4px}.flowide-container .lm-TabBar-tab.lm-mod-current .flowide-container .lm-TabBar-tab:not(:first-child):after,.flowide-container .lm-TabBar-tab.lm-mod-current+.lm-TabBar-tab:not(:first-child):after,.flowide-container .lm-TabBar-tab:hover:after,.flowide-container .lm-TabBar-tab:hover+.lm-TabBar-tab:after,.flowide-container .lm-TabBar-tab .lm-TabBar-tabCloseIcon{display:none}.flowide-container .lm-TabBar-tab:hover:not(.lm-mod-current){background:var(--coz-mg-secondary-hovered)}.flowide-container .lm-TabBar-tab.lm-mod-current:before,.flowide-container .lm-TabBar-tab.lm-mod-current:after{display:none!important}.flowide-container .lm-TabBar-tab.lm-mod-current span{font-weight:500!important}.flowide-container .lm-TabBar-tabIcon{width:100%;display:block}.lm-mod-drag-image{border-radius:6px;position:relative;min-height:32px!important;max-height:32px!important;margin:0 4px!important;padding:0!important;overflow:visible!important}.lm-mod-drag-image .flow-tab-icon-label{align-items:center;width:100%;display:flex;overflow:hidden}.lm-mod-drag-image .flow-tab-icon-label .flow-TabBar-tabLabel-text{text-overflow:ellipsis;word-break:keep-all;white-space:nowrap;overflow:hidden}.lm-mod-drag-image .flow-tab-icon-label span{font-weight:500!important}.lm-mod-drag-image .flow-tab-icon-label .lm-TabBar-tabIcon{width:100%;display:block}.flow-tab-icon-label{cursor:pointer!important}.flow-Menu .flow-Menu-item .flow-Menu-itemLabel{font-size:14px;line-height:20px}.flow-Menu .flow-Menu-item .flow-Menu-itemShortcut{color:var(--coz-fg-dim);letter-spacing:1.2px;font-weight:700}.flow-Menu .flow-Menu-item[role~=menuitem]{min-height:32px!important}.flow-Menu .flow-Menu-item[role~=presentation]{background-color:var(--coz-stroke-primary);margin:4px 0;height:1px!important}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.template-form-kind2m .editor-container-v9qzn_{border:1px solid rgba(var(--coze-stroke-6),var(--coze-stroke-6-alpha))}.template-form-kind2m .editor-container-v9qzn_:focus-within{border-color:var(--semi-color-focus-border)}.template-form-kind2m .semi-form-field{padding-top:0}.template-form-kind2m .semi-upload-picture .semi-upload-picture-add{border:1px solid rgba(var(--coze-stroke-6),var(--coze-stroke-6-alpha));background-color:transparent}.template-form-kind2m .semi-upload-picture .semi-upload-picture-file-card-error{outline-offset:-1px}.template-form-kind2m .coz-single-select .semi-radio{margin-top:3px;margin-bottom:3px}.template-form-kind2m .coz-single-select .semi-radio .semi-radio-addon-buttonRadio{border-radius:6px}.template-form-kind2m .coz-input-number.semi-input-number .semi-input-wrapper{border-color:rgba(var(--coze-stroke-6),var(--coze-stroke-6-alpha))}.template-form-kind2m .coz-input-number.semi-input-number .semi-input-wrapper-focus{border-color:var(--semi-color-focus-border)}.template-form-kind2m .coz-input-number.semi-input-number .semi-input-suffix{margin-right:30px;font-size:12px;font-weight:400}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"template-form\": `template-form-kind2m`,\n\t\"templateForm\": `template-form-kind2m`,\n\t\"editor-container\": `editor-container-v9qzn_`,\n\t\"editorContainer\": `editor-container-v9qzn_`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.highlight-EyZl50{border-radius:4px;animation:3s forwards highlight-animation-FUji_T}@keyframes highlight-animation-FUji_T{0%{background-color:rgba(var(--coze-brand-0),var(--coze-brand-0-alpha))}to{background-color:transparent}}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"highlight\": `highlight-EyZl50`,\n\t\"highlight-animation\": `highlight-animation-FUji_T`,\n\t\"highlightAnimation\": `highlight-animation-FUji_T`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.mask-B9qkmd{background:linear-gradient(180deg,rgba(var(--coze-bg-2),var(--coze-bg-2-alpha))0 85%,transparent 100%)}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"mask\": `mask-B9qkmd`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.desc-input-ty8_FN>input{text-overflow:ellipsis}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"desc-input\": `desc-input-ty8_FN`,\n\t\"descInput\": `desc-input-ty8_FN`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.publish-collapse-VlVg4U .semi-collapse-item{border-bottom:1px solid var(--coz-stroke-primary);position:relative}.publish-collapse-VlVg4U .semi-collapse-item:hover{border-color:var(--coz-bg-primary)}.publish-collapse-VlVg4U .semi-collapse-header:hover:before{content:\"\";background-color:var(--coz-bg-primary);width:100%;height:1px;position:absolute;top:-1px;left:0}.publish-collapse-VlVg4U .semi-collapse-header{border-radius:0;margin:0;padding:8px 0}.publish-collapse-VlVg4U .semi-collapse-header:hover{background:var(--coz-mg-secondary-hovered);border-radius:8px}.publish-collapse-VlVg4U .semi-collapse-header:active{background:var(--coz-mg-secondary-pressed)}.publish-collapse-VlVg4U .semi-collapse-header-icon{margin:4px}.publish-collapse-VlVg4U .semi-collapse-content{padding:4px 0 16px}.publish-collapse-VlVg4U .semi-collapse-item:last-child{border:none}.publish-collapse-VlVg4U .semi-form-field-label{line-height:20px}.publish-cards-cgmQMc .semi-select.coz-select{border-radius:var(--small,6px);height:24px}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-inset-label{color:var(--coz-fg-secondary);margin:0 4px;font-size:12px;font-weight:400}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-selection .semi-select-selection-text{font-size:12px}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-arrow{width:22px}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-empty{margin-left:0}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-collapse{align-items:center;gap:2px;line-height:normal}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-collapse .semi-overflow-list-item{display:flex}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-collapse .semi-overflow-list-overflow{display:flex}.publish-cards-cgmQMc .semi-select.coz-select .semi-tag{background:var(--coz-mg_primary,rgba(6,7,9,.08));border-radius:2px;height:16px;padding:2px}.publish-cards-cgmQMc .semi-select-error{border:1px solid var(--coz-stroke-hglt-red)}.publish-cards-cgmQMc .coz-checkbox.semi-checkbox-unChecked .semi-checkbox-inner-display{border-color:var(--coz-stroke-plus)}.project-vxjogy .semi-form-field-error-message{color:var(--coz-fg-hglt-red);font-size:12px;line-height:16px}.project-vxjogy .semi-input{border-radius:8px}.project-vxjogy .semi-form-field{padding:0}.project-vxjogy .semi-input-textarea{height:72px}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"publish-collapse\": `publish-collapse-VlVg4U`,\n\t\"publishCollapse\": `publish-collapse-VlVg4U`,\n\t\"publish-cards\": `publish-cards-cgmQMc`,\n\t\"publishCards\": `publish-cards-cgmQMc`,\n\t\"project\": `project-vxjogy`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.web-sdk-guide-_xvOoZ ol li::marker{color:var(--coz-fg-secondary);font-weight:500}.web-sdk-guide-_xvOoZ [class^=code-block-element]{height:160px}.web-sdk-guide-_xvOoZ [class^=code-block-element] [class^=content]{flex-shrink:1;overflow:auto}.web-sdk-guide-_xvOoZ [class^=code-block-element] [class^=content] pre{overflow:visible}`, \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"web-sdk-guide\": `web-sdk-guide-_xvOoZ`,\n\t\"webSdkGuide\": `web-sdk-guide-_xvOoZ`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../../@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"./codicon.ttf?38dcd33a732ebca5a557e04831e9e235\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `@font-face{font-family:codicon;font-display:block;src:url(${___CSS_LOADER_URL_REPLACEMENT_0___})format(\"truetype\")}.codicon[class*=codicon-]{text-rendering:auto;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font:16px/1 codicon;text-decoration:none;display:inline-block}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin{animation:1.5s steps(30,end) infinite codicon-spin}.codicon-modifier-disabled{opacity:.5}.codicon-modifier-hidden{opacity:0}.codicon-loading{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.codicon-add:before,.codicon-plus:before,.codicon-gist-new:before,.codicon-repo-create:before{content:\"\"}.codicon-lightbulb:before,.codicon-light-bulb:before{content:\"\"}.codicon-repo:before,.codicon-repo-delete:before{content:\"\"}.codicon-gist-fork:before,.codicon-repo-forked:before{content:\"\"}.codicon-git-pull-request:before,.codicon-git-pull-request-abandoned:before{content:\"\"}.codicon-record-keys:before,.codicon-keyboard:before{content:\"\"}.codicon-tag:before,.codicon-git-pull-request-label:before,.codicon-tag-add:before,.codicon-tag-remove:before{content:\"\"}.codicon-person:before,.codicon-person-follow:before,.codicon-person-outline:before,.codicon-person-filled:before{content:\"\"}.codicon-git-branch:before,.codicon-git-branch-create:before,.codicon-git-branch-delete:before,.codicon-source-control:before{content:\"\"}.codicon-mirror:before,.codicon-mirror-public:before{content:\"\"}.codicon-star:before,.codicon-star-add:before,.codicon-star-delete:before,.codicon-star-empty:before{content:\"\"}.codicon-comment:before,.codicon-comment-add:before{content:\"\"}.codicon-alert:before,.codicon-warning:before{content:\"\"}.codicon-search:before,.codicon-search-save:before{content:\"\"}.codicon-log-out:before,.codicon-sign-out:before{content:\"\"}.codicon-log-in:before,.codicon-sign-in:before{content:\"\"}.codicon-eye:before,.codicon-eye-unwatch:before,.codicon-eye-watch:before{content:\"\"}.codicon-circle-filled:before,.codicon-primitive-dot:before,.codicon-close-dirty:before,.codicon-debug-breakpoint:before,.codicon-debug-breakpoint-disabled:before,.codicon-debug-hint:before,.codicon-terminal-decoration-success:before{content:\"\"}.codicon-primitive-square:before{content:\"\"}.codicon-edit:before,.codicon-pencil:before{content:\"\"}.codicon-info:before,.codicon-issue-opened:before{content:\"\"}.codicon-gist-private:before,.codicon-git-fork-private:before,.codicon-lock:before,.codicon-mirror-private:before{content:\"\"}.codicon-close:before,.codicon-remove-close:before,.codicon-x:before{content:\"\"}.codicon-repo-sync:before,.codicon-sync:before{content:\"\"}.codicon-clone:before,.codicon-desktop-download:before{content:\"\"}.codicon-beaker:before,.codicon-microscope:before{content:\"\"}.codicon-vm:before,.codicon-device-desktop:before{content:\"\"}.codicon-file:before,.codicon-file-text:before{content:\"\"}.codicon-more:before,.codicon-ellipsis:before,.codicon-kebab-horizontal:before{content:\"\"}.codicon-mail-reply:before,.codicon-reply:before{content:\"\"}.codicon-organization:before,.codicon-organization-filled:before,.codicon-organization-outline:before{content:\"\"}.codicon-new-file:before,.codicon-file-add:before{content:\"\"}.codicon-new-folder:before,.codicon-file-directory-create:before{content:\"\"}.codicon-trash:before,.codicon-trashcan:before{content:\"\"}.codicon-history:before,.codicon-clock:before{content:\"\"}.codicon-folder:before,.codicon-file-directory:before,.codicon-symbol-folder:before{content:\"\"}.codicon-logo-github:before,.codicon-mark-github:before,.codicon-github:before{content:\"\"}.codicon-terminal:before,.codicon-console:before,.codicon-repl:before{content:\"\"}.codicon-zap:before,.codicon-symbol-event:before{content:\"\"}.codicon-error:before,.codicon-stop:before{content:\"\"}.codicon-variable:before,.codicon-symbol-variable:before{content:\"\"}.codicon-array:before,.codicon-symbol-array:before{content:\"\"}.codicon-symbol-module:before,.codicon-symbol-package:before,.codicon-symbol-namespace:before,.codicon-symbol-object:before{content:\"\"}.codicon-symbol-method:before,.codicon-symbol-function:before,.codicon-symbol-constructor:before{content:\"\"}.codicon-symbol-boolean:before,.codicon-symbol-null:before{content:\"\"}.codicon-symbol-numeric:before,.codicon-symbol-number:before{content:\"\"}.codicon-symbol-structure:before,.codicon-symbol-struct:before{content:\"\"}.codicon-symbol-parameter:before,.codicon-symbol-type-parameter:before{content:\"\"}.codicon-symbol-key:before,.codicon-symbol-text:before{content:\"\"}.codicon-symbol-reference:before,.codicon-go-to-file:before{content:\"\"}.codicon-symbol-enum:before,.codicon-symbol-value:before{content:\"\"}.codicon-symbol-ruler:before,.codicon-symbol-unit:before{content:\"\"}.codicon-activate-breakpoints:before{content:\"\"}.codicon-archive:before{content:\"\"}.codicon-arrow-both:before{content:\"\"}.codicon-arrow-down:before{content:\"\"}.codicon-arrow-left:before{content:\"\"}.codicon-arrow-right:before{content:\"\"}.codicon-arrow-small-down:before{content:\"\"}.codicon-arrow-small-left:before{content:\"\"}.codicon-arrow-small-right:before{content:\"\"}.codicon-arrow-small-up:before{content:\"\"}.codicon-arrow-up:before{content:\"\"}.codicon-bell:before{content:\"\"}.codicon-bold:before{content:\"\"}.codicon-book:before{content:\"\"}.codicon-bookmark:before{content:\"\"}.codicon-debug-breakpoint-conditional-unverified:before{content:\"\"}.codicon-debug-breakpoint-conditional:before,.codicon-debug-breakpoint-conditional-disabled:before{content:\"\"}.codicon-debug-breakpoint-data-unverified:before{content:\"\"}.codicon-debug-breakpoint-data:before,.codicon-debug-breakpoint-data-disabled:before{content:\"\"}.codicon-debug-breakpoint-log-unverified:before{content:\"\"}.codicon-debug-breakpoint-log:before,.codicon-debug-breakpoint-log-disabled:before{content:\"\"}.codicon-briefcase:before{content:\"\"}.codicon-broadcast:before{content:\"\"}.codicon-browser:before{content:\"\"}.codicon-bug:before{content:\"\"}.codicon-calendar:before{content:\"\"}.codicon-case-sensitive:before{content:\"\"}.codicon-check:before{content:\"\"}.codicon-checklist:before{content:\"\"}.codicon-chevron-down:before{content:\"\"}.codicon-chevron-left:before{content:\"\"}.codicon-chevron-right:before{content:\"\"}.codicon-chevron-up:before{content:\"\"}.codicon-chrome-close:before{content:\"\"}.codicon-chrome-maximize:before{content:\"\"}.codicon-chrome-minimize:before{content:\"\"}.codicon-chrome-restore:before{content:\"\"}.codicon-circle-outline:before,.codicon-circle:before,.codicon-debug-breakpoint-unverified:before,.codicon-terminal-decoration-incomplete:before{content:\"\"}.codicon-circle-slash:before{content:\"\"}.codicon-circuit-board:before{content:\"\"}.codicon-clear-all:before{content:\"\"}.codicon-clippy:before{content:\"\"}.codicon-close-all:before{content:\"\"}.codicon-cloud-download:before{content:\"\"}.codicon-cloud-upload:before{content:\"\"}.codicon-code:before{content:\"\"}.codicon-collapse-all:before{content:\"\"}.codicon-color-mode:before{content:\"\"}.codicon-comment-discussion:before{content:\"\"}.codicon-credit-card:before{content:\"\"}.codicon-dash:before{content:\"\"}.codicon-dashboard:before{content:\"\"}.codicon-database:before{content:\"\"}.codicon-debug-continue:before{content:\"\"}.codicon-debug-disconnect:before{content:\"\"}.codicon-debug-pause:before{content:\"\"}.codicon-debug-restart:before{content:\"\"}.codicon-debug-start:before{content:\"\"}.codicon-debug-step-into:before{content:\"\"}.codicon-debug-step-out:before{content:\"\"}.codicon-debug-step-over:before{content:\"\"}.codicon-debug-stop:before{content:\"\"}.codicon-debug:before{content:\"\"}.codicon-device-camera-video:before{content:\"\"}.codicon-device-camera:before{content:\"\"}.codicon-device-mobile:before{content:\"\"}.codicon-diff-added:before{content:\"\"}.codicon-diff-ignored:before{content:\"\"}.codicon-diff-modified:before{content:\"\"}.codicon-diff-removed:before{content:\"\"}.codicon-diff-renamed:before{content:\"\"}.codicon-diff:before,.codicon-diff-sidebyside:before{content:\"\"}.codicon-discard:before{content:\"\"}.codicon-editor-layout:before{content:\"\"}.codicon-empty-window:before{content:\"\"}.codicon-exclude:before{content:\"\"}.codicon-extensions:before{content:\"\"}.codicon-eye-closed:before{content:\"\"}.codicon-file-binary:before{content:\"\"}.codicon-file-code:before{content:\"\"}.codicon-file-media:before{content:\"\"}.codicon-file-pdf:before{content:\"\"}.codicon-file-submodule:before{content:\"\"}.codicon-file-symlink-directory:before{content:\"\"}.codicon-file-symlink-file:before{content:\"\"}.codicon-file-zip:before{content:\"\"}.codicon-files:before{content:\"\"}.codicon-filter:before{content:\"\"}.codicon-flame:before{content:\"\"}.codicon-fold-down:before{content:\"\"}.codicon-fold-up:before{content:\"\"}.codicon-fold:before{content:\"\"}.codicon-folder-active:before{content:\"\"}.codicon-folder-opened:before{content:\"\"}.codicon-gear:before{content:\"\"}.codicon-gift:before{content:\"\"}.codicon-gist-secret:before{content:\"\"}.codicon-gist:before{content:\"\"}.codicon-git-commit:before{content:\"\"}.codicon-git-compare:before,.codicon-compare-changes:before{content:\"\"}.codicon-git-merge:before{content:\"\"}.codicon-github-action:before{content:\"\"}.codicon-github-alt:before{content:\"\"}.codicon-globe:before{content:\"\"}.codicon-grabber:before{content:\"\"}.codicon-graph:before{content:\"\"}.codicon-gripper:before{content:\"\"}.codicon-heart:before{content:\"\"}.codicon-home:before{content:\"\"}.codicon-horizontal-rule:before{content:\"\"}.codicon-hubot:before{content:\"\"}.codicon-inbox:before{content:\"\"}.codicon-issue-reopened:before{content:\"\"}.codicon-issues:before{content:\"\"}.codicon-italic:before{content:\"\"}.codicon-jersey:before{content:\"\"}.codicon-json:before{content:\"\"}.codicon-kebab-vertical:before{content:\"\"}.codicon-key:before{content:\"\"}.codicon-law:before{content:\"\"}.codicon-lightbulb-autofix:before{content:\"\"}.codicon-link-external:before{content:\"\"}.codicon-link:before{content:\"\"}.codicon-list-ordered:before{content:\"\"}.codicon-list-unordered:before{content:\"\"}.codicon-live-share:before{content:\"\"}.codicon-loading:before{content:\"\"}.codicon-location:before{content:\"\"}.codicon-mail-read:before{content:\"\"}.codicon-mail:before{content:\"\"}.codicon-markdown:before{content:\"\"}.codicon-megaphone:before{content:\"\"}.codicon-mention:before{content:\"\"}.codicon-milestone:before,.codicon-git-pull-request-milestone:before{content:\"\"}.codicon-mortar-board:before{content:\"\"}.codicon-move:before{content:\"\"}.codicon-multiple-windows:before{content:\"\"}.codicon-mute:before{content:\"\"}.codicon-no-newline:before{content:\"\"}.codicon-note:before{content:\"\"}.codicon-octoface:before{content:\"\"}.codicon-open-preview:before{content:\"\"}.codicon-package:before{content:\"\"}.codicon-paintcan:before{content:\"\"}.codicon-pin:before{content:\"\"}.codicon-play:before,.codicon-run:before{content:\"\"}.codicon-plug:before{content:\"\"}.codicon-preserve-case:before{content:\"\"}.codicon-preview:before{content:\"\"}.codicon-project:before{content:\"\"}.codicon-pulse:before{content:\"\"}.codicon-question:before{content:\"\"}.codicon-quote:before{content:\"\"}.codicon-radio-tower:before{content:\"\"}.codicon-reactions:before{content:\"\"}.codicon-references:before{content:\"\"}.codicon-refresh:before{content:\"\"}.codicon-regex:before{content:\"\"}.codicon-remote-explorer:before{content:\"\"}.codicon-remote:before{content:\"\"}.codicon-remove:before{content:\"\"}.codicon-replace-all:before{content:\"\"}.codicon-replace:before{content:\"\"}.codicon-repo-clone:before{content:\"\"}.codicon-repo-force-push:before{content:\"\"}.codicon-repo-pull:before{content:\"\"}.codicon-repo-push:before{content:\"\"}.codicon-report:before{content:\"\"}.codicon-request-changes:before{content:\"\"}.codicon-rocket:before{content:\"\"}.codicon-root-folder-opened:before{content:\"\"}.codicon-root-folder:before{content:\"\"}.codicon-rss:before{content:\"\"}.codicon-ruby:before{content:\"\"}.codicon-save-all:before{content:\"\"}.codicon-save-as:before{content:\"\"}.codicon-save:before{content:\"\"}.codicon-screen-full:before{content:\"\"}.codicon-screen-normal:before{content:\"\"}.codicon-search-stop:before{content:\"\"}.codicon-server:before{content:\"\"}.codicon-settings-gear:before{content:\"\"}.codicon-settings:before{content:\"\"}.codicon-shield:before{content:\"\"}.codicon-smiley:before{content:\"\"}.codicon-sort-precedence:before{content:\"\"}.codicon-split-horizontal:before{content:\"\"}.codicon-split-vertical:before{content:\"\"}.codicon-squirrel:before{content:\"\"}.codicon-star-full:before{content:\"\"}.codicon-star-half:before{content:\"\"}.codicon-symbol-class:before{content:\"\"}.codicon-symbol-color:before{content:\"\"}.codicon-symbol-constant:before{content:\"\"}.codicon-symbol-enum-member:before{content:\"\"}.codicon-symbol-field:before{content:\"\"}.codicon-symbol-file:before{content:\"\"}.codicon-symbol-interface:before{content:\"\"}.codicon-symbol-keyword:before{content:\"\"}.codicon-symbol-misc:before{content:\"\"}.codicon-symbol-operator:before{content:\"\"}.codicon-symbol-property:before,.codicon-wrench:before,.codicon-wrench-subaction:before{content:\"\"}.codicon-symbol-snippet:before{content:\"\"}.codicon-tasklist:before{content:\"\"}.codicon-telescope:before{content:\"\"}.codicon-text-size:before{content:\"\"}.codicon-three-bars:before{content:\"\"}.codicon-thumbsdown:before{content:\"\"}.codicon-thumbsup:before{content:\"\"}.codicon-tools:before{content:\"\"}.codicon-triangle-down:before{content:\"\"}.codicon-triangle-left:before{content:\"\"}.codicon-triangle-right:before{content:\"\"}.codicon-triangle-up:before{content:\"\"}.codicon-twitter:before{content:\"\"}.codicon-unfold:before{content:\"\"}.codicon-unlock:before{content:\"\"}.codicon-unmute:before{content:\"\"}.codicon-unverified:before{content:\"\"}.codicon-verified:before{content:\"\"}.codicon-versions:before{content:\"\"}.codicon-vm-active:before{content:\"\"}.codicon-vm-outline:before{content:\"\"}.codicon-vm-running:before{content:\"\"}.codicon-watch:before{content:\"\"}.codicon-whitespace:before{content:\"\"}.codicon-whole-word:before{content:\"\"}.codicon-window:before{content:\"\"}.codicon-word-wrap:before{content:\"\"}.codicon-zoom-in:before{content:\"\"}.codicon-zoom-out:before{content:\"\"}.codicon-list-filter:before{content:\"\"}.codicon-list-flat:before{content:\"\"}.codicon-list-selection:before,.codicon-selection:before{content:\"\"}.codicon-list-tree:before{content:\"\"}.codicon-debug-breakpoint-function-unverified:before{content:\"\"}.codicon-debug-breakpoint-function:before,.codicon-debug-breakpoint-function-disabled:before{content:\"\"}.codicon-debug-stackframe-active:before{content:\"\"}.codicon-circle-small-filled:before,.codicon-debug-stackframe-dot:before,.codicon-terminal-decoration-mark:before{content:\"\"}.codicon-debug-stackframe:before,.codicon-debug-stackframe-focused:before{content:\"\"}.codicon-debug-breakpoint-unsupported:before{content:\"\"}.codicon-symbol-string:before{content:\"\"}.codicon-debug-reverse-continue:before{content:\"\"}.codicon-debug-step-back:before{content:\"\"}.codicon-debug-restart-frame:before{content:\"\"}.codicon-debug-alt:before{content:\"\"}.codicon-call-incoming:before{content:\"\"}.codicon-call-outgoing:before{content:\"\"}.codicon-menu:before{content:\"\"}.codicon-expand-all:before{content:\"\"}.codicon-feedback:before,.codicon-git-pull-request-reviewer:before{content:\"\"}.codicon-group-by-ref-type:before{content:\"\"}.codicon-ungroup-by-ref-type:before{content:\"\"}.codicon-account:before,.codicon-git-pull-request-assignee:before{content:\"\"}.codicon-bell-dot:before{content:\"\"}.codicon-debug-console:before{content:\"\"}.codicon-library:before{content:\"\"}.codicon-output:before{content:\"\"}.codicon-run-all:before{content:\"\"}.codicon-sync-ignored:before{content:\"\"}.codicon-pinned:before{content:\"\"}.codicon-github-inverted:before{content:\"\"}.codicon-server-process:before{content:\"\"}.codicon-server-environment:before{content:\"\"}.codicon-pass:before,.codicon-issue-closed:before{content:\"\"}.codicon-stop-circle:before{content:\"\"}.codicon-play-circle:before{content:\"\"}.codicon-record:before{content:\"\"}.codicon-debug-alt-small:before{content:\"\"}.codicon-vm-connect:before{content:\"\"}.codicon-cloud:before{content:\"\"}.codicon-merge:before{content:\"\"}.codicon-export:before{content:\"\"}.codicon-graph-left:before{content:\"\"}.codicon-magnet:before{content:\"\"}.codicon-notebook:before{content:\"\"}.codicon-redo:before{content:\"\"}.codicon-check-all:before{content:\"\"}.codicon-pinned-dirty:before{content:\"\"}.codicon-pass-filled:before{content:\"\"}.codicon-circle-large-filled:before{content:\"\"}.codicon-circle-large:before,.codicon-circle-large-outline:before{content:\"\"}.codicon-combine:before,.codicon-gather:before{content:\"\"}.codicon-table:before{content:\"\"}.codicon-variable-group:before{content:\"\"}.codicon-type-hierarchy:before{content:\"\"}.codicon-type-hierarchy-sub:before{content:\"\"}.codicon-type-hierarchy-super:before{content:\"\"}.codicon-git-pull-request-create:before{content:\"\"}.codicon-run-above:before{content:\"\"}.codicon-run-below:before{content:\"\"}.codicon-notebook-template:before{content:\"\"}.codicon-debug-rerun:before{content:\"\"}.codicon-workspace-trusted:before{content:\"\"}.codicon-workspace-untrusted:before{content:\"\"}.codicon-workspace-unknown:before{content:\"\"}.codicon-terminal-cmd:before{content:\"\"}.codicon-terminal-debian:before{content:\"\"}.codicon-terminal-linux:before{content:\"\"}.codicon-terminal-powershell:before{content:\"\"}.codicon-terminal-tmux:before{content:\"\"}.codicon-terminal-ubuntu:before{content:\"\"}.codicon-terminal-bash:before{content:\"\"}.codicon-arrow-swap:before{content:\"\"}.codicon-copy:before{content:\"\"}.codicon-person-add:before{content:\"\"}.codicon-filter-filled:before{content:\"\"}.codicon-wand:before{content:\"\"}.codicon-debug-line-by-line:before{content:\"\"}.codicon-inspect:before{content:\"\"}.codicon-layers:before{content:\"\"}.codicon-layers-dot:before{content:\"\"}.codicon-layers-active:before{content:\"\"}.codicon-compass:before{content:\"\"}.codicon-compass-dot:before{content:\"\"}.codicon-compass-active:before{content:\"\"}.codicon-azure:before{content:\"\"}.codicon-issue-draft:before{content:\"\"}.codicon-git-pull-request-closed:before{content:\"\"}.codicon-git-pull-request-draft:before{content:\"\"}.codicon-debug-all:before{content:\"\"}.codicon-debug-coverage:before{content:\"\"}.codicon-run-errors:before{content:\"\"}.codicon-folder-library:before{content:\"\"}.codicon-debug-continue-small:before{content:\"\"}.codicon-beaker-stop:before{content:\"\"}.codicon-graph-line:before{content:\"\"}.codicon-graph-scatter:before{content:\"\"}.codicon-pie-chart:before{content:\"\"}.codicon-bracket:before{content:\"\"}.codicon-bracket-dot:before{content:\"\"}.codicon-bracket-error:before{content:\"\"}.codicon-lock-small:before{content:\"\"}.codicon-azure-devops:before{content:\"\"}.codicon-verified-filled:before{content:\"\"}.codicon-newline:before{content:\"\"}.codicon-layout:before{content:\"\"}.codicon-layout-activitybar-left:before{content:\"\"}.codicon-layout-activitybar-right:before{content:\"\"}.codicon-layout-panel-left:before{content:\"\"}.codicon-layout-panel-center:before{content:\"\"}.codicon-layout-panel-justify:before{content:\"\"}.codicon-layout-panel-right:before{content:\"\"}.codicon-layout-panel:before{content:\"\"}.codicon-layout-sidebar-left:before{content:\"\"}.codicon-layout-sidebar-right:before{content:\"\"}.codicon-layout-statusbar:before{content:\"\"}.codicon-layout-menubar:before{content:\"\"}.codicon-layout-centered:before{content:\"\"}.codicon-target:before{content:\"\"}.codicon-indent:before{content:\"\"}.codicon-record-small:before{content:\"\"}.codicon-error-small:before,.codicon-terminal-decoration-error:before{content:\"\"}.codicon-arrow-circle-down:before{content:\"\"}.codicon-arrow-circle-left:before{content:\"\"}.codicon-arrow-circle-right:before{content:\"\"}.codicon-arrow-circle-up:before{content:\"\"}.codicon-layout-sidebar-right-off:before{content:\"\"}.codicon-layout-panel-off:before{content:\"\"}.codicon-layout-sidebar-left-off:before{content:\"\"}.codicon-blank:before{content:\"\"}.codicon-heart-filled:before{content:\"\"}.codicon-map:before,.codicon-map-horizontal:before,.codicon-fold-horizontal:before{content:\"\"}.codicon-map-filled:before,.codicon-map-horizontal-filled:before,.codicon-fold-horizontal-filled:before{content:\"\"}.codicon-circle-small:before{content:\"\"}.codicon-bell-slash:before{content:\"\"}.codicon-bell-slash-dot:before{content:\"\"}.codicon-comment-unresolved:before{content:\"\"}.codicon-git-pull-request-go-to-changes:before{content:\"\"}.codicon-git-pull-request-new-changes:before{content:\"\"}.codicon-search-fuzzy:before{content:\"\"}.codicon-comment-draft:before{content:\"\"}.codicon-send:before{content:\"\"}.codicon-sparkle:before{content:\"\"}.codicon-insert:before{content:\"\"}.codicon-mic:before{content:\"\"}.codicon-thumbsdown-filled:before{content:\"\"}.codicon-thumbsup-filled:before{content:\"\"}.codicon-coffee:before{content:\"\"}.codicon-snake:before{content:\"\"}.codicon-game:before{content:\"\"}.codicon-vr:before{content:\"\"}.codicon-chip:before{content:\"\"}.codicon-piano:before{content:\"\"}.codicon-music:before{content:\"\"}.codicon-mic-filled:before{content:\"\"}.codicon-repo-fetch:before{content:\"\"}.codicon-copilot:before{content:\"\"}.codicon-lightbulb-sparkle:before{content:\"\"}.codicon-robot:before{content:\"\"}.codicon-sparkle-filled:before{content:\"\"}.codicon-diff-single:before{content:\"\"}.codicon-diff-multiple:before{content:\"\"}.codicon-surround-with:before{content:\"\"}.codicon-share:before{content:\"\"}.codicon-git-stash:before{content:\"\"}.codicon-git-stash-apply:before{content:\"\"}.codicon-git-stash-pop:before{content:\"\"}.codicon-vscode:before{content:\"\"}.codicon-vscode-insiders:before{content:\"\"}.codicon-code-oss:before{content:\"\"}.codicon-run-coverage:before{content:\"\"}.codicon-run-all-coverage:before{content:\"\"}.codicon-coverage:before{content:\"\"}.codicon-github-project:before{content:\"\"}.codicon-map-vertical:before,.codicon-fold-vertical:before{content:\"\"}.codicon-map-vertical-filled:before,.codicon-fold-vertical-filled:before{content:\"\"}.codicon-go-to-search:before{content:\"\"}.codicon-percentage:before,.codicon-sort-percentage:before{content:\"\"}.codicon-git-fetch:before{content:\"\"}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.lm-Widget{box-sizing:border-box;position:relative;overflow:hidden}.lm-Widget.lm-mod-hidden{display:none!important}.lm-DockPanel,.lm-DockPanel-widget{z-index:0}.lm-DockPanel-tabBar{z-index:1}.lm-DockPanel-handle{z-index:2}.lm-DockPanel-handle.lm-mod-hidden{display:none!important}.lm-DockPanel-handle:after{content:\"\";width:100%;height:100%;position:absolute;top:0;left:0}.lm-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.lm-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.lm-DockPanel-handle[data-orientation=horizontal]:after{min-width:8px;left:50%;transform:translate(-50%)}.lm-DockPanel-handle[data-orientation=vertical]:after{min-height:8px;top:50%;transform:translateY(-50%)}.lm-DockPanel-overlay{pointer-events:none;z-index:3;box-sizing:border-box}.lm-DockPanel-overlay.lm-mod-hidden{display:none!important}.lm-SplitPanel-child{z-index:0}.lm-SplitPanel-handle{z-index:1}.lm-SplitPanel-handle.lm-mod-hidden{display:none!important}.lm-SplitPanel-handle:after{content:\"\";width:100%;height:100%;position:absolute;top:0;left:0}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle{cursor:ew-resize}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle{cursor:ns-resize}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle:after{min-width:8px;left:50%;transform:translate(-50%)}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle:after{min-height:8px;top:50%;transform:translateY(-50%)}.lm-TabBar{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex}.lm-TabBar[data-orientation=horizontal]{flex-direction:row;align-items:flex-end}.lm-TabBar[data-orientation=vertical]{flex-direction:column;align-items:flex-end}.lm-TabBar-content{flex:auto;margin:0;padding:0;list-style-type:none;display:flex}.lm-TabBar[data-orientation=horizontal]>.lm-TabBar-content{flex-direction:row}.lm-TabBar[data-orientation=vertical]>.lm-TabBar-content{flex-direction:column}.lm-TabBar-tab{touch-action:none;box-sizing:border-box;flex-direction:row;display:flex;overflow:hidden}.lm-TabBar-tabIcon,.lm-TabBar-tabCloseIcon{flex:none}.lm-TabBar-tabLabel{white-space:nowrap;flex:auto;overflow:hidden}.lm-TabBar-tabInput{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;box-sizing:border-box;width:100%}.lm-TabBar-tab.lm-mod-hidden,.lm-TabBar-addButton.lm-mod-hidden{display:none!important}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab{position:relative}.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab{transition:left .15s;left:0}.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab{transition:top .15s;top:0}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging{transition:none}.lm-TabBar-tabLabel .lm-TabBar-tabInput{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;box-sizing:border-box;background:inherit;width:100%}.lm-TabPanel-tabBar{z-index:1}.lm-TabPanel-stackedPanel{z-index:0}.lm-DockPanel-overlay{background:rgba(255,255,255,.6);border:1px dashed #000;transition-property:top,left,right,bottom;transition-duration:.15s;transition-timing-function:ease}.lm-TabBar{min-height:24px;max-height:24px}.lm-TabBar-content{border-bottom:1px solid silver;align-items:flex-end;min-width:0;min-height:0}.lm-TabBar-tab{background:#e5e5e5;border:1px solid silver;border-bottom:none;flex:0 125px;min-width:35px;min-height:20px;max-height:20px;margin-left:-1px;padding:0 10px;font:12px/20px Helvetica,Arial,sans-serif}.lm-TabBar-tabLabel .lm-TabBar-tabInput{border:0;padding:0;font:12px Helvetica,Arial,sans-serif}.lm-TabBar-tab.lm-mod-current{background:#fff;min-height:23px;max-height:23px;transform:translateY(1px)}.lm-TabBar-tab:hover:not(.lm-mod-current){background:#f0f0f0}.lm-TabBar-tab:first-child{margin-left:0}.lm-TabBar-tabIcon,.lm-TabBar-tabLabel,.lm-TabBar-tabCloseIcon{display:inline-block}.lm-TabBar-tab.lm-mod-closable>.lm-TabBar-tabCloseIcon{margin-left:4px}.lm-TabBar .lm-TabBar-addButton{border-bottom:1px solid silver;padding:0 6px}.lm-TabBar-tab.lm-mod-drag-image{border:none;min-width:125px;min-height:23px;max-height:23px;box-shadow:1px 1px 2px rgba(0,0,0,.3)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../common/temp/default/node_modules/.pnpm/@rsbuild+core@1.1.13/node_modules/@rsbuild/core/compiled/css-loader/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ide-ps{overflow-anchor:none;-ms-overflow-style:none;touch-action:auto;-ms-touch-action:auto;overflow:hidden!important}.ide-ps__rail-x{opacity:0;height:15px;transition:background-color .2s linear,opacity .2s linear;display:none;position:absolute;bottom:0}.ide-ps__rail-y{opacity:0;width:15px;transition:background-color .2s linear,opacity .2s linear;display:none;position:absolute;right:0}.ide-ps--active-x>.ide-ps__rail-x,.ide-ps--active-y>.ide-ps__rail-y{background-color:transparent;display:block}.ide-ps:hover>.ide-ps__rail-x,.ide-ps:hover>.ide-ps__rail-y,.ide-ps--focus>.ide-ps__rail-x,.ide-ps--focus>.ide-ps__rail-y,.ide-ps--scrolling-x>.ide-ps__rail-x,.ide-ps--scrolling-y>.ide-ps__rail-y{opacity:.6}.ide-ps .ide-ps__rail-x:hover,.ide-ps .ide-ps__rail-y:hover,.ide-ps .ide-ps__rail-x:focus,.ide-ps .ide-ps__rail-y:focus,.ide-ps .ide-ps__rail-x.ide-ps--clicking,.ide-ps .ide-ps__rail-y.ide-ps--clicking{opacity:.9}.ide-ps__thumb-x{background-color:#aaa;border-radius:6px;height:6px;transition:background-color .2s linear,height .2s ease-in-out;position:absolute;bottom:2px}.ide-ps__thumb-y{background-color:#aaa;border-radius:6px;width:6px;transition:background-color .2s linear,width .2s ease-in-out;position:absolute;right:2px}.ide-ps__rail-x:hover>.ide-ps__thumb-x,.ide-ps__rail-x:focus>.ide-ps__thumb-x,.ide-ps__rail-x.ide-ps--clicking .ide-ps__thumb-x{background-color:#999;height:11px}.ide-ps__rail-y:hover>.ide-ps__thumb-y,.ide-ps__rail-y:focus>.ide-ps__thumb-y,.ide-ps__rail-y.ide-ps--clicking .ide-ps__thumb-y{background-color:#999;width:11px}.lm-Widget::-webkit-scrollbar{background:0 0;width:10px;height:10px}.lm-Widget::-webkit-scrollbar:hover{background:0 0}.lm-Widget::-webkit-scrollbar-thumb{background:0 0}.lm-Widget::-webkit-scrollbar-corner{background:0 0}.lm-cursor-backdrop{will-change:transform;z-index:100;scrollbar-width:none;-ms-overflow-style:none;width:200px;height:200px;margin-top:-100px;margin-left:-100px;position:fixed;top:0;left:0;overflow:scroll}.lm-cursor-backdrop:after{content:\"\";width:1200px;height:1200px;display:block}.lm-cursor-backdrop::-webkit-scrollbar{display:none}.lm-mod-drag-image{will-change:transform;top:0;left:0}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nexport { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _defineProperty as defineProperty, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _slicedToArray as slicedToArray, _unsupportedIterableToArray as unsupportedIterableToArray };\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction compose() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (x) {\n return fns.reduceRight(function (y, f) {\n return f(y);\n }, x);\n };\n}\n\nfunction curry(fn) {\n return function curried() {\n var _this = this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return args.length >= fn.length ? fn.apply(this, args) : function () {\n for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n nextArgs[_key3] = arguments[_key3];\n }\n\n return curried.apply(_this, [].concat(args, nextArgs));\n };\n };\n}\n\nfunction isObject(value) {\n return {}.toString.call(value).includes('Object');\n}\n\nfunction isEmpty(obj) {\n return !Object.keys(obj).length;\n}\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n\nfunction hasOwnProperty(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nfunction validateChanges(initial, changes) {\n if (!isObject(changes)) errorHandler('changeType');\n if (Object.keys(changes).some(function (field) {\n return !hasOwnProperty(initial, field);\n })) errorHandler('changeField');\n return changes;\n}\n\nfunction validateSelector(selector) {\n if (!isFunction(selector)) errorHandler('selectorType');\n}\n\nfunction validateHandler(handler) {\n if (!(isFunction(handler) || isObject(handler))) errorHandler('handlerType');\n if (isObject(handler) && Object.values(handler).some(function (_handler) {\n return !isFunction(_handler);\n })) errorHandler('handlersType');\n}\n\nfunction validateInitial(initial) {\n if (!initial) errorHandler('initialIsRequired');\n if (!isObject(initial)) errorHandler('initialType');\n if (isEmpty(initial)) errorHandler('initialContent');\n}\n\nfunction throwError(errorMessages, type) {\n throw new Error(errorMessages[type] || errorMessages[\"default\"]);\n}\n\nvar errorMessages = {\n initialIsRequired: 'initial state is required',\n initialType: 'initial state should be an object',\n initialContent: 'initial state shouldn\\'t be an empty object',\n handlerType: 'handler should be an object or a function',\n handlersType: 'all handlers should be a functions',\n selectorType: 'selector should be a function',\n changeType: 'provided value of changes should be an object',\n changeField: 'it seams you want to change a field in the state which is not specified in the \"initial\" state',\n \"default\": 'an unknown error accured in `state-local` package'\n};\nvar errorHandler = curry(throwError)(errorMessages);\nvar validators = {\n changes: validateChanges,\n selector: validateSelector,\n handler: validateHandler,\n initial: validateInitial\n};\n\nfunction create(initial) {\n var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n validators.initial(initial);\n validators.handler(handler);\n var state = {\n current: initial\n };\n var didUpdate = curry(didStateUpdate)(state, handler);\n var update = curry(updateState)(state);\n var validate = curry(validators.changes)(initial);\n var getChanges = curry(extractChanges)(state);\n\n function getState() {\n var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (state) {\n return state;\n };\n validators.selector(selector);\n return selector(state.current);\n }\n\n function setState(causedChanges) {\n compose(didUpdate, update, validate, getChanges)(causedChanges);\n }\n\n return [getState, setState];\n}\n\nfunction extractChanges(state, causedChanges) {\n return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges;\n}\n\nfunction updateState(state, changes) {\n state.current = _objectSpread2(_objectSpread2({}, state.current), changes);\n return changes;\n}\n\nfunction didStateUpdate(state, handler, changes) {\n isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function (field) {\n var _handler$field;\n\n return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]);\n });\n return changes;\n}\n\nvar index = {\n create: create\n};\n\nexport default index;\n","function curry(fn) {\n return function curried() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return args.length >= fn.length ? fn.apply(this, args) : function () {\n for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n nextArgs[_key2] = arguments[_key2];\n }\n\n return curried.apply(_this, [].concat(args, nextArgs));\n };\n };\n}\n\nexport default curry;\n","import curry from '../utils/curry.js';\nimport isObject from '../utils/isObject.js';\n\n/**\n * validates the configuration object and informs about deprecation\n * @param {Object} config - the configuration object \n * @return {Object} config - the validated configuration object\n */\n\nfunction validateConfig(config) {\n if (!config) errorHandler('configIsRequired');\n if (!isObject(config)) errorHandler('configType');\n\n if (config.urls) {\n informAboutDeprecation();\n return {\n paths: {\n vs: config.urls.monacoBase\n }\n };\n }\n\n return config;\n}\n/**\n * logs deprecation message\n */\n\n\nfunction informAboutDeprecation() {\n console.warn(errorMessages.deprecation);\n}\n\nfunction throwError(errorMessages, type) {\n throw new Error(errorMessages[type] || errorMessages[\"default\"]);\n}\n\nvar errorMessages = {\n configIsRequired: 'the configuration object is required',\n configType: 'the configuration object should be an object',\n \"default\": 'an unknown error accured in `@monaco-editor/loader` package',\n deprecation: \"Deprecation warning!\\n You are using deprecated way of configuration.\\n\\n Instead of using\\n monaco.config({ urls: { monacoBase: '...' } })\\n use\\n monaco.config({ paths: { vs: '...' } })\\n\\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\\n \"\n};\nvar errorHandler = curry(throwError)(errorMessages);\nvar validators = {\n config: validateConfig\n};\n\nexport default validators;\nexport { errorHandler, errorMessages };\n","function isObject(value) {\n return {}.toString.call(value).includes('Object');\n}\n\nexport default isObject;\n","var compose = function compose() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (x) {\n return fns.reduceRight(function (y, f) {\n return f(y);\n }, x);\n };\n};\n\nexport default compose;\n","// The source (has been changed) is https://github.com/facebook/react/issues/5465#issuecomment-157888325\nvar CANCELATION_MESSAGE = {\n type: 'cancelation',\n msg: 'operation is manually canceled'\n};\n\nfunction makeCancelable(promise) {\n var hasCanceled_ = false;\n var wrappedPromise = new Promise(function (resolve, reject) {\n promise.then(function (val) {\n return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val);\n });\n promise[\"catch\"](reject);\n });\n return wrappedPromise.cancel = function () {\n return hasCanceled_ = true;\n }, wrappedPromise;\n}\n\nexport default makeCancelable;\nexport { CANCELATION_MESSAGE };\n","import { slicedToArray as _slicedToArray, objectWithoutProperties as _objectWithoutProperties } from '../_virtual/_rollupPluginBabelHelpers.js';\nimport state from 'state-local';\nimport config$1 from '../config/index.js';\nimport validators from '../validators/index.js';\nimport compose from '../utils/compose.js';\nimport merge from '../utils/deepMerge.js';\nimport makeCancelable from '../utils/makeCancelable.js';\n\n/** the local state of the module */\n\nvar _state$create = state.create({\n config: config$1,\n isInitialized: false,\n resolve: null,\n reject: null,\n monaco: null\n}),\n _state$create2 = _slicedToArray(_state$create, 2),\n getState = _state$create2[0],\n setState = _state$create2[1];\n/**\n * set the loader configuration\n * @param {Object} config - the configuration object\n */\n\n\nfunction config(globalConfig) {\n var _validators$config = validators.config(globalConfig),\n monaco = _validators$config.monaco,\n config = _objectWithoutProperties(_validators$config, [\"monaco\"]);\n\n setState(function (state) {\n return {\n config: merge(state.config, config),\n monaco: monaco\n };\n });\n}\n/**\n * handles the initialization of the monaco-editor\n * @return {Promise} - returns an instance of monaco (with a cancelable promise)\n */\n\n\nfunction init() {\n var state = getState(function (_ref) {\n var monaco = _ref.monaco,\n isInitialized = _ref.isInitialized,\n resolve = _ref.resolve;\n return {\n monaco: monaco,\n isInitialized: isInitialized,\n resolve: resolve\n };\n });\n\n if (!state.isInitialized) {\n setState({\n isInitialized: true\n });\n\n if (state.monaco) {\n state.resolve(state.monaco);\n return makeCancelable(wrapperPromise);\n }\n\n if (window.monaco && window.monaco.editor) {\n storeMonacoInstance(window.monaco);\n state.resolve(window.monaco);\n return makeCancelable(wrapperPromise);\n }\n\n compose(injectScripts, getMonacoLoaderScript)(configureLoader);\n }\n\n return makeCancelable(wrapperPromise);\n}\n/**\n * injects provided scripts into the document.body\n * @param {Object} script - an HTML script element\n * @return {Object} - the injected HTML script element\n */\n\n\nfunction injectScripts(script) {\n return document.body.appendChild(script);\n}\n/**\n * creates an HTML script element with/without provided src\n * @param {string} [src] - the source path of the script\n * @return {Object} - the created HTML script element\n */\n\n\nfunction createScript(src) {\n var script = document.createElement('script');\n return src && (script.src = src), script;\n}\n/**\n * creates an HTML script element with the monaco loader src\n * @return {Object} - the created HTML script element\n */\n\n\nfunction getMonacoLoaderScript(configureLoader) {\n var state = getState(function (_ref2) {\n var config = _ref2.config,\n reject = _ref2.reject;\n return {\n config: config,\n reject: reject\n };\n });\n var loaderScript = createScript(\"\".concat(state.config.paths.vs, \"/loader.js\"));\n\n loaderScript.onload = function () {\n return configureLoader();\n };\n\n loaderScript.onerror = state.reject;\n return loaderScript;\n}\n/**\n * configures the monaco loader\n */\n\n\nfunction configureLoader() {\n var state = getState(function (_ref3) {\n var config = _ref3.config,\n resolve = _ref3.resolve,\n reject = _ref3.reject;\n return {\n config: config,\n resolve: resolve,\n reject: reject\n };\n });\n var require = window.require;\n\n require.config(state.config);\n\n require(['vs/editor/editor.main'], function (monaco) {\n storeMonacoInstance(monaco);\n state.resolve(monaco);\n }, function (error) {\n state.reject(error);\n });\n}\n/**\n * store monaco instance in local state\n */\n\n\nfunction storeMonacoInstance(monaco) {\n if (!getState().monaco) {\n setState({\n monaco: monaco\n });\n }\n}\n/**\n * internal helper function\n * extracts stored monaco instance\n * @return {Object|null} - the monaco instance\n */\n\n\nfunction __getMonacoInstance() {\n return getState(function (_ref4) {\n var monaco = _ref4.monaco;\n return monaco;\n });\n}\n\nvar wrapperPromise = new Promise(function (resolve, reject) {\n return setState({\n resolve: resolve,\n reject: reject\n });\n});\nvar loader = {\n config: config,\n init: init,\n __getMonacoInstance: __getMonacoInstance\n};\n\nexport default loader;\n","var config = {\n paths: {\n vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs'\n }\n};\n\nexport default config;\n","import { objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';\n\nfunction merge(target, source) {\n Object.keys(source).forEach(function (key) {\n if (source[key] instanceof Object) {\n if (target[key]) {\n Object.assign(source[key], merge(target[key], source[key]));\n }\n }\n });\n return _objectSpread2(_objectSpread2({}, target), source);\n}\n\nexport default merge;\n","import _t from\"@monaco-editor/loader\";import{memo as Te}from\"react\";import ke,{useState as re,useRef as S,useCallback as oe,useEffect as ne}from\"react\";import Se from\"@monaco-editor/loader\";import{memo as ye}from\"react\";import K from\"react\";var le={wrapper:{display:\"flex\",position:\"relative\",textAlign:\"initial\"},fullWidth:{width:\"100%\"},hide:{display:\"none\"}},v=le;import me from\"react\";var ae={container:{display:\"flex\",height:\"100%\",width:\"100%\",justifyContent:\"center\",alignItems:\"center\"}},Y=ae;function Me({children:e}){return me.createElement(\"div\",{style:Y.container},e)}var Z=Me;var $=Z;function Ee({width:e,height:r,isEditorReady:n,loading:t,_ref:a,className:m,wrapperProps:E}){return K.createElement(\"section\",{style:{...v.wrapper,width:e,height:r},...E},!n&&K.createElement($,null,t),K.createElement(\"div\",{ref:a,style:{...v.fullWidth,...!n&&v.hide},className:m}))}var ee=Ee;var H=ye(ee);import{useEffect as xe}from\"react\";function Ce(e){xe(e,[])}var k=Ce;import{useEffect as ge,useRef as Re}from\"react\";function he(e,r,n=!0){let t=Re(!0);ge(t.current||!n?()=>{t.current=!1}:e,r)}var l=he;function D(){}function h(e,r,n,t){return De(e,t)||be(e,r,n,t)}function De(e,r){return e.editor.getModel(te(e,r))}function be(e,r,n,t){return e.editor.createModel(r,n,t?te(e,t):void 0)}function te(e,r){return e.Uri.parse(r)}function Oe({original:e,modified:r,language:n,originalLanguage:t,modifiedLanguage:a,originalModelPath:m,modifiedModelPath:E,keepCurrentOriginalModel:g=!1,keepCurrentModifiedModel:N=!1,theme:x=\"light\",loading:P=\"Loading...\",options:y={},height:V=\"100%\",width:z=\"100%\",className:F,wrapperProps:j={},beforeMount:A=D,onMount:q=D}){let[M,O]=re(!1),[T,s]=re(!0),u=S(null),c=S(null),w=S(null),d=S(q),o=S(A),b=S(!1);k(()=>{let i=Se.init();return i.then(f=>(c.current=f)&&s(!1)).catch(f=>f?.type!==\"cancelation\"&&console.error(\"Monaco initialization: error:\",f)),()=>u.current?I():i.cancel()}),l(()=>{if(u.current&&c.current){let i=u.current.getOriginalEditor(),f=h(c.current,e||\"\",t||n||\"text\",m||\"\");f!==i.getModel()&&i.setModel(f)}},[m],M),l(()=>{if(u.current&&c.current){let i=u.current.getModifiedEditor(),f=h(c.current,r||\"\",a||n||\"text\",E||\"\");f!==i.getModel()&&i.setModel(f)}},[E],M),l(()=>{let i=u.current.getModifiedEditor();i.getOption(c.current.editor.EditorOption.readOnly)?i.setValue(r||\"\"):r!==i.getValue()&&(i.executeEdits(\"\",[{range:i.getModel().getFullModelRange(),text:r||\"\",forceMoveMarkers:!0}]),i.pushUndoStop())},[r],M),l(()=>{u.current?.getModel()?.original.setValue(e||\"\")},[e],M),l(()=>{let{original:i,modified:f}=u.current.getModel();c.current.editor.setModelLanguage(i,t||n||\"text\"),c.current.editor.setModelLanguage(f,a||n||\"text\")},[n,t,a],M),l(()=>{c.current?.editor.setTheme(x)},[x],M),l(()=>{u.current?.updateOptions(y)},[y],M);let L=oe(()=>{if(!c.current)return;o.current(c.current);let i=h(c.current,e||\"\",t||n||\"text\",m||\"\"),f=h(c.current,r||\"\",a||n||\"text\",E||\"\");u.current?.setModel({original:i,modified:f})},[n,r,a,e,t,m,E]),U=oe(()=>{!b.current&&w.current&&(u.current=c.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...y}),L(),c.current?.editor.setTheme(x),O(!0),b.current=!0)},[y,x,L]);ne(()=>{M&&d.current(u.current,c.current)},[M]),ne(()=>{!T&&!M&&U()},[T,M,U]);function I(){let i=u.current?.getModel();g||i?.original?.dispose(),N||i?.modified?.dispose(),u.current?.dispose()}return ke.createElement(H,{width:z,height:V,isEditorReady:M,loading:P,_ref:w,className:F,wrapperProps:j})}var ie=Oe;var we=Te(ie);import{useState as Ie}from\"react\";import ce from\"@monaco-editor/loader\";function Pe(){let[e,r]=Ie(ce.__getMonacoInstance());return k(()=>{let n;return e||(n=ce.init(),n.then(t=>{r(t)})),()=>n?.cancel()}),e}var Le=Pe;import{memo as ze}from\"react\";import We,{useState as ue,useEffect as W,useRef as C,useCallback as _e}from\"react\";import Ne from\"@monaco-editor/loader\";import{useEffect as Ue,useRef as ve}from\"react\";function He(e){let r=ve();return Ue(()=>{r.current=e},[e]),r.current}var se=He;var _=new Map;function Ve({defaultValue:e,defaultLanguage:r,defaultPath:n,value:t,language:a,path:m,theme:E=\"light\",line:g,loading:N=\"Loading...\",options:x={},overrideServices:P={},saveViewState:y=!0,keepCurrentModel:V=!1,width:z=\"100%\",height:F=\"100%\",className:j,wrapperProps:A={},beforeMount:q=D,onMount:M=D,onChange:O,onValidate:T=D}){let[s,u]=ue(!1),[c,w]=ue(!0),d=C(null),o=C(null),b=C(null),L=C(M),U=C(q),I=C(),i=C(t),f=se(m),Q=C(!1),B=C(!1);k(()=>{let p=Ne.init();return p.then(R=>(d.current=R)&&w(!1)).catch(R=>R?.type!==\"cancelation\"&&console.error(\"Monaco initialization: error:\",R)),()=>o.current?pe():p.cancel()}),l(()=>{let p=h(d.current,e||t||\"\",r||a||\"\",m||n||\"\");p!==o.current?.getModel()&&(y&&_.set(f,o.current?.saveViewState()),o.current?.setModel(p),y&&o.current?.restoreViewState(_.get(m)))},[m],s),l(()=>{o.current?.updateOptions(x)},[x],s),l(()=>{!o.current||t===void 0||(o.current.getOption(d.current.editor.EditorOption.readOnly)?o.current.setValue(t):t!==o.current.getValue()&&(B.current=!0,o.current.executeEdits(\"\",[{range:o.current.getModel().getFullModelRange(),text:t,forceMoveMarkers:!0}]),o.current.pushUndoStop(),B.current=!1))},[t],s),l(()=>{let p=o.current?.getModel();p&&a&&d.current?.editor.setModelLanguage(p,a)},[a],s),l(()=>{g!==void 0&&o.current?.revealLine(g)},[g],s),l(()=>{d.current?.editor.setTheme(E)},[E],s);let X=_e(()=>{if(!(!b.current||!d.current)&&!Q.current){U.current(d.current);let p=m||n,R=h(d.current,t||e||\"\",r||a||\"\",p||\"\");o.current=d.current?.editor.create(b.current,{model:R,automaticLayout:!0,...x},P),y&&o.current.restoreViewState(_.get(p)),d.current.editor.setTheme(E),g!==void 0&&o.current.revealLine(g),u(!0),Q.current=!0}},[e,r,n,t,a,m,x,P,y,E,g]);W(()=>{s&&L.current(o.current,d.current)},[s]),W(()=>{!c&&!s&&X()},[c,s,X]),i.current=t,W(()=>{s&&O&&(I.current?.dispose(),I.current=o.current?.onDidChangeModelContent(p=>{B.current||O(o.current.getValue(),p)}))},[s,O]),W(()=>{if(s){let p=d.current.editor.onDidChangeMarkers(R=>{let G=o.current.getModel()?.uri;if(G&&R.find(J=>J.path===G.path)){let J=d.current.editor.getModelMarkers({resource:G});T?.(J)}});return()=>{p?.dispose()}}return()=>{}},[s,T]);function pe(){I.current?.dispose(),V?y&&_.set(m,o.current.saveViewState()):o.current.getModel()?.dispose(),o.current.dispose()}return We.createElement(H,{width:z,height:F,isEditorReady:s,loading:N,_ref:b,className:j,wrapperProps:A})}var fe=Ve;var de=ze(fe);var Ft=de;export{we as DiffEditor,de as Editor,Ft as default,_t as loader,Le as useMonaco};\n//# sourceMappingURL=index.mjs.map","import {asciiAlphanumeric} from 'micromark-util-character'\nimport {encode} from 'micromark-util-encode'\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri`).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * A regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or\n * `/^https?$/i` for `img[src]` (this is what `github.com` allows).\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string | undefined} url\n * URI to sanitize.\n * @param {RegExp | null | undefined} [protocol]\n * Allowed protocols.\n * @returns {string}\n * Sanitized URI.\n */\nexport function sanitizeUri(url, protocol) {\n const value = encode(normalizeUri(url || ''))\n if (!protocol) {\n return value\n }\n const colon = value.indexOf(':')\n const questionMark = value.indexOf('?')\n const numberSign = value.indexOf('#')\n const slash = value.indexOf('/')\n if (\n // If there is no protocol, it’s relative.\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash > -1 && colon > slash) ||\n (questionMark > -1 && colon > questionMark) ||\n (numberSign > -1 && colon > numberSign) ||\n // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))\n ) {\n return value\n }\n return ''\n}\n\n/**\n * Normalize a URL.\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * URI to normalize.\n * @returns {string}\n * Normalized URI.\n */\nexport function normalizeUri(value) {\n /** @type {Array} */\n const result = []\n let index = -1\n let start = 0\n let skip = 0\n while (++index < value.length) {\n const code = value.charCodeAt(index)\n /** @type {string} */\n let replace = ''\n\n // A correct percent encoded value.\n if (\n code === 37 &&\n asciiAlphanumeric(value.charCodeAt(index + 1)) &&\n asciiAlphanumeric(value.charCodeAt(index + 2))\n ) {\n skip = 2\n }\n // ASCII.\n else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code)\n }\n }\n // Astral.\n else if (code > 55295 && code < 57344) {\n const next = value.charCodeAt(index + 1)\n\n // A correct surrogate pair.\n if (code < 56320 && next > 56319 && next < 57344) {\n replace = String.fromCharCode(code, next)\n skip = 1\n }\n // Lone surrogate.\n else {\n replace = '\\uFFFD'\n }\n }\n // Unicode.\n else {\n replace = String.fromCharCode(code)\n }\n if (replace) {\n result.push(value.slice(start, index), encodeURIComponent(replace))\n start = index + skip + 1\n replace = ''\n }\n if (skip) {\n index += skip\n skip = 0\n }\n }\n return result.join('') + value.slice(start)\n}\n","/**\n * @typedef {import('unist').Position} Position\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n */\n\n/**\n * Get the starting point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointStart = point('start')\n\n/**\n * Get the ending point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointEnd = point('end')\n\n/**\n * Get the positional info of `node`.\n *\n * @param {NodeLike | Node | null | undefined} [node]\n * Node.\n * @returns {Position}\n * Position.\n */\nexport function position(node) {\n return {start: pointStart(node), end: pointEnd(node)}\n}\n\n/**\n * Get the positional info of `node`.\n *\n * @param {'start' | 'end'} type\n * Side.\n * @returns\n * Getter.\n */\nfunction point(type) {\n return point\n\n /**\n * Get the point info of `node` at a bound side.\n *\n * @param {NodeLike | Node | null | undefined} [node]\n * @returns {Point}\n */\n function point(node) {\n const point = (node && node.position && node.position[type]) || {}\n\n // To do: next major: don’t return points when invalid.\n return {\n // @ts-expect-error: in practice, null is allowed.\n line: point.line || null,\n // @ts-expect-error: in practice, null is allowed.\n column: point.column || null,\n // @ts-expect-error: in practice, null is allowed.\n offset: point.offset > -1 ? point.offset : null\n }\n }\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Definition} Definition\n */\n\n/**\n * @typedef {Root | Content} Node\n *\n * @callback GetDefinition\n * Get a definition by identifier.\n * @param {string | null | undefined} [identifier]\n * Identifier of definition.\n * @returns {Definition | null}\n * Definition corresponding to `identifier` or `null`.\n */\n\nimport {visit} from 'unist-util-visit'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Find definitions in `tree`.\n *\n * Uses CommonMark precedence, which means that earlier definitions are\n * preferred over duplicate later definitions.\n *\n * @param {Node} tree\n * Tree to check.\n * @returns {GetDefinition}\n * Getter.\n */\nexport function definitions(tree) {\n /** @type {Record} */\n const cache = Object.create(null)\n\n if (!tree || !tree.type) {\n throw new Error('mdast-util-definitions expected node')\n }\n\n visit(tree, 'definition', (definition) => {\n const id = clean(definition.identifier)\n if (id && !own.call(cache, id)) {\n cache[id] = definition\n }\n })\n\n return definition\n\n /** @type {GetDefinition} */\n function definition(identifier) {\n const id = clean(identifier)\n // To do: next major: return `undefined` when not found.\n return id && own.call(cache, id) ? cache[id] : null\n }\n}\n\n/**\n * @param {string | null | undefined} [value]\n * @returns {string}\n */\nfunction clean(value) {\n return String(value || '').toUpperCase()\n}\n","/**\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('hast').Element} Element\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `footnoteReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {FootnoteReference} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function footnoteReference(state, node) {\n const id = String(node.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n const index = state.footnoteOrder.indexOf(id)\n /** @type {number} */\n let counter\n\n if (index === -1) {\n state.footnoteOrder.push(id)\n state.footnoteCounts[id] = 1\n counter = state.footnoteOrder.length\n } else {\n state.footnoteCounts[id]++\n counter = index + 1\n }\n\n const reuseCounter = state.footnoteCounts[id]\n\n /** @type {Element} */\n const link = {\n type: 'element',\n tagName: 'a',\n properties: {\n href: '#' + state.clobberPrefix + 'fn-' + safeId,\n id:\n state.clobberPrefix +\n 'fnref-' +\n safeId +\n (reuseCounter > 1 ? '-' + reuseCounter : ''),\n dataFootnoteRef: true,\n ariaDescribedBy: ['footnote-label']\n },\n children: [{type: 'text', value: String(counter)}]\n }\n state.patch(node, link)\n\n /** @type {Element} */\n const sup = {\n type: 'element',\n tagName: 'sup',\n properties: {},\n children: [link]\n }\n state.patch(node, sup)\n return state.applyData(node, sup)\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Reference} Reference\n * @typedef {import('mdast').Root} Root\n *\n * @typedef {import('./state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} References\n */\n\n// To do: next major: always return array.\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @param {State} state\n * Info passed around.\n * @param {References} node\n * Reference node (image, link).\n * @returns {ElementContent | Array}\n * hast content.\n */\nexport function revert(state, node) {\n const subtype = node.referenceType\n let suffix = ']'\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return {type: 'text', value: '![' + node.alt + suffix}\n }\n\n const contents = state.all(node)\n const head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift({type: 'text', value: '['})\n }\n\n const tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push({type: 'text', value: suffix})\n }\n\n return contents\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} Parents\n */\n\n/**\n * Turn an mdast `listItem` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ListItem} node\n * mdast node.\n * @param {Parents | null | undefined} parent\n * Parent of `node`.\n * @returns {Element}\n * hast node.\n */\nexport function listItem(state, node, parent) {\n const results = state.all(node)\n const loose = parent ? listLoose(parent) : listItemLoose(node)\n /** @type {Properties} */\n const properties = {}\n /** @type {Array} */\n const children = []\n\n if (typeof node.checked === 'boolean') {\n const head = results[0]\n /** @type {Element} */\n let paragraph\n\n if (head && head.type === 'element' && head.tagName === 'p') {\n paragraph = head\n } else {\n paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}\n results.unshift(paragraph)\n }\n\n if (paragraph.children.length > 0) {\n paragraph.children.unshift({type: 'text', value: ' '})\n }\n\n paragraph.children.unshift({\n type: 'element',\n tagName: 'input',\n properties: {type: 'checkbox', checked: node.checked, disabled: true},\n children: []\n })\n\n // According to github-markdown-css, this class hides bullet.\n // See: .\n properties.className = ['task-list-item']\n }\n\n let index = -1\n\n while (++index < results.length) {\n const child = results[index]\n\n // Add eols before nodes, except if this is a loose, first paragraph.\n if (\n loose ||\n index !== 0 ||\n child.type !== 'element' ||\n child.tagName !== 'p'\n ) {\n children.push({type: 'text', value: '\\n'})\n }\n\n if (child.type === 'element' && child.tagName === 'p' && !loose) {\n children.push(...child.children)\n } else {\n children.push(child)\n }\n }\n\n const tail = results[results.length - 1]\n\n // Add a final eol.\n if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {\n children.push({type: 'text', value: '\\n'})\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'li', properties, children}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * @param {Parents} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n let loose = false\n if (node.type === 'list') {\n loose = node.spread || false\n const children = node.children\n let index = -1\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index])\n }\n }\n\n return loose\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n const spread = node.spread\n\n return spread === undefined || spread === null\n ? node.children.length > 1\n : spread\n}\n","const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Trimmed value.\n */\nexport function trimLines(value) {\n const source = String(value)\n const search = /\\r?\\n|\\r/g\n let match = search.exec(source)\n let last = 0\n /** @type {Array} */\n const lines = []\n\n while (match) {\n lines.push(\n trimLine(source.slice(last, match.index), last > 0, true),\n match[0]\n )\n\n last = match.index + match[0].length\n match = search.exec(source)\n }\n\n lines.push(trimLine(source.slice(last), last > 0, false))\n\n return lines.join('')\n}\n\n/**\n * @param {string} value\n * Line to trim.\n * @param {boolean} start\n * Whether to trim the start of the line.\n * @param {boolean} end\n * Whether to trim the end of the line.\n * @returns {string}\n * Trimmed line.\n */\nfunction trimLine(value, start, end) {\n let startIndex = 0\n let endIndex = value.length\n\n if (start) {\n let code = value.codePointAt(startIndex)\n\n while (code === tab || code === space) {\n startIndex++\n code = value.codePointAt(startIndex)\n }\n }\n\n if (end) {\n let code = value.codePointAt(endIndex - 1)\n\n while (code === tab || code === space) {\n endIndex--\n code = value.codePointAt(endIndex - 1)\n }\n }\n\n return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n","import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {footnote} from './footnote.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {tableRow} from './table-row.js'\nimport {tableCell} from './table-cell.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default handlers for nodes.\n */\nexport const handlers = {\n blockquote,\n break: hardBreak,\n code,\n delete: strikethrough,\n emphasis,\n footnoteReference,\n footnote,\n heading,\n html,\n imageReference,\n image,\n inlineCode,\n linkReference,\n link,\n listItem,\n list,\n paragraph,\n root,\n strong,\n table,\n tableCell,\n tableRow,\n text,\n thematicBreak,\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n // To do: next major: return `undefined`.\n return null\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `blockquote` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Blockquote} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function blockquote(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'blockquote',\n properties: {},\n children: state.wrap(state.all(node), true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').Break} Break\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `break` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Break} node\n * mdast node.\n * @returns {Array}\n * hast element content.\n */\nexport function hardBreak(state, node) {\n /** @type {Element} */\n const result = {type: 'element', tagName: 'br', properties: {}, children: []}\n state.patch(node, result)\n return [state.applyData(node, result), {type: 'text', value: '\\n'}]\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Code} Code\n * @typedef {import('../state.js').State} State\n\n */\n\n/**\n * Turn an mdast `code` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Code} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function code(state, node) {\n const value = node.value ? node.value + '\\n' : ''\n // To do: next major, use `node.lang` w/o regex, the splitting’s been going\n // on for years in remark now.\n const lang = node.lang ? node.lang.match(/^[^ \\t]+(?=[ \\t]|$)/) : null\n /** @type {Properties} */\n const properties = {}\n\n if (lang) {\n properties.className = ['language-' + lang]\n }\n\n // Create ``.\n /** @type {Element} */\n let result = {\n type: 'element',\n tagName: 'code',\n properties,\n children: [{type: 'text', value}]\n }\n\n if (node.meta) {\n result.data = {meta: node.meta}\n }\n\n state.patch(node, result)\n result = state.applyData(node, result)\n\n // Create `
`.\n  result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}\n  state.patch(node, result)\n  return result\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Delete} Delete\n * @typedef {import('../state.js').State} State\n\n */\n\n/**\n * Turn an mdast `delete` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Delete} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strikethrough(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'del',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `emphasis` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Emphasis} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function emphasis(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'em',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Footnote} Footnote\n * @typedef {import('../state.js').State} State\n */\n\nimport {footnoteReference} from './footnote-reference.js'\n\n// To do: when both:\n// * \n// * \n// …are archived, remove this (also from mdast).\n// These inline notes are not used in GFM.\n\n/**\n * Turn an mdast `footnote` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Footnote} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function footnote(state, node) {\n  const footnoteById = state.footnoteById\n  let no = 1\n\n  while (no in footnoteById) no++\n\n  const identifier = String(no)\n\n  footnoteById[identifier] = {\n    type: 'footnoteDefinition',\n    identifier,\n    children: [{type: 'paragraph', children: node.children}],\n    position: node.position\n  }\n\n  return footnoteReference(state, {\n    type: 'footnoteReference',\n    identifier,\n    position: node.position\n  })\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `heading` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Heading} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function heading(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'h' + node.depth,\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').HTML} Html\n * @typedef {import('../state.js').State} State\n * @typedef {import('../../index.js').Raw} Raw\n */\n\n/**\n * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise\n * nothing).\n *\n * @param {State} state\n *   Info passed around.\n * @param {Html} node\n *   mdast node.\n * @returns {Raw | Element | null}\n *   hast node.\n */\nexport function html(state, node) {\n  if (state.dangerous) {\n    /** @type {Raw} */\n    const result = {type: 'raw', value: node.value}\n    state.patch(node, result)\n    return state.applyData(node, result)\n  }\n\n  // To do: next major: return `undefined`.\n  return null\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `imageReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ImageReference} node\n *   mdast node.\n * @returns {ElementContent | Array}\n *   hast node.\n */\nexport function imageReference(state, node) {\n  const def = state.definition(node.identifier)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(def.url || ''), alt: node.alt}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Image} Image\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `image` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Image} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function image(state, node) {\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(node.url)}\n\n  if (node.alt !== null && node.alt !== undefined) {\n    properties.alt = node.alt\n  }\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `inlineCode` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {InlineCode} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function inlineCode(state, node) {\n  /** @type {Text} */\n  const text = {type: 'text', value: node.value.replace(/\\r?\\n|\\r/g, ' ')}\n  state.patch(node, text)\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'code',\n    properties: {},\n    children: [text]\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `linkReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {LinkReference} node\n *   mdast node.\n * @returns {ElementContent | Array}\n *   hast node.\n */\nexport function linkReference(state, node) {\n  const def = state.definition(node.identifier)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(def.url || '')}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Link} Link\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `link` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Link} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function link(state, node) {\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(node.url)}\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').List} List\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `list` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {List} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function list(state, node) {\n  /** @type {Properties} */\n  const properties = {}\n  const results = state.all(node)\n  let index = -1\n\n  if (typeof node.start === 'number' && node.start !== 1) {\n    properties.start = node.start\n  }\n\n  // Like GitHub, add a class for custom styling.\n  while (++index < results.length) {\n    const child = results[index]\n\n    if (\n      child.type === 'element' &&\n      child.tagName === 'li' &&\n      child.properties &&\n      Array.isArray(child.properties.className) &&\n      child.properties.className.includes('task-list-item')\n    ) {\n      properties.className = ['contains-task-list']\n      break\n    }\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: node.ordered ? 'ol' : 'ul',\n    properties,\n    children: state.wrap(results, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `paragraph` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Paragraph} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function paragraph(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'p',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `root` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastRoot} node\n *   mdast node.\n * @returns {HastRoot | HastElement}\n *   hast node.\n */\nexport function root(state, node) {\n  /** @type {HastRoot} */\n  const result = {type: 'root', children: state.wrap(state.all(node))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `strong` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Strong} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strong(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'strong',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Table} Table\n * @typedef {import('../state.js').State} State\n */\n\nimport {pointStart, pointEnd} from 'unist-util-position'\n\n/**\n * Turn an mdast `table` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Table} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function table(state, node) {\n  const rows = state.all(node)\n  const firstRow = rows.shift()\n  /** @type {Array} */\n  const tableContent = []\n\n  if (firstRow) {\n    /** @type {Element} */\n    const head = {\n      type: 'element',\n      tagName: 'thead',\n      properties: {},\n      children: state.wrap([firstRow], true)\n    }\n    state.patch(node.children[0], head)\n    tableContent.push(head)\n  }\n\n  if (rows.length > 0) {\n    /** @type {Element} */\n    const body = {\n      type: 'element',\n      tagName: 'tbody',\n      properties: {},\n      children: state.wrap(rows, true)\n    }\n\n    const start = pointStart(node.children[1])\n    const end = pointEnd(node.children[node.children.length - 1])\n    if (start.line && end.line) body.position = {start, end}\n    tableContent.push(body)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'table',\n    properties: {},\n    children: state.wrap(tableContent, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `tableCell` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableCell} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function tableCell(state, node) {\n  // Note: this function is normally not called: see `table-row` for how rows\n  // and their cells are compiled.\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'td', // Assume body cell.\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').TableRow} TableRow\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * @typedef {Root | Content} Nodes\n * @typedef {Extract} Parents\n */\n\n/**\n * Turn an mdast `tableRow` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableRow} node\n *   mdast node.\n * @param {Parents | null | undefined} parent\n *   Parent of `node`.\n * @returns {Element}\n *   hast node.\n */\nexport function tableRow(state, node, parent) {\n  const siblings = parent ? parent.children : undefined\n  // Generate a body row when without parent.\n  const rowIndex = siblings ? siblings.indexOf(node) : 1\n  const tagName = rowIndex === 0 ? 'th' : 'td'\n  const align = parent && parent.type === 'table' ? parent.align : undefined\n  const length = align ? align.length : node.children.length\n  let cellIndex = -1\n  /** @type {Array} */\n  const cells = []\n\n  while (++cellIndex < length) {\n    // Note: can also be undefined.\n    const cell = node.children[cellIndex]\n    /** @type {Properties} */\n    const properties = {}\n    const alignValue = align ? align[cellIndex] : undefined\n\n    if (alignValue) {\n      properties.align = alignValue\n    }\n\n    /** @type {Element} */\n    let result = {type: 'element', tagName, properties, children: []}\n\n    if (cell) {\n      result.children = state.all(cell)\n      state.patch(cell, result)\n      result = state.applyData(node, result)\n    }\n\n    cells.push(result)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'tr',\n    properties: {},\n    children: state.wrap(cells, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').Text} HastText\n * @typedef {import('mdast').Text} MdastText\n * @typedef {import('../state.js').State} State\n */\n\nimport {trimLines} from 'trim-lines'\n\n/**\n * Turn an mdast `text` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastText} node\n *   mdast node.\n * @returns {HastText | HastElement}\n *   hast node.\n */\nexport function text(state, node) {\n  /** @type {HastText} */\n  const result = {type: 'text', value: trimLines(String(node.value))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('../state.js').State} State\n */\n\n/**\n * Turn an mdast `thematicBreak` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ThematicBreak} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function thematicBreak(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'hr',\n    properties: {},\n    children: []\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Content} HastContent\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').ElementContent} HastElementContent\n * @typedef {import('hast').Properties} HastProperties\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('hast').Text} HastText\n *\n * @typedef {import('mdast').Content} MdastContent\n * @typedef {import('mdast').Definition} MdastDefinition\n * @typedef {import('mdast').FootnoteDefinition} MdastFootnoteDefinition\n * @typedef {import('mdast').Parent} MdastParent\n * @typedef {import('mdast').Root} MdastRoot\n */\n\n/**\n * @typedef {HastRoot | HastContent} HastNodes\n * @typedef {MdastRoot | MdastContent} MdastNodes\n * @typedef {Extract} MdastParents\n *\n * @typedef EmbeddedHastFields\n *   hast fields.\n * @property {string | null | undefined} [hName]\n *   Generate a specific element with this tag name instead.\n * @property {HastProperties | null | undefined} [hProperties]\n *   Generate an element with these properties instead.\n * @property {Array | null | undefined} [hChildren]\n *   Generate an element with this content instead.\n *\n * @typedef {Record & EmbeddedHastFields} MdastData\n *   mdast data with embedded hast fields.\n *\n * @typedef {MdastNodes & {data?: MdastData | null | undefined}} MdastNodeWithData\n *   mdast node with embedded hast data.\n *\n * @typedef PointLike\n *   Point-like value.\n * @property {number | null | undefined} [line]\n *   Line.\n * @property {number | null | undefined} [column]\n *   Column.\n * @property {number | null | undefined} [offset]\n *   Offset.\n *\n * @typedef PositionLike\n *   Position-like value.\n * @property {PointLike | null | undefined} [start]\n *   Point-like value.\n * @property {PointLike | null | undefined} [end]\n *   Point-like value.\n *\n * @callback Handler\n *   Handle a node.\n * @param {State} state\n *   Info passed around.\n * @param {any} node\n *   mdast node to handle.\n * @param {MdastParents | null | undefined} parent\n *   Parent of `node`.\n * @returns {HastElementContent | Array | null | undefined}\n *   hast node.\n *\n * @callback HFunctionProps\n *   Signature of `state` for when props are passed.\n * @param {MdastNodes | PositionLike | null | undefined} node\n *   mdast node or unist position.\n * @param {string} tagName\n *   HTML tag name.\n * @param {HastProperties} props\n *   Properties.\n * @param {Array | null | undefined} [children]\n *   hast content.\n * @returns {HastElement}\n *   Compiled element.\n *\n * @callback HFunctionNoProps\n *   Signature of `state` for when no props are passed.\n * @param {MdastNodes | PositionLike | null | undefined} node\n *   mdast node or unist position.\n * @param {string} tagName\n *   HTML tag name.\n * @param {Array | null | undefined} [children]\n *   hast content.\n * @returns {HastElement}\n *   Compiled element.\n *\n * @typedef HFields\n *   Info on `state`.\n * @property {boolean} dangerous\n *   Whether HTML is allowed.\n * @property {string} clobberPrefix\n *   Prefix to use to prevent DOM clobbering.\n * @property {string} footnoteLabel\n *   Label to use to introduce the footnote section.\n * @property {string} footnoteLabelTagName\n *   HTML used for the footnote label.\n * @property {HastProperties} footnoteLabelProperties\n *   Properties on the HTML tag used for the footnote label.\n * @property {string} footnoteBackLabel\n *   Label to use from backreferences back to their footnote call.\n * @property {(identifier: string) => MdastDefinition | null} definition\n *   Definition cache.\n * @property {Record} footnoteById\n *   Footnote definitions by their identifier.\n * @property {Array} footnoteOrder\n *   Identifiers of order when footnote calls first appear in tree order.\n * @property {Record} footnoteCounts\n *   Counts for how often the same footnote was called.\n * @property {Handlers} handlers\n *   Applied handlers.\n * @property {Handler} unknownHandler\n *   Handler for any none not in `passThrough` or otherwise handled.\n * @property {(from: MdastNodes, node: HastNodes) => void} patch\n *   Copy a node’s positional info.\n * @property {(from: MdastNodes, to: Type) => Type | HastElement} applyData\n *   Honor the `data` of `from`, and generate an element instead of `node`.\n * @property {(node: MdastNodes, parent: MdastParents | null | undefined) => HastElementContent | Array | null | undefined} one\n *   Transform an mdast node to hast.\n * @property {(node: MdastNodes) => Array} all\n *   Transform the children of an mdast parent to hast.\n * @property {(nodes: Array, loose?: boolean | null | undefined) => Array} wrap\n *   Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.\n * @property {(left: MdastNodeWithData | PositionLike | null | undefined, right: HastElementContent) => HastElementContent} augment\n *   Like `state` but lower-level and usable on non-elements.\n *   Deprecated: use `patch` and `applyData`.\n * @property {Array} passThrough\n *   List of node types to pass through untouched (except for their children).\n *\n * @typedef Options\n *   Configuration (optional).\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n *   Whether to persist raw HTML in markdown in the hast tree.\n * @property {string | null | undefined} [clobberPrefix='user-content-']\n *   Prefix to use before the `id` attribute on footnotes to prevent it from\n *   *clobbering*.\n * @property {string | null | undefined} [footnoteBackLabel='Back to content']\n *   Label to use from backreferences back to their footnote call (affects\n *   screen readers).\n * @property {string | null | undefined} [footnoteLabel='Footnotes']\n *   Label to use for the footnotes section (affects screen readers).\n * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]\n *   Properties to use on the footnote label (note that `id: 'footnote-label'`\n *   is always added as footnote calls use it with `aria-describedby` to\n *   provide an accessible label).\n * @property {string | null | undefined} [footnoteLabelTagName='h2']\n *   Tag name to use for the footnote label.\n * @property {Handlers | null | undefined} [handlers]\n *   Extra handlers for nodes.\n * @property {Array | null | undefined} [passThrough]\n *   List of custom mdast node types to pass through (keep) in hast (note that\n *   the node itself is passed, but eventual children are transformed).\n * @property {Handler | null | undefined} [unknownHandler]\n *   Handler for all unknown nodes.\n *\n * @typedef {Record} Handlers\n *   Handle nodes.\n *\n * @typedef {HFunctionProps & HFunctionNoProps & HFields} State\n *   Info passed around.\n */\n\nimport {visit} from 'unist-util-visit'\nimport {position, pointStart, pointEnd} from 'unist-util-position'\nimport {generated} from 'unist-util-generated'\nimport {definitions} from 'mdast-util-definitions'\nimport {handlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Create `state` from an mdast tree.\n *\n * @param {MdastNodes} tree\n *   mdast node to transform.\n * @param {Options | null | undefined} [options]\n *   Configuration.\n * @returns {State}\n *   `state` function.\n */\nexport function createState(tree, options) {\n  const settings = options || {}\n  const dangerous = settings.allowDangerousHtml || false\n  /** @type {Record} */\n  const footnoteById = {}\n\n  // To do: next major: add `options` to state, remove:\n  // `dangerous`, `clobberPrefix`, `footnoteLabel`, `footnoteLabelTagName`,\n  // `footnoteLabelProperties`, `footnoteBackLabel`, `passThrough`,\n  // `unknownHandler`.\n\n  // To do: next major: move to `state.options.allowDangerousHtml`.\n  state.dangerous = dangerous\n  // To do: next major: move to `state.options`.\n  state.clobberPrefix =\n    settings.clobberPrefix === undefined || settings.clobberPrefix === null\n      ? 'user-content-'\n      : settings.clobberPrefix\n  // To do: next major: move to `state.options`.\n  state.footnoteLabel = settings.footnoteLabel || 'Footnotes'\n  // To do: next major: move to `state.options`.\n  state.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2'\n  // To do: next major: move to `state.options`.\n  state.footnoteLabelProperties = settings.footnoteLabelProperties || {\n    className: ['sr-only']\n  }\n  // To do: next major: move to `state.options`.\n  state.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'\n  // To do: next major: move to `state.options`.\n  state.unknownHandler = settings.unknownHandler\n  // To do: next major: move to `state.options`.\n  state.passThrough = settings.passThrough\n\n  state.handlers = {...handlers, ...settings.handlers}\n\n  // To do: next major: replace utility with `definitionById` object, so we\n  // only walk once (as we need footnotes too).\n  state.definition = definitions(tree)\n  state.footnoteById = footnoteById\n  /** @type {Array} */\n  state.footnoteOrder = []\n  /** @type {Record} */\n  state.footnoteCounts = {}\n\n  state.patch = patch\n  state.applyData = applyData\n  state.one = oneBound\n  state.all = allBound\n  state.wrap = wrap\n  // To do: next major: remove `augment`.\n  state.augment = augment\n\n  visit(tree, 'footnoteDefinition', (definition) => {\n    const id = String(definition.identifier).toUpperCase()\n\n    // Mimick CM behavior of link definitions.\n    // See: .\n    if (!own.call(footnoteById, id)) {\n      footnoteById[id] = definition\n    }\n  })\n\n  // @ts-expect-error Hush, it’s fine!\n  return state\n\n  /**\n   * Finalise the created `right`, a hast node, from `left`, an mdast node.\n   *\n   * @param {MdastNodeWithData | PositionLike | null | undefined} left\n   * @param {HastElementContent} right\n   * @returns {HastElementContent}\n   */\n  /* c8 ignore start */\n  // To do: next major: remove.\n  function augment(left, right) {\n    // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n    if (left && 'data' in left && left.data) {\n      /** @type {MdastData} */\n      const data = left.data\n\n      if (data.hName) {\n        if (right.type !== 'element') {\n          right = {\n            type: 'element',\n            tagName: '',\n            properties: {},\n            children: []\n          }\n        }\n\n        right.tagName = data.hName\n      }\n\n      if (right.type === 'element' && data.hProperties) {\n        right.properties = {...right.properties, ...data.hProperties}\n      }\n\n      if ('children' in right && right.children && data.hChildren) {\n        right.children = data.hChildren\n      }\n    }\n\n    if (left) {\n      const ctx = 'type' in left ? left : {position: left}\n\n      if (!generated(ctx)) {\n        // @ts-expect-error: fine.\n        right.position = {start: pointStart(ctx), end: pointEnd(ctx)}\n      }\n    }\n\n    return right\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Create an element for `node`.\n   *\n   * @type {HFunctionProps}\n   */\n  /* c8 ignore start */\n  // To do: next major: remove.\n  function state(node, tagName, props, children) {\n    if (Array.isArray(props)) {\n      children = props\n      props = {}\n    }\n\n    // @ts-expect-error augmenting an element yields an element.\n    return augment(node, {\n      type: 'element',\n      tagName,\n      properties: props || {},\n      children: children || []\n    })\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Transform an mdast node into a hast node.\n   *\n   * @param {MdastNodes} node\n   *   mdast node.\n   * @param {MdastParents | null | undefined} [parent]\n   *   Parent of `node`.\n   * @returns {HastElementContent | Array | null | undefined}\n   *   Resulting hast node.\n   */\n  function oneBound(node, parent) {\n    // @ts-expect-error: that’s a state :)\n    return one(state, node, parent)\n  }\n\n  /**\n   * Transform the children of an mdast node into hast nodes.\n   *\n   * @param {MdastNodes} parent\n   *   mdast node to compile\n   * @returns {Array}\n   *   Resulting hast nodes.\n   */\n  function allBound(parent) {\n    // @ts-expect-error: that’s a state :)\n    return all(state, parent)\n  }\n}\n\n/**\n * Copy a node’s positional info.\n *\n * @param {MdastNodes} from\n *   mdast node to copy from.\n * @param {HastNodes} to\n *   hast node to copy into.\n * @returns {void}\n *   Nothing.\n */\nfunction patch(from, to) {\n  if (from.position) to.position = position(from)\n}\n\n/**\n * Honor the `data` of `from` and maybe generate an element instead of `to`.\n *\n * @template {HastNodes} Type\n *   Node type.\n * @param {MdastNodes} from\n *   mdast node to use data from.\n * @param {Type} to\n *   hast node to change.\n * @returns {Type | HastElement}\n *   Nothing.\n */\nfunction applyData(from, to) {\n  /** @type {Type | HastElement} */\n  let result = to\n\n  // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n  if (from && from.data) {\n    const hName = from.data.hName\n    const hChildren = from.data.hChildren\n    const hProperties = from.data.hProperties\n\n    if (typeof hName === 'string') {\n      // Transforming the node resulted in an element with a different name\n      // than wanted:\n      if (result.type === 'element') {\n        result.tagName = hName\n      }\n      // Transforming the node resulted in a non-element, which happens for\n      // raw, text, and root nodes (unless custom handlers are passed).\n      // The intent is likely to keep the content around (otherwise: pass\n      // `hChildren`).\n      else {\n        result = {\n          type: 'element',\n          tagName: hName,\n          properties: {},\n          children: []\n        }\n\n        // To do: next major: take the children from the `root`, or inject the\n        // raw/text/comment or so into the element?\n        // if ('children' in node) {\n        //   // @ts-expect-error: assume `children` are allowed in elements.\n        //   result.children = node.children\n        // } else {\n        //   // @ts-expect-error: assume `node` is allowed in elements.\n        //   result.children.push(node)\n        // }\n      }\n    }\n\n    if (result.type === 'element' && hProperties) {\n      result.properties = {...result.properties, ...hProperties}\n    }\n\n    if (\n      'children' in result &&\n      result.children &&\n      hChildren !== null &&\n      hChildren !== undefined\n    ) {\n      // @ts-expect-error: assume valid children are defined.\n      result.children = hChildren\n    }\n  }\n\n  return result\n}\n\n/**\n * Transform an mdast node into a hast node.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} node\n *   mdast node.\n * @param {MdastParents | null | undefined} [parent]\n *   Parent of `node`.\n * @returns {HastElementContent | Array | null | undefined}\n *   Resulting hast node.\n */\n// To do: next major: do not expose, keep bound.\nexport function one(state, node, parent) {\n  const type = node && node.type\n\n  // Fail on non-nodes.\n  if (!type) {\n    throw new Error('Expected node, got `' + node + '`')\n  }\n\n  if (own.call(state.handlers, type)) {\n    return state.handlers[type](state, node, parent)\n  }\n\n  if (state.passThrough && state.passThrough.includes(type)) {\n    // To do: next major: deep clone.\n    // @ts-expect-error: types of passed through nodes are expected to be added manually.\n    return 'children' in node ? {...node, children: all(state, node)} : node\n  }\n\n  if (state.unknownHandler) {\n    return state.unknownHandler(state, node, parent)\n  }\n\n  return defaultUnknownHandler(state, node)\n}\n\n/**\n * Transform the children of an mdast node into hast nodes.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} parent\n *   mdast node to compile\n * @returns {Array}\n *   Resulting hast nodes.\n */\n// To do: next major: do not expose, keep bound.\nexport function all(state, parent) {\n  /** @type {Array} */\n  const values = []\n\n  if ('children' in parent) {\n    const nodes = parent.children\n    let index = -1\n    while (++index < nodes.length) {\n      const result = one(state, nodes[index], parent)\n\n      // To do: see if we van clean this? Can we merge texts?\n      if (result) {\n        if (index && nodes[index - 1].type === 'break') {\n          if (!Array.isArray(result) && result.type === 'text') {\n            result.value = result.value.replace(/^\\s+/, '')\n          }\n\n          if (!Array.isArray(result) && result.type === 'element') {\n            const head = result.children[0]\n\n            if (head && head.type === 'text') {\n              head.value = head.value.replace(/^\\s+/, '')\n            }\n          }\n        }\n\n        if (Array.isArray(result)) {\n          values.push(...result)\n        } else {\n          values.push(result)\n        }\n      }\n    }\n  }\n\n  return values\n}\n\n/**\n * Transform an unknown node.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastNodes} node\n *   Unknown mdast node.\n * @returns {HastText | HastElement}\n *   Resulting hast node.\n */\nfunction defaultUnknownHandler(state, node) {\n  const data = node.data || {}\n  /** @type {HastText | HastElement} */\n  const result =\n    'value' in node &&\n    !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))\n      ? {type: 'text', value: node.value}\n      : {\n          type: 'element',\n          tagName: 'div',\n          properties: {},\n          children: all(state, node)\n        }\n\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n\n/**\n * Wrap `nodes` with line endings between each node.\n *\n * @template {HastContent} Type\n *   Node type.\n * @param {Array} nodes\n *   List of nodes to wrap.\n * @param {boolean | null | undefined} [loose=false]\n *   Whether to add line endings at start and end.\n * @returns {Array}\n *   Wrapped nodes.\n */\nexport function wrap(nodes, loose) {\n  /** @type {Array} */\n  const result = []\n  let index = -1\n\n  if (loose) {\n    result.push({type: 'text', value: '\\n'})\n  }\n\n  while (++index < nodes.length) {\n    if (index) result.push({type: 'text', value: '\\n'})\n    result.push(nodes[index])\n  }\n\n  if (loose && nodes.length > 0) {\n    result.push({type: 'text', value: '\\n'})\n  }\n\n  return result\n}\n","/**\n * @typedef {import('hast').Content} HastContent\n * @typedef {import('hast').Root} HastRoot\n *\n * @typedef {import('mdast').Content} MdastContent\n * @typedef {import('mdast').Root} MdastRoot\n *\n * @typedef {import('./state.js').Options} Options\n */\n\n/**\n * @typedef {HastRoot | HastContent} HastNodes\n * @typedef {MdastRoot | MdastContent} MdastNodes\n */\n\nimport {footer} from './footer.js'\nimport {createState} from './state.js'\n\n/**\n * Transform mdast to hast.\n *\n * ##### Notes\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most utilities ignore `raw` nodes but two notable ones don’t:\n *\n * *   `hast-util-to-html` also has an option `allowDangerousHtml` which will\n *     output the raw HTML.\n *     This is typically discouraged as noted by the option name but is useful\n *     if you completely trust authors\n * *   `hast-util-raw` can handle the raw embedded HTML strings by parsing them\n *     into standard hast nodes (`element`, `text`, etc).\n *     This is a heavy task as it needs a full HTML parser, but it is the only\n *     way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `mdast-util-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * 

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * Example: headings (DOM clobbering) in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn’t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `
` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {HastNodes | null | undefined}\n * hast tree.\n */\n// To do: next major: always return a single `root`.\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, null)\n const foot = footer(state)\n\n if (foot) {\n // @ts-expect-error If there’s a footer, there were definitions, meaning block\n // content.\n // So assume `node` is a parent node.\n node.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n // To do: next major: always return root?\n return Array.isArray(node) ? {type: 'root', children: node} : node\n}\n","/**\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef NodeLike\n * @property {PositionLike | null | undefined} [position]\n */\n\n/**\n * Check if `node` is generated.\n *\n * @param {NodeLike | null | undefined} [node]\n * Node to check.\n * @returns {boolean}\n * Whether `node` is generated (does not have positional info).\n */\nexport function generated(node) {\n return (\n !node ||\n !node.position ||\n !node.position.start ||\n !node.position.start.line ||\n !node.position.start.column ||\n !node.position.end ||\n !node.position.end.line ||\n !node.position.end.column\n )\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('./state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Generate a hast footer for called footnote definitions.\n *\n * @param {State} state\n * Info passed around.\n * @returns {Element | undefined}\n * `section` element or `undefined`.\n */\nexport function footer(state) {\n /** @type {Array} */\n const listItems = []\n let index = -1\n\n while (++index < state.footnoteOrder.length) {\n const def = state.footnoteById[state.footnoteOrder[index]]\n\n if (!def) {\n continue\n }\n\n const content = state.all(def)\n const id = String(def.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n let referenceIndex = 0\n /** @type {Array} */\n const backReferences = []\n\n while (++referenceIndex <= state.footnoteCounts[id]) {\n /** @type {Element} */\n const backReference = {\n type: 'element',\n tagName: 'a',\n properties: {\n href:\n '#' +\n state.clobberPrefix +\n 'fnref-' +\n safeId +\n (referenceIndex > 1 ? '-' + referenceIndex : ''),\n dataFootnoteBackref: true,\n className: ['data-footnote-backref'],\n ariaLabel: state.footnoteBackLabel\n },\n children: [{type: 'text', value: '↩'}]\n }\n\n if (referenceIndex > 1) {\n backReference.children.push({\n type: 'element',\n tagName: 'sup',\n children: [{type: 'text', value: String(referenceIndex)}]\n })\n }\n\n if (backReferences.length > 0) {\n backReferences.push({type: 'text', value: ' '})\n }\n\n backReferences.push(backReference)\n }\n\n const tail = content[content.length - 1]\n\n if (tail && tail.type === 'element' && tail.tagName === 'p') {\n const tailTail = tail.children[tail.children.length - 1]\n if (tailTail && tailTail.type === 'text') {\n tailTail.value += ' '\n } else {\n tail.children.push({type: 'text', value: ' '})\n }\n\n tail.children.push(...backReferences)\n } else {\n content.push(...backReferences)\n }\n\n /** @type {Element} */\n const listItem = {\n type: 'element',\n tagName: 'li',\n properties: {id: state.clobberPrefix + 'fn-' + safeId},\n children: state.wrap(content, true)\n }\n\n state.patch(def, listItem)\n\n listItems.push(listItem)\n }\n\n if (listItems.length === 0) {\n return\n }\n\n return {\n type: 'element',\n tagName: 'section',\n properties: {dataFootnotes: true, className: ['footnotes']},\n children: [\n {\n type: 'element',\n tagName: state.footnoteLabelTagName,\n properties: {\n // To do: use structured clone.\n ...JSON.parse(JSON.stringify(state.footnoteLabelProperties)),\n id: 'footnote-label'\n },\n children: [{type: 'text', value: state.footnoteLabel}]\n },\n {type: 'text', value: '\\n'},\n {\n type: 'element',\n tagName: 'ol',\n properties: {},\n children: state.wrap(listItems, true)\n },\n {type: 'text', value: '\\n'}\n ]\n }\n}\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('mdast-util-to-hast').Options} Options\n * @typedef {import('unified').Processor} Processor\n *\n * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n// Note: the `` overload doesn’t seem to work :'(\n\n/**\n * Plugin that turns markdown into HTML to support rehype.\n *\n * * If a destination processor is given, that processor runs with a new HTML\n * (hast) tree (bridge-mode).\n * As the given processor runs with a hast tree, and rehype plugins support\n * hast, that means rehype plugins can be used with the given processor.\n * The hast tree is discarded in the end.\n * It’s highly unlikely that you want to do this.\n * * The common case is to not pass a destination processor, in which case the\n * current processor continues running with a new HTML (hast) tree\n * (mutate-mode).\n * As the current processor continues with a hast tree, and rehype plugins\n * support hast, that means rehype plugins can be used after\n * `remark-rehype`.\n * It’s likely that this is what you want to do.\n *\n * @param destination\n * Optional unified processor.\n * @param options\n * Options passed to `mdast-util-to-hast`.\n */\nconst remarkRehype =\n /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */\n (\n function (destination, options) {\n return destination && 'run' in destination\n ? bridge(destination, options)\n : mutate(destination || options)\n }\n )\n\nexport default remarkRehype\n\n/**\n * Bridge-mode.\n * Runs the destination with the new hast tree.\n *\n * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}\n */\nfunction bridge(destination, options) {\n return (node, file, next) => {\n destination.run(toHast(node, options), file, (error) => {\n next(error)\n })\n }\n}\n\n/**\n * Mutate-mode.\n * Further plugins run on the hast tree.\n *\n * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}\n */\nfunction mutate(options) {\n // @ts-expect-error: assume a corresponding node is returned by `toHast`.\n return (node) => toHast(node, options)\n}\n","/**\n * @typedef {import('./info.js').Info} Info\n * @typedef {Record} Properties\n * @typedef {Record} Normal\n */\n\nexport class Schema {\n /**\n * @constructor\n * @param {Properties} property\n * @param {Normal} normal\n * @param {string} [space]\n */\n constructor(property, normal, space) {\n this.property = property\n this.normal = normal\n if (space) {\n this.space = space\n }\n }\n}\n\n/** @type {Properties} */\nSchema.prototype.property = {}\n/** @type {Normal} */\nSchema.prototype.normal = {}\n/** @type {string|null} */\nSchema.prototype.space = null\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {Schema[]} definitions\n * @param {string} [space]\n * @returns {Schema}\n */\nexport function merge(definitions, space) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n let index = -1\n\n while (++index < definitions.length) {\n Object.assign(property, definitions[index].property)\n Object.assign(normal, definitions[index].normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * @param {string} value\n * @returns {string}\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","export class Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n */\n constructor(property, attribute) {\n /** @type {string} */\n this.property = property\n /** @type {string} */\n this.attribute = attribute\n }\n}\n\n/** @type {string|null} */\nInfo.prototype.space = null\nInfo.prototype.boolean = false\nInfo.prototype.booleanish = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.number = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.spaceSeparated = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.defined = false\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","import {Info} from './info.js'\nimport * as types from './types.js'\n\n/** @type {Array} */\n// @ts-expect-error: hush.\nconst checks = Object.keys(types)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n * @param {number|null} [mask]\n * @param {string} [space]\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @param {DefinedInfo} values\n * @param {string} key\n * @param {unknown} value\n */\nfunction mark(values, key, value) {\n if (value) {\n // @ts-expect-error: assume `value` matches the expected value of `key`.\n values[key] = value\n }\n}\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n *\n * @typedef {Record} Attributes\n *\n * @typedef {Object} Definition\n * @property {Record} properties\n * @property {(attributes: Attributes, property: string) => string} transform\n * @property {string} [space]\n * @property {Attributes} [attributes]\n * @property {Array} [mustUseProperty]\n */\n\nimport {normalize} from '../normalize.js'\nimport {Schema} from './schema.js'\nimport {DefinedInfo} from './defined-info.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * @param {Definition} definition\n * @returns {Schema}\n */\nexport function create(definition) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n /** @type {string} */\n let prop\n\n for (prop in definition.properties) {\n if (own.call(definition.properties, prop)) {\n const value = definition.properties[prop]\n const info = new DefinedInfo(\n prop,\n definition.transform(definition.attributes || {}, prop),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(prop)\n ) {\n info.mustUseProperty = true\n }\n\n property[prop] = info\n\n normal[normalize(prop)] = prop\n normal[normalize(info.attribute)] = prop\n }\n }\n\n return new Schema(property, normal, definition.space)\n}\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n space: 'xlink',\n transform(_, prop) {\n return 'xlink:' + prop.slice(5).toLowerCase()\n },\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n }\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n space: 'xml',\n transform(_, prop) {\n return 'xml:' + prop.slice(3).toLowerCase()\n },\n properties: {xmlLang: null, xmlBase: null, xmlSpace: null}\n})\n","/**\n * @param {Record} attributes\n * @param {string} attribute\n * @returns {string}\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record} attributes\n * @param {string} property\n * @returns {string}\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n space: 'xmlns',\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n transform: caseInsensitiveTransform,\n properties: {xmlns: null, xmlnsXLink: null}\n})\n","import {booleanish, number, spaceSeparated} from './util/types.js'\nimport {create} from './util/create.js'\n\nexport const aria = create({\n transform(_, prop) {\n return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase()\n },\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n }\n})\n","import {\n boolean,\n overloadedBoolean,\n booleanish,\n number,\n spaceSeparated,\n commaSeparated\n} from './util/types.js'\nimport {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const html = create({\n space: 'html',\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n transform: caseInsensitiveTransform,\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: boolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // ``. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // ``. List of URIs to archives\n axis: null, // `
` and ``. Use `scope` on ``\n background: null, // ``. Use CSS `background-image` instead\n bgColor: null, // `` and table elements. Use CSS `background-color` instead\n border: number, // ``. Use CSS `border-width` instead,\n borderColor: null, // `
`. Use CSS `border-color` instead,\n bottomMargin: number, // ``\n cellPadding: null, // `
`\n cellSpacing: null, // `
`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // ``\n clear: null, // `
`. Use CSS `clear` instead\n code: null, // ``\n codeBase: null, // ``\n codeType: null, // ``\n color: null, // `` and `
`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // ``\n event: null, // `