local-operator-ui 0.46.6 → 0.46.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/out/renderer/assets/{agent-details-page-K289NUHT.js → agent-details-page-DxOcBjpW.js} +1 -1
  2. package/out/renderer/assets/{agent-hub-page-CSCc9Lee.js → agent-hub-page-Q9_X5CFP.js} +1 -1
  3. package/out/renderer/assets/{agents-page-D2CGjR5l.js → agents-page-D_twoMKH.js} +3 -3
  4. package/out/renderer/assets/{browser-page-Svij-U5I.js → browser-page-GBlF_XiR.js} +1 -1
  5. package/out/renderer/assets/{browser-webauthn-prompt-9XHhkc9I.js → browser-webauthn-prompt-DkqSn3Sr.js} +1 -1
  6. package/out/renderer/assets/{index-D9MeD_9S.js → index-pRJvOEvT.js} +2 -2
  7. package/out/renderer/assets/{legacy-agents-page-nvsx5uoH.js → legacy-agents-page-Bawvdt7h.js} +1 -1
  8. package/out/renderer/assets/{library-page-CTLf85Ok.js → library-page--nTYgR0k.js} +3 -3
  9. package/out/renderer/assets/{mesh-page-DE_mrX94.js → mesh-page-D1ZsRm8r.js} +1 -1
  10. package/out/renderer/assets/{notifications-page-CanxxkH0.js → notifications-page-Be_zCnpp.js} +1 -1
  11. package/out/renderer/assets/{org-access-BkIFhKI0.js → org-access-gAZxCRYK.js} +1 -1
  12. package/out/renderer/assets/{projects-page-DLiIT4z_.js → projects-page-CsaCVH12.js} +1 -1
  13. package/out/renderer/assets/{publication-validation-DAe6s6FK.js → publication-validation-CEPmXg_x.js} +1 -1
  14. package/out/renderer/assets/{radient-auth-buttons-DYdBNC_-.js → radient-auth-buttons-B6UxMMyL.js} +1 -1
  15. package/out/renderer/assets/{schedules-page-C8mqRXQe.js → schedules-page-Bis3PAo0.js} +1 -1
  16. package/out/renderer/assets/{settings-page-BVO85tKx.js → settings-page-t3dHQ3rA.js} +1 -1
  17. package/out/renderer/assets/{smartart-x0vHjcLD.js → smartart-BbzXlcrh.js} +1 -1
  18. package/out/renderer/assets/team-bridge-page-jEjSR01Y.js +36 -0
  19. package/out/renderer/assets/{use-default-on-banner-9GIy0N8O.js → use-default-on-banner-Dh8MzHSc.js} +1 -1
  20. package/out/renderer/assets/{use-download-agent-mutation-CDplGp13.js → use-download-agent-mutation-Bbx3LX_Y.js} +1 -1
  21. package/out/renderer/index.html +1 -1
  22. package/package.json +2 -2
  23. package/out/renderer/assets/team-bridge-page-DK2oXcTp.js +0 -36
@@ -1,4 +1,4 @@
1
- import{j as t,c as R,r as d,u as Fn}from"./index-C4ae8MIc.js";import{t as n}from"./messages-DoRCUI0R.js";import{ba as $e,aB as V,bM as Tt,ay as qn,cx as Us,a_ as $s,cy as zs,bK as Bn,aZ as ve,cz as Un,aA as Sr,V as ft,be as Ve,cA as $n,ce as zn,bh as Cr,bf as Rt,bQ as Gn,aj as Kn,bW as Yn,b$ as Hn,b_ as Wn,bZ as Gs,cB as Vn,cv as Xn,cg as Jn,cd as Qn,cf as Zn,W as le,cC as Er,cD as Tr,cm as Ft,cE as Be,cF as ea,cG as _t,cq as ta,cr as Ks,cH as jt,cI as Rr,cn as sa,cJ as ra,cK as Dr,bb as na,aa,ab as oa,ac as ia,ad as ca,ae as la,cL as ua,cM as Ar,bJ as da,cN as pa,ai as ma}from"./conversation-input-sync-BwcOsVjK.js";import{i as hs,d as _e,a9 as fa,r as gs,u as _a,ab as ja,ac as ha,ad as Xe,ae as ga,G as qt,a as rt,c as ye,B as Bt,af as es,q as Dt,s as xa,o as ba,t as va,y as ya,A as wa,C as ka}from"./path-utils-BqTfmiT0.js";import{c as ht,u as L,Q as Je,w as Ut,R as Qe,U as Ze,V as et,W as Oe,B as G,D as xs,d as bs,S as Te,e as vs,f as be,aa as Na,ab as Sa,ac as Ca,m as Ea,n as Ta,I as Ra,j as ke,a6 as ys,ag as ws,a8 as ks,K as ue,X as $t,C as Ns,T as Pr,L as pe,Z as Or,i as Mr,o as Da,p as Aa,q as Pa,A as ts,_ as Oa,M as Ma,N as Ia,O as La,g as Ye}from"./error-boundary-BcPKKbP5.js";import{P as Ys}from"./page-header-BnTa4LRQ.js";import{bO as Fa,bw as Ir,bP as qa,bQ as Ba,bE as Ua,bg as $a,b4 as dt,A as Hs,bR as Lr,F as Ws,R as za}from"./index-D9MeD_9S.js";import{o as Fr}from"./console-mirror-C-hKgNgn.js";import{P as tt}from"./project-markdown-B-gfCIgA.js";import{u as Ga}from"./use-session-snapshot-BIGyGyQQ.js";/**
1
+ import{j as t,c as R,r as d,u as Fn}from"./index-C4ae8MIc.js";import{t as n}from"./messages-DoRCUI0R.js";import{ba as $e,aB as V,bM as Tt,ay as qn,cx as Us,a_ as $s,cy as zs,bK as Bn,aZ as ve,cz as Un,aA as Sr,V as ft,be as Ve,cA as $n,ce as zn,bh as Cr,bf as Rt,bQ as Gn,aj as Kn,bW as Yn,b$ as Hn,b_ as Wn,bZ as Gs,cB as Vn,cv as Xn,cg as Jn,cd as Qn,cf as Zn,W as le,cC as Er,cD as Tr,cm as Ft,cE as Be,cF as ea,cG as _t,cq as ta,cr as Ks,cH as jt,cI as Rr,cn as sa,cJ as ra,cK as Dr,bb as na,aa,ab as oa,ac as ia,ad as ca,ae as la,cL as ua,cM as Ar,bJ as da,cN as pa,ai as ma}from"./conversation-input-sync-BwcOsVjK.js";import{i as hs,d as _e,a9 as fa,r as gs,u as _a,ab as ja,ac as ha,ad as Xe,ae as ga,G as qt,a as rt,c as ye,B as Bt,af as es,q as Dt,s as xa,o as ba,t as va,y as ya,A as wa,C as ka}from"./path-utils-BqTfmiT0.js";import{c as ht,u as L,Q as Je,w as Ut,R as Qe,U as Ze,V as et,W as Oe,B as G,D as xs,d as bs,S as Te,e as vs,f as be,aa as Na,ab as Sa,ac as Ca,m as Ea,n as Ta,I as Ra,j as ke,a6 as ys,ag as ws,a8 as ks,K as ue,X as $t,C as Ns,T as Pr,L as pe,Z as Or,i as Mr,o as Da,p as Aa,q as Pa,A as ts,_ as Oa,M as Ma,N as Ia,O as La,g as Ye}from"./error-boundary-BcPKKbP5.js";import{P as Ys}from"./page-header-BnTa4LRQ.js";import{bO as Fa,bw as Ir,bP as qa,bQ as Ba,bE as Ua,bg as $a,b4 as dt,A as Hs,bR as Lr,F as Ws,R as za}from"./index-pRJvOEvT.js";import{o as Fr}from"./console-mirror-C-hKgNgn.js";import{P as tt}from"./project-markdown-B-gfCIgA.js";import{u as Ga}from"./use-session-snapshot-BIGyGyQQ.js";/**
2
2
  * @license lucide-react v0.507.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{g as f,h as v,p as c,P as w,i as A,r as L,j as T,k as P,l as R,m as N}from"./path-utils-BqTfmiT0.js";import{S,T as E,U as O}from"./conversation-input-sync-BwcOsVjK.js";import{t as e}from"./messages-DoRCUI0R.js";import"./index-C4ae8MIc.js";import{l as U,b as j}from"./index-D9MeD_9S.js";const h={get malware_or_exploitation(){return e("ui.agents.publication.category.malware_or_exploitation")},get credential_theft(){return e("ui.agents.publication.category.credential_theft")},get fraud_or_deception(){return e("ui.agents.publication.category.fraud_or_deception")},get harassment_or_hate(){return e("ui.agents.publication.category.harassment_or_hate")},get sexual_content_minors(){return e("ui.agents.publication.category.sexual_content_minors")},get sexual_content(){return e("ui.agents.publication.category.sexual_content")},get violence_or_weapons(){return e("ui.agents.publication.category.violence_or_weapons")},get drugs_or_controlled_substances(){return e("ui.agents.publication.category.drugs_or_controlled_substances")},get self_harm(){return e("ui.agents.publication.category.self_harm")},get mass_surveillance_or_privacy_abuse(){return e("ui.agents.publication.category.mass_surveillance_or_privacy_abuse")},get evasion_or_abuse_tooling(){return e("ui.agents.publication.category.evasion_or_abuse_tooling")},get prompt_injection(){return e("ui.agents.publication.category.prompt_injection")},get unclear_dual_use(){return e("ui.agents.publication.category.unclear_dual_use")},get other_harmful(){return e("ui.agents.publication.category.other_harmful")}},q=n=>{const t=n.trim();return t.length>12&&/\s/.test(t)&&!/^(not found|bad request|unauthorized|error|internal server error)\.?$/i.test(t)};function C(n){const t=n?.categories?.[0];return t&&O(t)?h[t]:h.other_harmful}function k(n,t){const i=t?.rule?.trim()??"";switch(t?.field){case"name":return{body:i?e("ui.agents.publication.invalid.field.name_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.name"),field:"name"};case"instructions":return{body:i?e("ui.agents.publication.invalid.field.instructions_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.instructions",{max:String(w)}),field:"instructions"};case"description":return{body:i?e("ui.agents.publication.invalid.field.description_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.description"),field:"description"};case"tools":return{body:i?e("ui.agents.publication.invalid.field.tools_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.tools"),field:"tools"};case"when_to_use":return{body:i?e("ui.agents.publication.invalid.field.when_to_use_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.when_to_use"),field:"when_to_use"};case"categories":return{body:i?e("ui.agents.publication.invalid.field.categories_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.categories"),field:"categories"};case"tags":return{body:i?e("ui.agents.publication.invalid.field.tags_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.tags"),field:"tags"};default:return{body:n,field:null}}}function Z(n,t){const i=t.surface==="pull",o=t.name.trim(),a=o||(i?e("ui.agents.publication.subject.team"):e("ui.agents.publication.subject.agent"));switch(n.code){case"name_taken":return n.details?.owned_by_caller===!0?{variant:"danger",headline:e("ui.agents.publication.name_taken.owned_headline"),body:e("ui.agents.publication.name_taken.owned_body",{name:a}),note:null,actions:n.details?.existing_agent_id||t.hubAgentId?["update-listing","focus-name"]:["focus-name"]}:{variant:"danger",headline:e("ui.agents.publication.name_taken.headline"),body:e("ui.agents.publication.name_taken.body",{name:a}),note:null,actions:["focus-name"]};case"name_claim_in_flight":return{variant:"warning",headline:e("ui.agents.publication.name_claim_in_flight.headline"),body:e("ui.agents.publication.name_claim_in_flight.body",{name:a}),note:null,actions:["retry"]};case"name_reserved_builtin":{const u=n.details?.builtin_name,l=u?c(u)===c(a):!1;return{variant:"danger",headline:e("ui.agents.publication.name_reserved_builtin.headline"),body:u&&!l?e("ui.agents.publication.name_reserved_builtin.body",{name:a,builtin:u}):e("ui.agents.publication.name_reserved_builtin.body_same_name",{builtin:u??a}),note:null,actions:["focus-name","install-builtin"]}}case"moderation_rejected":return{variant:"danger",headline:e("ui.agents.publication.moderation_rejected.headline"),body:n.details?.reason?.trim()||n.message,note:C(n.details),actions:["edit-instructions"]};case"moderation_unavailable":return{variant:"warning",headline:e("ui.agents.publication.moderation_unavailable.headline"),body:e("ui.agents.publication.moderation_unavailable.body"),note:null,actions:["retry"]};case"invalid_instruction_set":{const{body:u,field:l}=k(n.message,n.details);return{variant:"danger",headline:e("ui.agents.publication.invalid.headline"),body:u,note:null,actions:l==="name"?["focus-name"]:l==="instructions"?["edit-instructions"]:["edit-agent"]}}case"payload_too_large":{const u=n.details?.limit_bytes;return{variant:"danger",headline:e("ui.agents.publication.payload_too_large.headline"),body:u?e("ui.agents.publication.payload_too_large.body_with_limit",{size:String(Math.round(u/1024))}):e("ui.agents.publication.payload_too_large.body"),note:null,actions:["edit-instructions"]}}case"not_owner":return{variant:"danger",headline:e("ui.agents.publication.not_owner.headline"),body:e("ui.agents.publication.not_owner.body"),note:null,actions:["publish-as-new"]};case"agent_not_found":return{variant:"danger",headline:e("ui.agents.publication.agent_not_found.headline"),body:e("ui.agents.publication.agent_not_found.body"),note:null,actions:["publish-as-new","refresh-hub"]};case"hub_unauthorized":return{variant:"danger",headline:e("ui.agents.publication.hub_unauthorized.headline"),body:i?e("ui.agents.publication.hub_unauthorized.body_pull"):e("ui.agents.publication.hub_unauthorized.body"),note:null,actions:["sign-in"]};case"hub_unavailable":return{variant:"warning",headline:i?e("ui.agents.publication.hub_unavailable.headline_pull"):e("ui.agents.publication.hub_unavailable.headline"),body:q(n.message)?n.message:i?e("ui.agents.publication.hub_unavailable.body_pull"):e("ui.agents.publication.hub_unavailable.body"),note:null,actions:["retry"]};case"local_failure":return{variant:"warning",headline:i?e("ui.agents.publication.local_failure.headline_pull"):e("ui.agents.publication.local_failure.headline"),body:n.message,note:null,actions:["retry"]};case"team_plan_required":return{variant:"warning",headline:e("ui.agents.publication.team_plan_required.headline"),body:i?e("ui.agents.publication.team_plan_required.body_pull"):e("ui.agents.publication.team_plan_required.body"),note:null,actions:["retry"]};case"not_a_member":return{variant:"danger",headline:e("ui.agents.publication.not_a_member.headline"),body:i?e("ui.agents.publication.not_a_member.body_pull"):e("ui.agents.publication.not_a_member.body"),note:null,actions:[]};case"insufficient_role":{const u=n.details?.required;return{variant:"danger",headline:e("ui.agents.publication.insufficient_role.headline"),body:u?e(i?"ui.agents.publication.insufficient_role.body_with_role_pull":"ui.agents.publication.insufficient_role.body_with_role",{required:u}):e(i?"ui.agents.publication.insufficient_role.body_pull":"ui.agents.publication.insufficient_role.body"),note:null,actions:[]}}case"team_not_found":return{variant:"danger",headline:e("ui.agents.publication.team_not_found.headline"),body:e("ui.agents.publication.team_not_found.body"),note:null,actions:["refresh-hub"]};default:return{variant:"danger",headline:e("ui.agents.publication.fallback.headline"),body:n.message,note:null,actions:["retry"]}}}const x=[/^(?:Download agent from Radient failed: )?(?:Error downloading agent from Radient: )?\s*/,/^Failed to download agent(?: [^\s]+)? from Radient Agent Hub(?: due to a requests error)?:\s*/,/^[A-Za-z_][\w.]*\([^)]*\):\s*/],F=/^(\d{3})\b/,I=new Set([404,410]),B=["read timed out","connection timed out","connection refused","connection aborted","connection reset","connectionerror","connecttimeout","remote end closed connection","max retries exceeded","temporary failure in name resolution","name or service not known","no route to host"],D=n=>{const t=n.toLowerCase();return B.some(i=>t.includes(i))||E(n)},K=(n,t)=>{const i=t.trim()?e("ui.agents.publication.subject.name",{name:t.trim()}):e("ui.agents.publication.subject.unknown");if(S(n))switch(n.code){case"agent_not_found":return e("ui.agents.publication.pull.not_found",{subject:i});case"hub_unavailable":return e("ui.agents.publication.pull.hub_unavailable",{subject:i});default:return e("ui.agents.publication.pull.refused",{subject:i,reason:n.message})}const o=x.reduce((u,l)=>u.replace(l,""),v(n,"").trim()).trim();if(!o)return e("ui.agents.publication.pull.no_reason",{subject:i});const a=Number(F.exec(o)?.[1]??Number.NaN);return I.has(a)?e("ui.agents.publication.pull.not_found",{subject:i}):D(o)||a===408?e("ui.agents.publication.pull.reach_failure",{subject:i}):a===429?e("ui.agents.publication.pull.busy",{subject:i}):a===401||a===403?e("ui.agents.publication.pull.sign_in_refused",{subject:i}):a>=500?e("ui.agents.publication.pull.incomplete",{subject:i}):a>=400?e("ui.agents.publication.pull.refused_download",{subject:i}):e("ui.agents.publication.pull.prose",{subject:i,reason:o})},M=()=>e("ui.agents.publication.other_action_lead"),J=(n,t,i)=>n==="download"?K(t,i):f(M(),t),V={get"focus-name"(){return e("ui.agents.publication.action.focus_name")},get"update-listing"(){return e("ui.agents.publication.action.update_listing")},get"install-builtin"(){return e("ui.agents.publication.action.install_builtin")},get retry(){return e("ui.agents.publication.action.retry")},get"edit-instructions"(){return e("ui.agents.publication.action.edit_instructions")},get"edit-agent"(){return e("ui.agents.publication.action.edit_agent")},get"publish-as-new"(){return e("ui.agents.publication.action.publish_as_new")},get"sign-in"(){return e("ui.agents.publication.action.sign_in")},get"refresh-hub"(){return e("ui.agents.publication.action.refresh_hub")}},z="download_count",_={all:["public-agents"],list:n=>[..._.all,"list",{page:n.page,perPage:n.perPage,categories:n.categories?.join(",")??void 0,name:n.name??void 0,description:n.description??void 0,sort:n.sort,order:n.order}]},g={all:["org-agents"],list:(n,t)=>[...g.all,"list",n,{page:t.page,perPage:t.perPage,categories:t.categories?.join(",")??void 0,name:t.name??void 0,description:t.description??void 0,sort:t.sort,order:t.order}]},Q=n=>n&&n[0]===g.all[0]?String(n[2]??""):null,ee=n=>n.invalidateQueries({queryKey:_.all}),ne=(n,t)=>n.invalidateQueries({queryKey:t?[...g.all,"list",t]:g.all}),ie=({page:n=1,perPage:t=20,enabled:i=!0,categories:o,name:a,description:u,sort:l=z,order:b="desc",tenantId:d}={})=>{const p={page:n,perPage:t,categories:o,name:a,description:u,sort:l,order:b},y=d?g.list(d,p):_.list(p),r=A({queryKey:y,queryFn:async()=>{const s={};return o&&o.length>0&&(s.categories=o.join(",")),a&&(s.name=a),u&&(s.description=u),s.sort=l,s.order=b,d?await U(d,n,t,s):await j(n,t,s)},select:s=>s.result,enabled:i,retry:L,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,placeholderData:(s,m)=>Q(m?.queryKey)===(d??null)?s:void 0});return{...r,agents:r.data?.records,isRefreshing:r.isFetching&&r.data!==void 0,pagination:r.data?{page:r.data.page,perPage:r.data.per_page,totalPages:r.data.total_pages,totalRecords:r.data.total_records}:void 0}},G={name:"Name",description:"Description",instructions:"The instruction body",tools:"Tools"};function te(n){const t=[],i=(o,a)=>{a&&t.push({field:o,message:`${G[o]} ${a}.`})};return i("name",T(n.name)),i("description",P(n.description)),n.instructions!==null&&i("instructions",R(n.instructions)),i("tools",N(n.tools??[])),t}function ae(n,t){const i=c(n);return t.some(o=>c(o)===i)}function oe(n){for(const t of n??[]){const i=t.indexOf(":");if(i<0||t.slice(0,i).trim().toLowerCase()!=="tools")continue;const o=t.slice(i+1).split(",").map(a=>a.trim()).filter(Boolean);return o.length>0?o:null}return null}function ue(n,t){const i=c(n);return t.find(o=>c(o)===i)??null}export{V as P,J as a,_ as b,ne as c,ae as d,te as e,ee as i,ue as l,Z as p,oe as t,ie as u};
1
+ import{g as f,h as v,p as c,P as w,i as A,r as L,j as T,k as P,l as R,m as N}from"./path-utils-BqTfmiT0.js";import{S,T as E,U as O}from"./conversation-input-sync-BwcOsVjK.js";import{t as e}from"./messages-DoRCUI0R.js";import"./index-C4ae8MIc.js";import{l as U,b as j}from"./index-pRJvOEvT.js";const h={get malware_or_exploitation(){return e("ui.agents.publication.category.malware_or_exploitation")},get credential_theft(){return e("ui.agents.publication.category.credential_theft")},get fraud_or_deception(){return e("ui.agents.publication.category.fraud_or_deception")},get harassment_or_hate(){return e("ui.agents.publication.category.harassment_or_hate")},get sexual_content_minors(){return e("ui.agents.publication.category.sexual_content_minors")},get sexual_content(){return e("ui.agents.publication.category.sexual_content")},get violence_or_weapons(){return e("ui.agents.publication.category.violence_or_weapons")},get drugs_or_controlled_substances(){return e("ui.agents.publication.category.drugs_or_controlled_substances")},get self_harm(){return e("ui.agents.publication.category.self_harm")},get mass_surveillance_or_privacy_abuse(){return e("ui.agents.publication.category.mass_surveillance_or_privacy_abuse")},get evasion_or_abuse_tooling(){return e("ui.agents.publication.category.evasion_or_abuse_tooling")},get prompt_injection(){return e("ui.agents.publication.category.prompt_injection")},get unclear_dual_use(){return e("ui.agents.publication.category.unclear_dual_use")},get other_harmful(){return e("ui.agents.publication.category.other_harmful")}},q=n=>{const t=n.trim();return t.length>12&&/\s/.test(t)&&!/^(not found|bad request|unauthorized|error|internal server error)\.?$/i.test(t)};function C(n){const t=n?.categories?.[0];return t&&O(t)?h[t]:h.other_harmful}function k(n,t){const i=t?.rule?.trim()??"";switch(t?.field){case"name":return{body:i?e("ui.agents.publication.invalid.field.name_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.name"),field:"name"};case"instructions":return{body:i?e("ui.agents.publication.invalid.field.instructions_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.instructions",{max:String(w)}),field:"instructions"};case"description":return{body:i?e("ui.agents.publication.invalid.field.description_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.description"),field:"description"};case"tools":return{body:i?e("ui.agents.publication.invalid.field.tools_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.tools"),field:"tools"};case"when_to_use":return{body:i?e("ui.agents.publication.invalid.field.when_to_use_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.when_to_use"),field:"when_to_use"};case"categories":return{body:i?e("ui.agents.publication.invalid.field.categories_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.categories"),field:"categories"};case"tags":return{body:i?e("ui.agents.publication.invalid.field.tags_with_rule",{rule:i}):e("ui.agents.publication.invalid.field.tags"),field:"tags"};default:return{body:n,field:null}}}function Z(n,t){const i=t.surface==="pull",o=t.name.trim(),a=o||(i?e("ui.agents.publication.subject.team"):e("ui.agents.publication.subject.agent"));switch(n.code){case"name_taken":return n.details?.owned_by_caller===!0?{variant:"danger",headline:e("ui.agents.publication.name_taken.owned_headline"),body:e("ui.agents.publication.name_taken.owned_body",{name:a}),note:null,actions:n.details?.existing_agent_id||t.hubAgentId?["update-listing","focus-name"]:["focus-name"]}:{variant:"danger",headline:e("ui.agents.publication.name_taken.headline"),body:e("ui.agents.publication.name_taken.body",{name:a}),note:null,actions:["focus-name"]};case"name_claim_in_flight":return{variant:"warning",headline:e("ui.agents.publication.name_claim_in_flight.headline"),body:e("ui.agents.publication.name_claim_in_flight.body",{name:a}),note:null,actions:["retry"]};case"name_reserved_builtin":{const u=n.details?.builtin_name,l=u?c(u)===c(a):!1;return{variant:"danger",headline:e("ui.agents.publication.name_reserved_builtin.headline"),body:u&&!l?e("ui.agents.publication.name_reserved_builtin.body",{name:a,builtin:u}):e("ui.agents.publication.name_reserved_builtin.body_same_name",{builtin:u??a}),note:null,actions:["focus-name","install-builtin"]}}case"moderation_rejected":return{variant:"danger",headline:e("ui.agents.publication.moderation_rejected.headline"),body:n.details?.reason?.trim()||n.message,note:C(n.details),actions:["edit-instructions"]};case"moderation_unavailable":return{variant:"warning",headline:e("ui.agents.publication.moderation_unavailable.headline"),body:e("ui.agents.publication.moderation_unavailable.body"),note:null,actions:["retry"]};case"invalid_instruction_set":{const{body:u,field:l}=k(n.message,n.details);return{variant:"danger",headline:e("ui.agents.publication.invalid.headline"),body:u,note:null,actions:l==="name"?["focus-name"]:l==="instructions"?["edit-instructions"]:["edit-agent"]}}case"payload_too_large":{const u=n.details?.limit_bytes;return{variant:"danger",headline:e("ui.agents.publication.payload_too_large.headline"),body:u?e("ui.agents.publication.payload_too_large.body_with_limit",{size:String(Math.round(u/1024))}):e("ui.agents.publication.payload_too_large.body"),note:null,actions:["edit-instructions"]}}case"not_owner":return{variant:"danger",headline:e("ui.agents.publication.not_owner.headline"),body:e("ui.agents.publication.not_owner.body"),note:null,actions:["publish-as-new"]};case"agent_not_found":return{variant:"danger",headline:e("ui.agents.publication.agent_not_found.headline"),body:e("ui.agents.publication.agent_not_found.body"),note:null,actions:["publish-as-new","refresh-hub"]};case"hub_unauthorized":return{variant:"danger",headline:e("ui.agents.publication.hub_unauthorized.headline"),body:i?e("ui.agents.publication.hub_unauthorized.body_pull"):e("ui.agents.publication.hub_unauthorized.body"),note:null,actions:["sign-in"]};case"hub_unavailable":return{variant:"warning",headline:i?e("ui.agents.publication.hub_unavailable.headline_pull"):e("ui.agents.publication.hub_unavailable.headline"),body:q(n.message)?n.message:i?e("ui.agents.publication.hub_unavailable.body_pull"):e("ui.agents.publication.hub_unavailable.body"),note:null,actions:["retry"]};case"local_failure":return{variant:"warning",headline:i?e("ui.agents.publication.local_failure.headline_pull"):e("ui.agents.publication.local_failure.headline"),body:n.message,note:null,actions:["retry"]};case"team_plan_required":return{variant:"warning",headline:e("ui.agents.publication.team_plan_required.headline"),body:i?e("ui.agents.publication.team_plan_required.body_pull"):e("ui.agents.publication.team_plan_required.body"),note:null,actions:["retry"]};case"not_a_member":return{variant:"danger",headline:e("ui.agents.publication.not_a_member.headline"),body:i?e("ui.agents.publication.not_a_member.body_pull"):e("ui.agents.publication.not_a_member.body"),note:null,actions:[]};case"insufficient_role":{const u=n.details?.required;return{variant:"danger",headline:e("ui.agents.publication.insufficient_role.headline"),body:u?e(i?"ui.agents.publication.insufficient_role.body_with_role_pull":"ui.agents.publication.insufficient_role.body_with_role",{required:u}):e(i?"ui.agents.publication.insufficient_role.body_pull":"ui.agents.publication.insufficient_role.body"),note:null,actions:[]}}case"team_not_found":return{variant:"danger",headline:e("ui.agents.publication.team_not_found.headline"),body:e("ui.agents.publication.team_not_found.body"),note:null,actions:["refresh-hub"]};default:return{variant:"danger",headline:e("ui.agents.publication.fallback.headline"),body:n.message,note:null,actions:["retry"]}}}const x=[/^(?:Download agent from Radient failed: )?(?:Error downloading agent from Radient: )?\s*/,/^Failed to download agent(?: [^\s]+)? from Radient Agent Hub(?: due to a requests error)?:\s*/,/^[A-Za-z_][\w.]*\([^)]*\):\s*/],F=/^(\d{3})\b/,I=new Set([404,410]),B=["read timed out","connection timed out","connection refused","connection aborted","connection reset","connectionerror","connecttimeout","remote end closed connection","max retries exceeded","temporary failure in name resolution","name or service not known","no route to host"],D=n=>{const t=n.toLowerCase();return B.some(i=>t.includes(i))||E(n)},K=(n,t)=>{const i=t.trim()?e("ui.agents.publication.subject.name",{name:t.trim()}):e("ui.agents.publication.subject.unknown");if(S(n))switch(n.code){case"agent_not_found":return e("ui.agents.publication.pull.not_found",{subject:i});case"hub_unavailable":return e("ui.agents.publication.pull.hub_unavailable",{subject:i});default:return e("ui.agents.publication.pull.refused",{subject:i,reason:n.message})}const o=x.reduce((u,l)=>u.replace(l,""),v(n,"").trim()).trim();if(!o)return e("ui.agents.publication.pull.no_reason",{subject:i});const a=Number(F.exec(o)?.[1]??Number.NaN);return I.has(a)?e("ui.agents.publication.pull.not_found",{subject:i}):D(o)||a===408?e("ui.agents.publication.pull.reach_failure",{subject:i}):a===429?e("ui.agents.publication.pull.busy",{subject:i}):a===401||a===403?e("ui.agents.publication.pull.sign_in_refused",{subject:i}):a>=500?e("ui.agents.publication.pull.incomplete",{subject:i}):a>=400?e("ui.agents.publication.pull.refused_download",{subject:i}):e("ui.agents.publication.pull.prose",{subject:i,reason:o})},M=()=>e("ui.agents.publication.other_action_lead"),J=(n,t,i)=>n==="download"?K(t,i):f(M(),t),V={get"focus-name"(){return e("ui.agents.publication.action.focus_name")},get"update-listing"(){return e("ui.agents.publication.action.update_listing")},get"install-builtin"(){return e("ui.agents.publication.action.install_builtin")},get retry(){return e("ui.agents.publication.action.retry")},get"edit-instructions"(){return e("ui.agents.publication.action.edit_instructions")},get"edit-agent"(){return e("ui.agents.publication.action.edit_agent")},get"publish-as-new"(){return e("ui.agents.publication.action.publish_as_new")},get"sign-in"(){return e("ui.agents.publication.action.sign_in")},get"refresh-hub"(){return e("ui.agents.publication.action.refresh_hub")}},z="download_count",_={all:["public-agents"],list:n=>[..._.all,"list",{page:n.page,perPage:n.perPage,categories:n.categories?.join(",")??void 0,name:n.name??void 0,description:n.description??void 0,sort:n.sort,order:n.order}]},g={all:["org-agents"],list:(n,t)=>[...g.all,"list",n,{page:t.page,perPage:t.perPage,categories:t.categories?.join(",")??void 0,name:t.name??void 0,description:t.description??void 0,sort:t.sort,order:t.order}]},Q=n=>n&&n[0]===g.all[0]?String(n[2]??""):null,ee=n=>n.invalidateQueries({queryKey:_.all}),ne=(n,t)=>n.invalidateQueries({queryKey:t?[...g.all,"list",t]:g.all}),ie=({page:n=1,perPage:t=20,enabled:i=!0,categories:o,name:a,description:u,sort:l=z,order:b="desc",tenantId:d}={})=>{const p={page:n,perPage:t,categories:o,name:a,description:u,sort:l,order:b},y=d?g.list(d,p):_.list(p),r=A({queryKey:y,queryFn:async()=>{const s={};return o&&o.length>0&&(s.categories=o.join(",")),a&&(s.name=a),u&&(s.description=u),s.sort=l,s.order=b,d?await U(d,n,t,s):await j(n,t,s)},select:s=>s.result,enabled:i,retry:L,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,placeholderData:(s,m)=>Q(m?.queryKey)===(d??null)?s:void 0});return{...r,agents:r.data?.records,isRefreshing:r.isFetching&&r.data!==void 0,pagination:r.data?{page:r.data.page,perPage:r.data.per_page,totalPages:r.data.total_pages,totalRecords:r.data.total_records}:void 0}},G={name:"Name",description:"Description",instructions:"The instruction body",tools:"Tools"};function te(n){const t=[],i=(o,a)=>{a&&t.push({field:o,message:`${G[o]} ${a}.`})};return i("name",T(n.name)),i("description",P(n.description)),n.instructions!==null&&i("instructions",R(n.instructions)),i("tools",N(n.tools??[])),t}function ae(n,t){const i=c(n);return t.some(o=>c(o)===i)}function oe(n){for(const t of n??[]){const i=t.indexOf(":");if(i<0||t.slice(0,i).trim().toLowerCase()!=="tools")continue;const o=t.slice(i+1).split(",").map(a=>a.trim()).filter(Boolean);return o.length>0?o:null}return null}function ue(n,t){const i=c(n);return t.find(o=>c(o)===i)??null}export{V as P,J as a,_ as b,ne as c,ae as d,te as e,ee as i,ue as l,Z as p,oe as t,ie as u};
@@ -1 +1 @@
1
- import{j as t}from"./index-C4ae8MIc.js";import{P as l}from"./index-D9MeD_9S.js";import{u as p,a as b,c as x,e as h}from"./path-utils-BqTfmiT0.js";import{u as f,A as c,S as v}from"./error-boundary-BcPKKbP5.js";import{b as g}from"./conversation-input-sync-BwcOsVjK.js";import{t as e}from"./messages-DoRCUI0R.js";const j="radient",A=({onSignInSuccess:u,onAfterCredentialUpdate:d,titleText:a=e("ui.common.account.radient_auth_buttons.sign_in_to_radient"),descriptionText:i=e("ui.common.account.radient_auth_buttons.connect_your_radient_account_to_use_radient_services")})=>{f();const _=p(),n=b(),s=x(n.data,"auth"),r=h(s),o=r.data?.find(m=>m.id===j);return n.isSuccess&&!s?t.jsx(c,{variant:"warning",children:e("ui.common.account.radient_auth_buttons.signing_in_needs_a_newer_local_operator_backend_update_the_backen")}):r.isLoading||n.isLoading?t.jsx("div",{className:"flex h-24 items-center justify-center",children:t.jsx(v,{size:"md",label:e("ui.common.account.radient_auth_buttons.loading_sign_in_options")})}):o?t.jsxs("div",{className:"mx-auto w-full max-w-md",children:[a&&t.jsx("p",{className:"mb-2 text-center text-heading text-ink",children:a}),i&&t.jsx("p",{className:"mb-6 text-center text-body-sm text-ink-muted",children:i}),t.jsx(l,{provider:o,onConnected:()=>{_.invalidateQueries({queryKey:g.all}),d?.(),u?.()}})]}):t.jsx(c,{variant:"warning",children:e("ui.common.account.radient_auth_buttons.radient_is_not_available_from_this_backend_s_provider_registry")})};export{A as R};
1
+ import{j as t}from"./index-C4ae8MIc.js";import{P as l}from"./index-pRJvOEvT.js";import{u as p,a as b,c as x,e as h}from"./path-utils-BqTfmiT0.js";import{u as f,A as c,S as v}from"./error-boundary-BcPKKbP5.js";import{b as g}from"./conversation-input-sync-BwcOsVjK.js";import{t as e}from"./messages-DoRCUI0R.js";const j="radient",A=({onSignInSuccess:u,onAfterCredentialUpdate:d,titleText:a=e("ui.common.account.radient_auth_buttons.sign_in_to_radient"),descriptionText:i=e("ui.common.account.radient_auth_buttons.connect_your_radient_account_to_use_radient_services")})=>{f();const _=p(),n=b(),s=x(n.data,"auth"),r=h(s),o=r.data?.find(m=>m.id===j);return n.isSuccess&&!s?t.jsx(c,{variant:"warning",children:e("ui.common.account.radient_auth_buttons.signing_in_needs_a_newer_local_operator_backend_update_the_backen")}):r.isLoading||n.isLoading?t.jsx("div",{className:"flex h-24 items-center justify-center",children:t.jsx(v,{size:"md",label:e("ui.common.account.radient_auth_buttons.loading_sign_in_options")})}):o?t.jsxs("div",{className:"mx-auto w-full max-w-md",children:[a&&t.jsx("p",{className:"mb-2 text-center text-heading text-ink",children:a}),i&&t.jsx("p",{className:"mb-6 text-center text-body-sm text-ink-muted",children:i}),t.jsx(l,{provider:o,onConnected:()=>{_.invalidateQueries({queryKey:g.all}),d?.(),u?.()}})]}):t.jsx(c,{variant:"warning",children:e("ui.common.account.radient_auth_buttons.radient_is_not_available_from_this_backend_s_provider_registry")})};export{A as R};
@@ -1,4 +1,4 @@
1
- import{r as p,l as Ti,j as u,m as Ii,n as gu,o as Ys,h as Zr,f as ie,p as bu,b as Dt,q as ce,v as Re,w as qs,x as Ri,y as Jr,c as Le}from"./index-C4ae8MIc.js";import{dJ as yu,dK as vu,dL as es,dM as xu,dN as wu,dO as _i,dP as Cu,dQ as ku,dR as Su,dS as Ei,dT as Pu,dU as Oi,dV as Tt,dW as yo,dX as ts,dY as Mu,dZ as Ct,d_ as vo,d$ as Fi,e0 as Ni,e1 as Du,by as Tu,e2 as Iu,S as Ru,e3 as _u,o as Ai,e4 as Eu,e5 as $i,e6 as Ou,e7 as Fu,e8 as Nu,e9 as Au,ea as $u,b4 as _r,eb as ju,ec as Lu,ed as Vu,ee as Ks,ef as Bu,eg as Lo,eh as zu,ei as Hu,ej as Wu,ek as Uu,el as Yu,em as qu,en as Ku,b5 as Gu,eo as Qu,ep as Xu,eq as Zu,er as Ju,R as ed,es as td,bk as nd,et as od,eu as rd,ev as sd}from"./index-D9MeD_9S.js";import{i as ji,u as ns,q as Li,B as ad,a as id,c as ld}from"./path-utils-BqTfmiT0.js";import{P as cd}from"./page-header-BnTa4LRQ.js";import{am as _o,an as ud,u as Gt,w as Kt,B as yt,S as os,a5 as Gs,L as bt,T as Vi,K as Wo,Q as vn,R as xn,U as wn,V as Cn,W as et,Y as Er,a6 as dd,a7 as pd,l as fd,a8 as md,g as hd,X as gd,A as Qs}from"./error-boundary-BcPKKbP5.js";import{t as V}from"./messages-DoRCUI0R.js";import{a7 as nr,ba as Bi,ee as rs,ef as D,cS as bd,be as zi,bf as Hi,V as Wi,W as Pn,bb as yd,bL as vd,aB as Xs,eg as xd,aZ as Mn,bh as wd}from"./conversation-input-sync-BwcOsVjK.js";import{b as or,s as Or,g as Cd,c as Uo,d as Ui,e as Yi,h as kd,l as Fr,j as Sd,w as Zs,k as Pd,i as to,f as Md,m as Dd,p as Js}from"./parseISO-CxPiCKvF.js";import{t as Ce,c as at,d as qi,f as Ki,n as rr,g as ss,k as Td,a as Gi,e as Qi}from"./en-US-CW_dDnkH.js";import"./console-mirror-C-hKgNgn.js";var Id=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Rd=yu(function(e){return Id.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),_d=Rd,Ed=function(t){return t!=="theme"},ea=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?_d:Ed},ta=function(t,n,o){var r;if(n){var s=n.shouldForwardProp;r=t.__emotion_forwardProp&&s?function(a){return t.__emotion_forwardProp(a)&&s(a)}:s}return typeof r!="function"&&o&&(r=t.__emotion_forwardProp),r},Od=function(t){var n=t.cache,o=t.serialized,r=t.isStringTag;return Cu(n,o,r),ku(function(){return Su(n,o,r)}),null},Fd=function e(t,n){var o=t.__emotion_real===t,r=o&&t.__emotion_base||t,s,a;n!==void 0&&(s=n.label,a=n.target);var i=ta(t,n,o),l=i||ea(r),c=!l("as");return function(){var d=arguments,m=o&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(s!==void 0&&m.push("label:"+s+";"),d[0]==null||d[0].raw===void 0)m.push.apply(m,d);else{var y=d[0];m.push(y[0]);for(var g=d.length,h=1;h<g;h++)m.push(d[h],y[h])}var v=vu(function(f,b,C){var w=c&&f.as||r,x="",S=[],P=f;if(f.theme==null){P={};for(var k in f)P[k]=f[k];P.theme=p.useContext(xu)}typeof f.className=="string"?x=wu(b.registered,S,f.className):f.className!=null&&(x=f.className+" ");var R=_i(m.concat(S),b.registered,P);x+=b.key+"-"+R.name,a!==void 0&&(x+=" "+a);var _=c&&i===void 0?ea(w):l,O={};for(var $ in f)c&&$==="as"||_($)&&(O[$]=f[$]);return O.className=x,C&&(O.ref=C),p.createElement(p.Fragment,null,p.createElement(Od,{cache:b,serialized:R,isStringTag:typeof w=="string"}),p.createElement(w,O))});return v.displayName=s!==void 0?s:"Styled("+(typeof r=="string"?r:r.displayName||r.name||"Component")+")",v.defaultProps=t.defaultProps,v.__emotion_real=v,v.__emotion_base=r,v.__emotion_styles=m,v.__emotion_forwardProp=i,Object.defineProperty(v,"toString",{value:function(){return"."+a}}),v.withComponent=function(f,b){var C=e(f,es({},n,b,{shouldForwardProp:ta(v,b,!0)}));return C.apply(void 0,m)},v}},Nd=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Nr=Fd.bind(null);Nd.forEach(function(e){Nr[e]=Nr(e)});/**
1
+ import{r as p,l as Ti,j as u,m as Ii,n as gu,o as Ys,h as Zr,f as ie,p as bu,b as Dt,q as ce,v as Re,w as qs,x as Ri,y as Jr,c as Le}from"./index-C4ae8MIc.js";import{dJ as yu,dK as vu,dL as es,dM as xu,dN as wu,dO as _i,dP as Cu,dQ as ku,dR as Su,dS as Ei,dT as Pu,dU as Oi,dV as Tt,dW as yo,dX as ts,dY as Mu,dZ as Ct,d_ as vo,d$ as Fi,e0 as Ni,e1 as Du,by as Tu,e2 as Iu,S as Ru,e3 as _u,o as Ai,e4 as Eu,e5 as $i,e6 as Ou,e7 as Fu,e8 as Nu,e9 as Au,ea as $u,b4 as _r,eb as ju,ec as Lu,ed as Vu,ee as Ks,ef as Bu,eg as Lo,eh as zu,ei as Hu,ej as Wu,ek as Uu,el as Yu,em as qu,en as Ku,b5 as Gu,eo as Qu,ep as Xu,eq as Zu,er as Ju,R as ed,es as td,bk as nd,et as od,eu as rd,ev as sd}from"./index-pRJvOEvT.js";import{i as ji,u as ns,q as Li,B as ad,a as id,c as ld}from"./path-utils-BqTfmiT0.js";import{P as cd}from"./page-header-BnTa4LRQ.js";import{am as _o,an as ud,u as Gt,w as Kt,B as yt,S as os,a5 as Gs,L as bt,T as Vi,K as Wo,Q as vn,R as xn,U as wn,V as Cn,W as et,Y as Er,a6 as dd,a7 as pd,l as fd,a8 as md,g as hd,X as gd,A as Qs}from"./error-boundary-BcPKKbP5.js";import{t as V}from"./messages-DoRCUI0R.js";import{a7 as nr,ba as Bi,ee as rs,ef as D,cS as bd,be as zi,bf as Hi,V as Wi,W as Pn,bb as yd,bL as vd,aB as Xs,eg as xd,aZ as Mn,bh as wd}from"./conversation-input-sync-BwcOsVjK.js";import{b as or,s as Or,g as Cd,c as Uo,d as Ui,e as Yi,h as kd,l as Fr,j as Sd,w as Zs,k as Pd,i as to,f as Md,m as Dd,p as Js}from"./parseISO-CxPiCKvF.js";import{t as Ce,c as at,d as qi,f as Ki,n as rr,g as ss,k as Td,a as Gi,e as Qi}from"./en-US-CW_dDnkH.js";import"./console-mirror-C-hKgNgn.js";var Id=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Rd=yu(function(e){return Id.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),_d=Rd,Ed=function(t){return t!=="theme"},ea=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?_d:Ed},ta=function(t,n,o){var r;if(n){var s=n.shouldForwardProp;r=t.__emotion_forwardProp&&s?function(a){return t.__emotion_forwardProp(a)&&s(a)}:s}return typeof r!="function"&&o&&(r=t.__emotion_forwardProp),r},Od=function(t){var n=t.cache,o=t.serialized,r=t.isStringTag;return Cu(n,o,r),ku(function(){return Su(n,o,r)}),null},Fd=function e(t,n){var o=t.__emotion_real===t,r=o&&t.__emotion_base||t,s,a;n!==void 0&&(s=n.label,a=n.target);var i=ta(t,n,o),l=i||ea(r),c=!l("as");return function(){var d=arguments,m=o&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(s!==void 0&&m.push("label:"+s+";"),d[0]==null||d[0].raw===void 0)m.push.apply(m,d);else{var y=d[0];m.push(y[0]);for(var g=d.length,h=1;h<g;h++)m.push(d[h],y[h])}var v=vu(function(f,b,C){var w=c&&f.as||r,x="",S=[],P=f;if(f.theme==null){P={};for(var k in f)P[k]=f[k];P.theme=p.useContext(xu)}typeof f.className=="string"?x=wu(b.registered,S,f.className):f.className!=null&&(x=f.className+" ");var R=_i(m.concat(S),b.registered,P);x+=b.key+"-"+R.name,a!==void 0&&(x+=" "+a);var _=c&&i===void 0?ea(w):l,O={};for(var $ in f)c&&$==="as"||_($)&&(O[$]=f[$]);return O.className=x,C&&(O.ref=C),p.createElement(p.Fragment,null,p.createElement(Od,{cache:b,serialized:R,isStringTag:typeof w=="string"}),p.createElement(w,O))});return v.displayName=s!==void 0?s:"Styled("+(typeof r=="string"?r:r.displayName||r.name||"Component")+")",v.defaultProps=t.defaultProps,v.__emotion_real=v,v.__emotion_base=r,v.__emotion_styles=m,v.__emotion_forwardProp=i,Object.defineProperty(v,"toString",{value:function(){return"."+a}}),v.withComponent=function(f,b){var C=e(f,es({},n,b,{shouldForwardProp:ta(v,b,!0)}));return C.apply(void 0,m)},v}},Nd=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Nr=Fd.bind(null);Nd.forEach(function(e){Nr[e]=Nr(e)});/**
2
2
  * @mui/styled-engine v6.4.11
3
3
  *
4
4
  * @license MIT
@@ -1,4 +1,4 @@
1
- import{r as l,j as t,c as de,t as ua}from"./index-C4ae8MIc.js";import{o as ga}from"./console-mirror-C-hKgNgn.js";import{d3 as Zt,d4 as ma,d5 as Rn,d6 as De,c8 as _a,a6 as ms,a7 as gn,W as _s,ba as pa,aZ as fa,d7 as ha,d8 as xa,d9 as ya,da as ba,db as ps,dc as mn,a4 as fs,dd as va,de as ka,df as kt,dg as hs,dh as ja,bc as Jt,di as Tn,dj as wa,dk as qe,dl as Et,bJ as _n,dm as pn,cl as jt,bU as Na,dn as xs,dp as Sa,dq as Ma,V as ys,be as Xt,bf as en,aA as Ca,a_ as tn,dr as Ea,ds as Aa,dt as nn,du as Ia,dv as Ra,dw as Ta,dx as bs,dy as La,dz as Oa,dA as Fa,b9 as Da,dB as vs,bd as ks,dC as js,dD as za,dE as $a,dF as Pa,dG as Ka,dH as Ua,dI as Ba,a3 as qa,dJ as Ha,dK as Va,bO as ws,bQ as Ga,dL as Ze,dM as Ln,dN as Qa,dO as Wa,dP as Ya,c3 as Za,dQ as Ja,dR as Xa,ca as ei,dS as ti,dT as ni,dU as si,dV as ai,d2 as zt,dW as ii,dX as ri,az as oi}from"./conversation-input-sync-BwcOsVjK.js";import{i as Ce,u as fn,ak as li,ai as ci,al as di,am as Pe,a as Lt,c as st,an as ui,a3 as gi,ao as mi,ap as _i,aq as pi,ar as fi,d as pe,G as hn,as as hi,q as tt,at as xi,B as Ns,r as yi,C as bi,au as sn,x as et,av as vi,aw as Ss,$ as ki,a0 as ji}from"./path-utils-BqTfmiT0.js";import{dl as Ms,dm as wi,dn as Ni,dp as Cs,dq as Si,c5 as Mi,dr as Ee,N as Ci,S as Es,bs as ot,bt as _e,ds as at,dt as ge,du as $t,dv as Ei,R as Ai,b4 as On,dw as Ii,dx as Ri,dy as Ti,dz as ft,dA as ht,br as Li,bD as Oi,dB as Fi,dC as Di,dD as zi,dE as $i,bh as Fn,dF as Pi,b7 as Ki,bo as Dn,bN as Ui,bp as Bi,bq as qi,dG as Hi,dH as Vi,bg as Gi,dI as Qi}from"./index-D9MeD_9S.js";import{P as Wi}from"./page-header-BnTa4LRQ.js";import{c as F,u as se,B as z,S as ke,Y as As,w as Ve,M as At,N as It,O as Be,A as ae,a as Rt,x as Me,g as ve,Q as xn,R as yn,U as bn,V as vn,W as He,L as Te,K as Le,a5 as Tt,Z as Yi,j as it,i as an,ad as Zi,C as Is,al as zn,T as Rs,D as Ji,d as Xi,e as er,I as tr,f as $n,G as nr,E as sr,ai as ar,a9 as ir}from"./error-boundary-BcPKKbP5.js";import{t as n,L as Pt}from"./messages-DoRCUI0R.js";import{u as rr,a as or,D as lr}from"./use-default-on-banner-9GIy0N8O.js";import{R as cr}from"./radient-auth-buttons-DYdBNC_-.js";import{N as dr}from"./notebook-pen-CRfFCxXf.js";import{B as ur}from"./book-open-CjMQ2-CP.js";import{i as gr,a as $e,b as mr,p as Kt,f as _r}from"./parseISO-CxPiCKvF.js";import{t as pr}from"./en-US-CW_dDnkH.js";/**
1
+ import{r as l,j as t,c as de,t as ua}from"./index-C4ae8MIc.js";import{o as ga}from"./console-mirror-C-hKgNgn.js";import{d3 as Zt,d4 as ma,d5 as Rn,d6 as De,c8 as _a,a6 as ms,a7 as gn,W as _s,ba as pa,aZ as fa,d7 as ha,d8 as xa,d9 as ya,da as ba,db as ps,dc as mn,a4 as fs,dd as va,de as ka,df as kt,dg as hs,dh as ja,bc as Jt,di as Tn,dj as wa,dk as qe,dl as Et,bJ as _n,dm as pn,cl as jt,bU as Na,dn as xs,dp as Sa,dq as Ma,V as ys,be as Xt,bf as en,aA as Ca,a_ as tn,dr as Ea,ds as Aa,dt as nn,du as Ia,dv as Ra,dw as Ta,dx as bs,dy as La,dz as Oa,dA as Fa,b9 as Da,dB as vs,bd as ks,dC as js,dD as za,dE as $a,dF as Pa,dG as Ka,dH as Ua,dI as Ba,a3 as qa,dJ as Ha,dK as Va,bO as ws,bQ as Ga,dL as Ze,dM as Ln,dN as Qa,dO as Wa,dP as Ya,c3 as Za,dQ as Ja,dR as Xa,ca as ei,dS as ti,dT as ni,dU as si,dV as ai,d2 as zt,dW as ii,dX as ri,az as oi}from"./conversation-input-sync-BwcOsVjK.js";import{i as Ce,u as fn,ak as li,ai as ci,al as di,am as Pe,a as Lt,c as st,an as ui,a3 as gi,ao as mi,ap as _i,aq as pi,ar as fi,d as pe,G as hn,as as hi,q as tt,at as xi,B as Ns,r as yi,C as bi,au as sn,x as et,av as vi,aw as Ss,$ as ki,a0 as ji}from"./path-utils-BqTfmiT0.js";import{dl as Ms,dm as wi,dn as Ni,dp as Cs,dq as Si,c5 as Mi,dr as Ee,N as Ci,S as Es,bs as ot,bt as _e,ds as at,dt as ge,du as $t,dv as Ei,R as Ai,b4 as On,dw as Ii,dx as Ri,dy as Ti,dz as ft,dA as ht,br as Li,bD as Oi,dB as Fi,dC as Di,dD as zi,dE as $i,bh as Fn,dF as Pi,b7 as Ki,bo as Dn,bN as Ui,bp as Bi,bq as qi,dG as Hi,dH as Vi,bg as Gi,dI as Qi}from"./index-pRJvOEvT.js";import{P as Wi}from"./page-header-BnTa4LRQ.js";import{c as F,u as se,B as z,S as ke,Y as As,w as Ve,M as At,N as It,O as Be,A as ae,a as Rt,x as Me,g as ve,Q as xn,R as yn,U as bn,V as vn,W as He,L as Te,K as Le,a5 as Tt,Z as Yi,j as it,i as an,ad as Zi,C as Is,al as zn,T as Rs,D as Ji,d as Xi,e as er,I as tr,f as $n,G as nr,E as sr,ai as ar,a9 as ir}from"./error-boundary-BcPKKbP5.js";import{t as n,L as Pt}from"./messages-DoRCUI0R.js";import{u as rr,a as or,D as lr}from"./use-default-on-banner-Dh8MzHSc.js";import{R as cr}from"./radient-auth-buttons-B6UxMMyL.js";import{N as dr}from"./notebook-pen-CRfFCxXf.js";import{B as ur}from"./book-open-CjMQ2-CP.js";import{i as gr,a as $e,b as mr,p as Kt,f as _r}from"./parseISO-CxPiCKvF.js";import{t as pr}from"./en-US-CW_dDnkH.js";/**
2
2
  * @license lucide-react v0.507.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{g as Y,a as E,b as F}from"./library-page-CTLf85Ok.js";import"./index-C4ae8MIc.js";import"./messages-DoRCUI0R.js";import"./console-mirror-C-hKgNgn.js";import"./path-utils-BqTfmiT0.js";import"./page-header-BnTa4LRQ.js";import"./conversation-input-sync-BwcOsVjK.js";import"./error-boundary-BcPKKbP5.js";import"./index-D9MeD_9S.js";import"./heart-BitlL6xv.js";import"./hash-D74BoaKE.js";import"./use-session-snapshot-BIGyGyQQ.js";const B=["#4472C4","#ED7D31","#A9D18E","#FF0000","#FFC000","#5B9BD5","#70AD47","#C00000","#7030A0","#00B0F0"];function W(n,t){const c=`accent${n%6+1}`;return t[c]?"#"+t[c]:B[n%B.length]}function j(n,t=.45){const c=parseInt(n.slice(1,3),16),s=parseInt(n.slice(3,5),16),a=parseInt(n.slice(5,7),16),p=Math.round(c+(255-c)*t),M=Math.round(s+(255-s)*t),o=Math.round(a+(255-a)*t);return`rgb(${p},${M},${o})`}function G(n){const t=[];for(const c of E(n,"t")){const s=c.textContent.trim();s&&t.push(s)}return t.join(" ")}function V(n){if(!n)return[];const t=Y(n,"ptLst");if(!t)return[];const c=[];for(const s of E(t,"pt")){const a=F(s,"type","node");if(a==="parTrans"||a==="sibTrans")continue;const p=G(s);(p||a==="node")&&c.push({id:F(s,"modelId",""),type:a,text:p})}return c.filter(s=>s.text)}function z(n){if(!n)return"list";const t=Y(n,"layoutDef")||n,s=(F(t,"uniqueId","")||F(t,"defStyle","")||"").toLowerCase();return s.includes("chevron")||s.includes("arrowprocess")||s.includes("process")?"process":s.includes("cycle")||s.includes("continuouscycle")?"cycle":s.includes("hierarchy")||s.includes("orgchart")||s.includes("org")?"hierarchy":s.includes("radial")||s.includes("diverging")?"radial":s.includes("pyramid")||s.includes("invertedpyramid")?"pyramid":s.includes("funnel")?"funnel":s.includes("venn")?"venn":s.includes("matrix")?"matrix":s.includes("list")||s.includes("bullet")?"list":s.includes("relationship")||s.includes("balance")?"relationship":"list"}function $(n,t,c,s,a,p,M,o="#fff",f="center"){if(!t)return;n.save(),n.fillStyle=o,n.textAlign=f,n.textBaseline="middle";const l=t.split(" "),g=M*1.3;let h=[],r="";for(const u of l){const y=r?r+" "+u:u;n.measureText(y).width>a-4&&r?(h.push(r),r=u):r=y}r&&h.push(r);const i=Math.max(1,Math.floor(p/g));h.length>i&&(h=h.slice(0,i));const e=s-(h.length-1)*g/2;for(let u=0;u<h.length;u++)n.fillText(h[u],c,e+u*g);n.restore()}function I(n,t,c,s=14){const a=Math.floor(t/(s*.55)),p=n.split(" "),M=Math.ceil(p.join(" ").length/Math.max(a,1)),o=c/(M*1.4);return Math.max(8,Math.min(s,o))}function L(n,t,c,s,a,p,M,o){n.save(),n.beginPath(),p=Math.min(p,s/2,a/2),n.moveTo(t+p,c),n.arcTo(t+s,c,t+s,c+a,p),n.arcTo(t+s,c+a,t,c+a,p),n.arcTo(t,c+a,t,c,p),n.arcTo(t,c,t+s,c,p),n.closePath(),M&&(n.fillStyle=M,n.fill()),n.restore()}function X(n,t,c,s,a,p,M=1.5){const o=Math.atan2(a-c,s-t),f=8;n.save(),n.strokeStyle=p,n.fillStyle=p,n.lineWidth=M,n.beginPath(),n.moveTo(t,c),n.lineTo(s,a),n.stroke(),n.beginPath(),n.moveTo(s,a),n.lineTo(s-f*Math.cos(o-.4),a-f*Math.sin(o-.4)),n.lineTo(s-f*Math.cos(o+.4),a-f*Math.sin(o+.4)),n.closePath(),n.fill(),n.restore()}function J(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=a/f,g=Math.min(l*.08,10*o),h=Math.min(l*.12,18*o),r=l-h-g,i=p*.7,e=s+(p-i)/2;for(let u=0;u<f;u++){const y=W(u,M),d=c+l*u+g/2,b=u===f-1;n.save(),n.beginPath();const P=d+r+(b?0:h);n.moveTo(d,e),n.lineTo(d+r,e),b||n.lineTo(P,e+i/2),n.lineTo(d+r,e+i),n.lineTo(d,e+i),u>0&&n.lineTo(d+h,e+i/2),n.closePath(),n.fillStyle=y,n.fill(),n.restore();const m=I(t[u].text,r-h,i)*o;n.font=`${m}px sans-serif`;const T=d+(r+(u>0?h:0))/2;$(n,t[u].text,T,e+i/2,r,i,m)}}function K(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=c+a/2,g=s+p/2,h=Math.min(a,p)*.33,r=Math.min(h*.32,40*o);n.save(),n.strokeStyle="#ccc",n.lineWidth=2*o,n.setLineDash([4*o,4*o]),n.beginPath(),n.arc(l,g,h,0,Math.PI*2),n.stroke(),n.setLineDash([]),n.restore();for(let i=0;i<f;i++){const e=i/f*Math.PI*2-Math.PI/2,u=l+h*Math.cos(e),y=g+h*Math.sin(e),d=W(i,M);if(n.save(),n.beginPath(),n.arc(u,y,r,0,Math.PI*2),n.fillStyle=d,n.fill(),n.restore(),f>1){const P=(i+1)/f*Math.PI*2-Math.PI/2,m=(e+P)/2,T=l+h*Math.cos(e+.15),v=g+h*Math.sin(e+.15),k=l+h*Math.cos(P-.15),S=g+h*Math.sin(P-.15);n.save(),n.strokeStyle=d+"99",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(T,v),n.quadraticCurveTo(l+h*1.1*Math.cos(m),g+h*1.1*Math.sin(m),k,S),n.stroke(),n.restore()}const b=I(t[i].text,r*1.7,r*1.2)*o;n.font=`${b}px sans-serif`,$(n,t[i].text,u,y,r*2,r*1.8,b)}}function O(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t[0],l=t.slice(1),g=Math.max(l.length,1),h=p/(l.length>0?2.8:1.2),r=h*.75,i=Math.min(a*.3,160*o),e=r,u=c+(a-i)/2,y=s+(h-e)/2,d=W(0,M);L(n,u,y,i,e,6*o,d);const b=I(f.text,i-10*o,e)*o;if(n.font=`bold ${b}px sans-serif`,$(n,f.text,u+i/2,y+e/2,i-10,e,b),!l.length)return;const P=(a-20*o)/g,m=s+h*1.5,T=y+e,v=m-4*o;n.save(),n.strokeStyle="#999",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(u+i/2,T),n.lineTo(u+i/2,(T+v)/2),n.lineTo(c+10*o,(T+v)/2),n.lineTo(c+a-10*o,(T+v)/2),n.stroke(),n.restore();for(let k=0;k<l.length;k++){const S=c+P*k+8*o,R=m,A=P-16*o,H=r,N=W(k+1,M);n.save(),n.strokeStyle="#999",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(S+A/2,(T+v)/2),n.lineTo(S+A/2,R),n.stroke(),n.restore(),L(n,S,R,A,H,5*o,N);const D=I(l[k].text,A-8*o,H)*o;n.font=`${D}px sans-serif`,$(n,l[k].text,S+A/2,R+H/2,A-8,H,D)}}function Q(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t[0],l=t.slice(1),g=c+a/2,h=s+p/2,r=Math.min(a,p)*.18,i=Math.min(a,p)*.36,e=Math.min(i*.28,38*o),u=l.length||1,y=W(0,M);n.save(),n.beginPath(),n.arc(g,h,r,0,Math.PI*2),n.fillStyle=y,n.fill(),n.restore();const d=I(f.text,r*1.6,r*1.2)*o;n.font=`bold ${d}px sans-serif`,$(n,f.text,g,h,r*2,r*2,d);for(let b=0;b<u;b++){const P=b/u*Math.PI*2-Math.PI/2,m=g+i*Math.cos(P),T=h+i*Math.sin(P),v=W(b+1,M),k=g+r*Math.cos(P),S=h+r*Math.sin(P),R=m-e*Math.cos(P),A=T-e*Math.sin(P);X(n,k,S,R,A,v+"99",1.5*o),n.save(),n.beginPath(),n.arc(m,T,e,0,Math.PI*2),n.fillStyle=v,n.fill(),n.restore();const H=I(l[b].text,e*1.7,e*1.2)*o;n.font=`${H}px sans-serif`,$(n,l[b].text,m,T,e*2,e*1.8,H)}}function U(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f;for(let g=0;g<f;g++){const h=(f-g)/f,r=a*h,i=c+(a-r)/2,e=s+g*l,u=W(g,M);n.save(),n.beginPath(),n.moveTo(i,e+l),n.lineTo(i+r,e+l);const y=a*((f-g-1)/f);n.lineTo(c+(a+y)/2,e),n.lineTo(c+(a-y)/2,e),n.closePath(),n.fillStyle=u,n.strokeStyle="#fff",n.lineWidth=2*o,n.fill(),n.stroke(),n.restore();const d=I(t[g].text,r*.6,l*.7)*o;n.font=`${d}px sans-serif`,$(n,t[g].text,c+a/2,e+l/2,r*.6,l*.7,d)}}function Z(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f;for(let g=0;g<f;g++){const h=1-g/f*.55,r=1-(g+1)/f*.55,i=a*h,e=a*r,u=c+(a-i)/2,y=c+(a-e)/2,d=s+g*l,b=W(g,M);n.save(),n.beginPath(),n.moveTo(u,d),n.lineTo(u+i,d),n.lineTo(y+e,d+l),n.lineTo(y,d+l),n.closePath(),n.fillStyle=b,n.strokeStyle="#fff",n.lineWidth=2*o,n.fill(),n.stroke(),n.restore();const P=(i+e)/2,m=I(t[g].text,P*.8,l*.7)*o;n.font=`${m}px sans-serif`,$(n,t[g].text,c+a/2,d+l/2,P*.8,l*.7,m)}}function _(n,t,c,s,a,p,M,o){if(!t.length)return;const f=Math.min(t.length,4),l=c+a/2,g=s+p/2,h=Math.min(a,p)*(f<=2?.32:.28),r=h*.65,i=[];for(let e=0;e<f;e++)i.push(e/f*Math.PI*2-Math.PI/2);for(let e=0;e<f;e++){const u=f>1?l+r*Math.cos(i[e]):l,y=f>1?g+r*Math.sin(i[e]):g,d=W(e,M);n.save(),n.globalAlpha=.55,n.beginPath(),n.arc(u,y,h,0,Math.PI*2),n.fillStyle=d,n.fill(),n.globalAlpha=1,n.strokeStyle="#fff",n.lineWidth=1.5*o,n.stroke(),n.restore();const b=f>1?l+(r+h*.45)*Math.cos(i[e]):l,P=f>1?g+(r+h*.45)*Math.sin(i[e]):g,m=I(t[e].text,h*1.2,h*.7)*o;n.font=`${m}px sans-serif`,$(n,t[e].text,b,P,h*1.2,h*.7,m,"#333")}}function w(n,t,c,s,a,p,M,o){const f=[t[0]||{text:""},t[1]||{text:""},t[2]||{text:""},t[3]||{text:""}],l=a/2,g=p/2,h=8*o;for(let r=0;r<2;r++)for(let i=0;i<2;i++){const e=r*2+i,u=c+i*l+h,y=s+r*g+h,d=l-h*2,b=g-h*2,P=W(e,M);L(n,u,y,d,b,8*o,P);const m=I(f[e].text,d-10,b)*o;n.font=`${m}px sans-serif`,$(n,f[e].text,u+d/2,y+b/2,d-10,b,m)}}function q(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f,g=Math.min(l*.2,14*o),h=g*3;for(let r=0;r<f;r++){const i=s+r*l,e=i+l/2,u=W(r,M);n.save(),n.beginPath(),n.arc(c+g,e,g,0,Math.PI*2),n.fillStyle=u,n.fill(),n.restore(),L(n,c+h,i+l*.1,a-h-4*o,l*.8,4*o,u+"22");const y=I(t[r].text,a-h-20*o,l*.7)*o;n.font=`${y}px sans-serif`,n.fillStyle="#333",n.textAlign="left",n.textBaseline="middle",n.fillText(t[r].text,c+h+8*o,e)}}function C(n,t,c,s,a,p,M,o){if(t.length<2){q(n,t,c,s,a,p,M,o);return}const f=t[Math.floor(t.length/2)],l=t.slice(0,Math.floor(t.length/2)),g=t.slice(Math.floor(t.length/2)+1),h=c+a/2,r=s+p/2,i=Math.min(a*.14,p*.25),e=W(Math.floor(t.length/2),M);n.save(),n.beginPath(),n.arc(h,r,i,0,Math.PI*2),n.fillStyle=e,n.fill(),n.restore();const u=I(f.text,i*1.6,i*1.2)*o;n.font=`bold ${u}px sans-serif`,$(n,f.text,h,r,i*2,i*1.8,u);const y=p/Math.max(l.length,g.length,1),d=a*.3,b=y*.7,P=(m,T)=>{const v=T==="left"?c:c+a-d,k=T==="left"?h-i:h+i;for(let S=0;S<m.length;S++){const R=s+y*S+(y-b)/2,A=W(S+(T==="right"?l.length+1:0),M);L(n,v,R,d,b,5*o,A);const H=I(m[S].text,d-8,b)*o;n.font=`${H}px sans-serif`,$(n,m[S].text,v+d/2,R+b/2,d-8,b,H);const N=T==="left"?v+d:v;X(n,N,R+b/2,k,r,A+"88",1.5*o)}};P(l,"left"),P(g,"right")}function x(n,t,c,s,a,p,M,o){const f=t.length;if(!f)return;const l=Math.ceil(Math.sqrt(f)),g=Math.ceil(f/l),h=a/l,r=p/g,i=Math.min(h,r)*.1;for(let e=0;e<f;e++){const u=e%l,y=Math.floor(e/l),d=c+u*h+i,b=s+y*r+i,P=h-i*2,m=r-i*2,T=W(e,M);L(n,d,b,P,m,8*o,T),j(T),n.save();const v=n.createLinearGradient(d,b,d,b+m*.5);v.addColorStop(0,"rgba(255,255,255,0.18)"),v.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=v,n.beginPath(),n.roundRect?.(d,b,P,m,8*o),n.fill(),n.restore();const k=I(t[e].text,P-12*o,m)*o;n.font=`${k}px sans-serif`,$(n,t[e].text,d+P/2,b+m/2,P-12*o,m,k)}}function gn(n,t,c,s,a,p,M,o,f){const l=V(t),g=z(c),h=16*f;n.save(),n.fillStyle="#f7f9fc",n.strokeStyle="#e0e4ec",n.lineWidth=1,n.beginPath(),n.roundRect?.(s,a,p,M,6*f)||n.rect(s,a,p,M),n.fill(),n.stroke();const r=s+h,i=a+h,e=p-h*2,u=M-h*2;if(!l.length){n.fillStyle="#aaa",n.font=`${12*f}px sans-serif`,n.textAlign="center",n.textBaseline="middle",n.fillText("SmartArt Diagram",s+p/2,a+M/2),n.restore();return}switch(g){case"process":J(n,l,r,i,e,u,o,f);break;case"cycle":K(n,l,r,i,e,u,o,f);break;case"hierarchy":O(n,l,r,i,e,u,o,f);break;case"radial":Q(n,l,r,i,e,u,o,f);break;case"pyramid":U(n,l,r,i,e,u,o,f);break;case"funnel":Z(n,l,r,i,e,u,o,f);break;case"venn":_(n,l,r,i,e,u,o,f);break;case"matrix":w(n,l,r,i,e,u,o,f);break;case"list":q(n,l,r,i,e,u,o,f);break;case"relationship":C(n,l,r,i,e,u,o,f);break;default:x(n,l,r,i,e,u,o,f)}n.restore()}export{gn as renderSmartArt};
1
+ import{g as Y,a as E,b as F}from"./library-page--nTYgR0k.js";import"./index-C4ae8MIc.js";import"./messages-DoRCUI0R.js";import"./console-mirror-C-hKgNgn.js";import"./path-utils-BqTfmiT0.js";import"./page-header-BnTa4LRQ.js";import"./conversation-input-sync-BwcOsVjK.js";import"./error-boundary-BcPKKbP5.js";import"./index-pRJvOEvT.js";import"./heart-BitlL6xv.js";import"./hash-D74BoaKE.js";import"./use-session-snapshot-BIGyGyQQ.js";const B=["#4472C4","#ED7D31","#A9D18E","#FF0000","#FFC000","#5B9BD5","#70AD47","#C00000","#7030A0","#00B0F0"];function W(n,t){const c=`accent${n%6+1}`;return t[c]?"#"+t[c]:B[n%B.length]}function j(n,t=.45){const c=parseInt(n.slice(1,3),16),s=parseInt(n.slice(3,5),16),a=parseInt(n.slice(5,7),16),p=Math.round(c+(255-c)*t),M=Math.round(s+(255-s)*t),o=Math.round(a+(255-a)*t);return`rgb(${p},${M},${o})`}function G(n){const t=[];for(const c of E(n,"t")){const s=c.textContent.trim();s&&t.push(s)}return t.join(" ")}function V(n){if(!n)return[];const t=Y(n,"ptLst");if(!t)return[];const c=[];for(const s of E(t,"pt")){const a=F(s,"type","node");if(a==="parTrans"||a==="sibTrans")continue;const p=G(s);(p||a==="node")&&c.push({id:F(s,"modelId",""),type:a,text:p})}return c.filter(s=>s.text)}function z(n){if(!n)return"list";const t=Y(n,"layoutDef")||n,s=(F(t,"uniqueId","")||F(t,"defStyle","")||"").toLowerCase();return s.includes("chevron")||s.includes("arrowprocess")||s.includes("process")?"process":s.includes("cycle")||s.includes("continuouscycle")?"cycle":s.includes("hierarchy")||s.includes("orgchart")||s.includes("org")?"hierarchy":s.includes("radial")||s.includes("diverging")?"radial":s.includes("pyramid")||s.includes("invertedpyramid")?"pyramid":s.includes("funnel")?"funnel":s.includes("venn")?"venn":s.includes("matrix")?"matrix":s.includes("list")||s.includes("bullet")?"list":s.includes("relationship")||s.includes("balance")?"relationship":"list"}function $(n,t,c,s,a,p,M,o="#fff",f="center"){if(!t)return;n.save(),n.fillStyle=o,n.textAlign=f,n.textBaseline="middle";const l=t.split(" "),g=M*1.3;let h=[],r="";for(const u of l){const y=r?r+" "+u:u;n.measureText(y).width>a-4&&r?(h.push(r),r=u):r=y}r&&h.push(r);const i=Math.max(1,Math.floor(p/g));h.length>i&&(h=h.slice(0,i));const e=s-(h.length-1)*g/2;for(let u=0;u<h.length;u++)n.fillText(h[u],c,e+u*g);n.restore()}function I(n,t,c,s=14){const a=Math.floor(t/(s*.55)),p=n.split(" "),M=Math.ceil(p.join(" ").length/Math.max(a,1)),o=c/(M*1.4);return Math.max(8,Math.min(s,o))}function L(n,t,c,s,a,p,M,o){n.save(),n.beginPath(),p=Math.min(p,s/2,a/2),n.moveTo(t+p,c),n.arcTo(t+s,c,t+s,c+a,p),n.arcTo(t+s,c+a,t,c+a,p),n.arcTo(t,c+a,t,c,p),n.arcTo(t,c,t+s,c,p),n.closePath(),M&&(n.fillStyle=M,n.fill()),n.restore()}function X(n,t,c,s,a,p,M=1.5){const o=Math.atan2(a-c,s-t),f=8;n.save(),n.strokeStyle=p,n.fillStyle=p,n.lineWidth=M,n.beginPath(),n.moveTo(t,c),n.lineTo(s,a),n.stroke(),n.beginPath(),n.moveTo(s,a),n.lineTo(s-f*Math.cos(o-.4),a-f*Math.sin(o-.4)),n.lineTo(s-f*Math.cos(o+.4),a-f*Math.sin(o+.4)),n.closePath(),n.fill(),n.restore()}function J(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=a/f,g=Math.min(l*.08,10*o),h=Math.min(l*.12,18*o),r=l-h-g,i=p*.7,e=s+(p-i)/2;for(let u=0;u<f;u++){const y=W(u,M),d=c+l*u+g/2,b=u===f-1;n.save(),n.beginPath();const P=d+r+(b?0:h);n.moveTo(d,e),n.lineTo(d+r,e),b||n.lineTo(P,e+i/2),n.lineTo(d+r,e+i),n.lineTo(d,e+i),u>0&&n.lineTo(d+h,e+i/2),n.closePath(),n.fillStyle=y,n.fill(),n.restore();const m=I(t[u].text,r-h,i)*o;n.font=`${m}px sans-serif`;const T=d+(r+(u>0?h:0))/2;$(n,t[u].text,T,e+i/2,r,i,m)}}function K(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=c+a/2,g=s+p/2,h=Math.min(a,p)*.33,r=Math.min(h*.32,40*o);n.save(),n.strokeStyle="#ccc",n.lineWidth=2*o,n.setLineDash([4*o,4*o]),n.beginPath(),n.arc(l,g,h,0,Math.PI*2),n.stroke(),n.setLineDash([]),n.restore();for(let i=0;i<f;i++){const e=i/f*Math.PI*2-Math.PI/2,u=l+h*Math.cos(e),y=g+h*Math.sin(e),d=W(i,M);if(n.save(),n.beginPath(),n.arc(u,y,r,0,Math.PI*2),n.fillStyle=d,n.fill(),n.restore(),f>1){const P=(i+1)/f*Math.PI*2-Math.PI/2,m=(e+P)/2,T=l+h*Math.cos(e+.15),v=g+h*Math.sin(e+.15),k=l+h*Math.cos(P-.15),S=g+h*Math.sin(P-.15);n.save(),n.strokeStyle=d+"99",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(T,v),n.quadraticCurveTo(l+h*1.1*Math.cos(m),g+h*1.1*Math.sin(m),k,S),n.stroke(),n.restore()}const b=I(t[i].text,r*1.7,r*1.2)*o;n.font=`${b}px sans-serif`,$(n,t[i].text,u,y,r*2,r*1.8,b)}}function O(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t[0],l=t.slice(1),g=Math.max(l.length,1),h=p/(l.length>0?2.8:1.2),r=h*.75,i=Math.min(a*.3,160*o),e=r,u=c+(a-i)/2,y=s+(h-e)/2,d=W(0,M);L(n,u,y,i,e,6*o,d);const b=I(f.text,i-10*o,e)*o;if(n.font=`bold ${b}px sans-serif`,$(n,f.text,u+i/2,y+e/2,i-10,e,b),!l.length)return;const P=(a-20*o)/g,m=s+h*1.5,T=y+e,v=m-4*o;n.save(),n.strokeStyle="#999",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(u+i/2,T),n.lineTo(u+i/2,(T+v)/2),n.lineTo(c+10*o,(T+v)/2),n.lineTo(c+a-10*o,(T+v)/2),n.stroke(),n.restore();for(let k=0;k<l.length;k++){const S=c+P*k+8*o,R=m,A=P-16*o,H=r,N=W(k+1,M);n.save(),n.strokeStyle="#999",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(S+A/2,(T+v)/2),n.lineTo(S+A/2,R),n.stroke(),n.restore(),L(n,S,R,A,H,5*o,N);const D=I(l[k].text,A-8*o,H)*o;n.font=`${D}px sans-serif`,$(n,l[k].text,S+A/2,R+H/2,A-8,H,D)}}function Q(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t[0],l=t.slice(1),g=c+a/2,h=s+p/2,r=Math.min(a,p)*.18,i=Math.min(a,p)*.36,e=Math.min(i*.28,38*o),u=l.length||1,y=W(0,M);n.save(),n.beginPath(),n.arc(g,h,r,0,Math.PI*2),n.fillStyle=y,n.fill(),n.restore();const d=I(f.text,r*1.6,r*1.2)*o;n.font=`bold ${d}px sans-serif`,$(n,f.text,g,h,r*2,r*2,d);for(let b=0;b<u;b++){const P=b/u*Math.PI*2-Math.PI/2,m=g+i*Math.cos(P),T=h+i*Math.sin(P),v=W(b+1,M),k=g+r*Math.cos(P),S=h+r*Math.sin(P),R=m-e*Math.cos(P),A=T-e*Math.sin(P);X(n,k,S,R,A,v+"99",1.5*o),n.save(),n.beginPath(),n.arc(m,T,e,0,Math.PI*2),n.fillStyle=v,n.fill(),n.restore();const H=I(l[b].text,e*1.7,e*1.2)*o;n.font=`${H}px sans-serif`,$(n,l[b].text,m,T,e*2,e*1.8,H)}}function U(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f;for(let g=0;g<f;g++){const h=(f-g)/f,r=a*h,i=c+(a-r)/2,e=s+g*l,u=W(g,M);n.save(),n.beginPath(),n.moveTo(i,e+l),n.lineTo(i+r,e+l);const y=a*((f-g-1)/f);n.lineTo(c+(a+y)/2,e),n.lineTo(c+(a-y)/2,e),n.closePath(),n.fillStyle=u,n.strokeStyle="#fff",n.lineWidth=2*o,n.fill(),n.stroke(),n.restore();const d=I(t[g].text,r*.6,l*.7)*o;n.font=`${d}px sans-serif`,$(n,t[g].text,c+a/2,e+l/2,r*.6,l*.7,d)}}function Z(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f;for(let g=0;g<f;g++){const h=1-g/f*.55,r=1-(g+1)/f*.55,i=a*h,e=a*r,u=c+(a-i)/2,y=c+(a-e)/2,d=s+g*l,b=W(g,M);n.save(),n.beginPath(),n.moveTo(u,d),n.lineTo(u+i,d),n.lineTo(y+e,d+l),n.lineTo(y,d+l),n.closePath(),n.fillStyle=b,n.strokeStyle="#fff",n.lineWidth=2*o,n.fill(),n.stroke(),n.restore();const P=(i+e)/2,m=I(t[g].text,P*.8,l*.7)*o;n.font=`${m}px sans-serif`,$(n,t[g].text,c+a/2,d+l/2,P*.8,l*.7,m)}}function _(n,t,c,s,a,p,M,o){if(!t.length)return;const f=Math.min(t.length,4),l=c+a/2,g=s+p/2,h=Math.min(a,p)*(f<=2?.32:.28),r=h*.65,i=[];for(let e=0;e<f;e++)i.push(e/f*Math.PI*2-Math.PI/2);for(let e=0;e<f;e++){const u=f>1?l+r*Math.cos(i[e]):l,y=f>1?g+r*Math.sin(i[e]):g,d=W(e,M);n.save(),n.globalAlpha=.55,n.beginPath(),n.arc(u,y,h,0,Math.PI*2),n.fillStyle=d,n.fill(),n.globalAlpha=1,n.strokeStyle="#fff",n.lineWidth=1.5*o,n.stroke(),n.restore();const b=f>1?l+(r+h*.45)*Math.cos(i[e]):l,P=f>1?g+(r+h*.45)*Math.sin(i[e]):g,m=I(t[e].text,h*1.2,h*.7)*o;n.font=`${m}px sans-serif`,$(n,t[e].text,b,P,h*1.2,h*.7,m,"#333")}}function w(n,t,c,s,a,p,M,o){const f=[t[0]||{text:""},t[1]||{text:""},t[2]||{text:""},t[3]||{text:""}],l=a/2,g=p/2,h=8*o;for(let r=0;r<2;r++)for(let i=0;i<2;i++){const e=r*2+i,u=c+i*l+h,y=s+r*g+h,d=l-h*2,b=g-h*2,P=W(e,M);L(n,u,y,d,b,8*o,P);const m=I(f[e].text,d-10,b)*o;n.font=`${m}px sans-serif`,$(n,f[e].text,u+d/2,y+b/2,d-10,b,m)}}function q(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f,g=Math.min(l*.2,14*o),h=g*3;for(let r=0;r<f;r++){const i=s+r*l,e=i+l/2,u=W(r,M);n.save(),n.beginPath(),n.arc(c+g,e,g,0,Math.PI*2),n.fillStyle=u,n.fill(),n.restore(),L(n,c+h,i+l*.1,a-h-4*o,l*.8,4*o,u+"22");const y=I(t[r].text,a-h-20*o,l*.7)*o;n.font=`${y}px sans-serif`,n.fillStyle="#333",n.textAlign="left",n.textBaseline="middle",n.fillText(t[r].text,c+h+8*o,e)}}function C(n,t,c,s,a,p,M,o){if(t.length<2){q(n,t,c,s,a,p,M,o);return}const f=t[Math.floor(t.length/2)],l=t.slice(0,Math.floor(t.length/2)),g=t.slice(Math.floor(t.length/2)+1),h=c+a/2,r=s+p/2,i=Math.min(a*.14,p*.25),e=W(Math.floor(t.length/2),M);n.save(),n.beginPath(),n.arc(h,r,i,0,Math.PI*2),n.fillStyle=e,n.fill(),n.restore();const u=I(f.text,i*1.6,i*1.2)*o;n.font=`bold ${u}px sans-serif`,$(n,f.text,h,r,i*2,i*1.8,u);const y=p/Math.max(l.length,g.length,1),d=a*.3,b=y*.7,P=(m,T)=>{const v=T==="left"?c:c+a-d,k=T==="left"?h-i:h+i;for(let S=0;S<m.length;S++){const R=s+y*S+(y-b)/2,A=W(S+(T==="right"?l.length+1:0),M);L(n,v,R,d,b,5*o,A);const H=I(m[S].text,d-8,b)*o;n.font=`${H}px sans-serif`,$(n,m[S].text,v+d/2,R+b/2,d-8,b,H);const N=T==="left"?v+d:v;X(n,N,R+b/2,k,r,A+"88",1.5*o)}};P(l,"left"),P(g,"right")}function x(n,t,c,s,a,p,M,o){const f=t.length;if(!f)return;const l=Math.ceil(Math.sqrt(f)),g=Math.ceil(f/l),h=a/l,r=p/g,i=Math.min(h,r)*.1;for(let e=0;e<f;e++){const u=e%l,y=Math.floor(e/l),d=c+u*h+i,b=s+y*r+i,P=h-i*2,m=r-i*2,T=W(e,M);L(n,d,b,P,m,8*o,T),j(T),n.save();const v=n.createLinearGradient(d,b,d,b+m*.5);v.addColorStop(0,"rgba(255,255,255,0.18)"),v.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=v,n.beginPath(),n.roundRect?.(d,b,P,m,8*o),n.fill(),n.restore();const k=I(t[e].text,P-12*o,m)*o;n.font=`${k}px sans-serif`,$(n,t[e].text,d+P/2,b+m/2,P-12*o,m,k)}}function gn(n,t,c,s,a,p,M,o,f){const l=V(t),g=z(c),h=16*f;n.save(),n.fillStyle="#f7f9fc",n.strokeStyle="#e0e4ec",n.lineWidth=1,n.beginPath(),n.roundRect?.(s,a,p,M,6*f)||n.rect(s,a,p,M),n.fill(),n.stroke();const r=s+h,i=a+h,e=p-h*2,u=M-h*2;if(!l.length){n.fillStyle="#aaa",n.font=`${12*f}px sans-serif`,n.textAlign="center",n.textBaseline="middle",n.fillText("SmartArt Diagram",s+p/2,a+M/2),n.restore();return}switch(g){case"process":J(n,l,r,i,e,u,o,f);break;case"cycle":K(n,l,r,i,e,u,o,f);break;case"hierarchy":O(n,l,r,i,e,u,o,f);break;case"radial":Q(n,l,r,i,e,u,o,f);break;case"pyramid":U(n,l,r,i,e,u,o,f);break;case"funnel":Z(n,l,r,i,e,u,o,f);break;case"venn":_(n,l,r,i,e,u,o,f);break;case"matrix":w(n,l,r,i,e,u,o,f);break;case"list":q(n,l,r,i,e,u,o,f);break;case"relationship":C(n,l,r,i,e,u,o,f);break;default:x(n,l,r,i,e,u,o,f)}n.restore()}export{gn as renderSmartArt};