writer 1.23.0rc6__py3-none-any.whl → 1.26.0rc3__py3-none-any.whl

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 (81) hide show
  1. writer/ai/__init__.py +39 -1
  2. writer/blocks/__init__.py +2 -0
  3. writer/blocks/sharedblueprint.py +86 -0
  4. writer/blueprints.py +57 -64
  5. writer/journal.py +96 -38
  6. writer/static/assets/BaseMarkdown-C7JpFNzG.js +1 -0
  7. writer/static/assets/BlueprintToolbar-Qq1M1yPa.js +1 -0
  8. writer/static/assets/{BlueprintToolbar-BSIwpBPp.css → BlueprintToolbar-wpfX0jo_.css} +1 -1
  9. writer/static/assets/{BuilderApp-Df1h8-Eo.js → BuilderApp-CVdXjiyA.js} +3 -3
  10. writer/static/assets/{BuilderApplicationSelect-C112wzDI.js → BuilderApplicationSelect-BJ3WU4j8.js} +2 -2
  11. writer/static/assets/BuilderBlueprintLibraryPanel-BB2BzDiO.js +1 -0
  12. writer/static/assets/BuilderBlueprintLibraryPanel-qrkMQJpE.css +1 -0
  13. writer/static/assets/{BuilderEmbeddedCodeEditor-DG2PsuIn.js → BuilderEmbeddedCodeEditor-Bp4akO9H.js} +6 -6
  14. writer/static/assets/{BuilderGraphSelect-CZyeW98W.js → BuilderGraphSelect-DqqflOEF.js} +2 -2
  15. writer/static/assets/{BuilderInsertionLabel-CdV8k3Zg.js → BuilderInsertionLabel-DcnE9VFH.js} +1 -1
  16. writer/static/assets/{BuilderInsertionOverlay-DH0Erxyl.js → BuilderInsertionOverlay-CVXHfCDG.js} +1 -1
  17. writer/static/assets/BuilderJournal-BkdpDeUE.js +7 -0
  18. writer/static/assets/{BuilderJournal-DAQcshng.css → BuilderJournal-DHv3Pvvm.css} +1 -1
  19. writer/static/assets/{BuilderModelSelect-Bpt2wAoy.js → BuilderModelSelect-B3mOzDst.js} +2 -2
  20. writer/static/assets/BuilderSettings-7A3iq6cl.js +16 -0
  21. writer/static/assets/{BuilderSettings-BDCWmj-0.css → BuilderSettings-BN0g4wlH.css} +1 -1
  22. writer/static/assets/{BuilderSettingsArtifactAPITriggerDetails-Ce77KBfh.js → BuilderSettingsArtifactAPITriggerDetails-FkIt0kMq.js} +1 -1
  23. writer/static/assets/BuilderSettingsDeploySharedBlueprint-BdDSjNAL.css +1 -0
  24. writer/static/assets/BuilderSettingsDeploySharedBlueprint-BuSxeIj-.js +1 -0
  25. writer/static/assets/BuilderSettingsHandlers-DbeF71aV.js +1 -0
  26. writer/static/assets/BuilderSidebarComponentTree-C14x1rVr.js +1 -0
  27. writer/static/assets/BuilderSidebarComponentTree-DYu1F793.css +1 -0
  28. writer/static/assets/BuilderSidebarToolkit-CwqbjRv8.css +1 -0
  29. writer/static/assets/BuilderSidebarToolkit-jy_A1o9f.js +7 -0
  30. writer/static/assets/{BuilderTemplateEditor-C0IFlyo0.js → BuilderTemplateEditor-BIgBS6qi.js} +1 -1
  31. writer/static/assets/BuilderVault-BgiAbw0w.js +1 -0
  32. writer/static/assets/{ComponentRenderer-DQTge-u5.js → ComponentRenderer-BJGX_6iU.js} +1 -1
  33. writer/static/assets/{SharedCopyClipboardButton-DLDKJqmO.js → SharedCopyClipboardButton-ed8bYNvB.js} +1 -1
  34. writer/static/assets/{WdsCheckbox-DyaMkyjM.js → WdsCheckbox-BYGFbKQr.js} +1 -1
  35. writer/static/assets/{WdsDropdownMenu-1kTugbx4.js → WdsDropdownMenu-C1nXnj7Y.js} +1 -1
  36. writer/static/assets/WdsFieldWrapper-DUvtHQhU.js +1 -0
  37. writer/static/assets/{WdsTabs-cGyj5MvP.js → WdsTabs-D3_pIGba.js} +1 -1
  38. writer/static/assets/{cssMode-BNzP_LTj.js → cssMode-4RB2gbaz.js} +1 -1
  39. writer/static/assets/{freemarker2-3oFbujgY.js → freemarker2-DTEq8jtt.js} +1 -1
  40. writer/static/assets/{handlebars-tosvcMfZ.js → handlebars-Bgenl5pg.js} +1 -1
  41. writer/static/assets/{html-C40vkof5.js → html-bSIJxImc.js} +1 -1
  42. writer/static/assets/{htmlMode-IleWCzJi.js → htmlMode-DIJZeCM_.js} +1 -1
  43. writer/static/assets/{index-DOMal5wc.css → index-BKNuk68o.css} +1 -1
  44. writer/static/assets/{index-D7Q_1TlJ.js → index-BO2lDBxy.js} +1 -1
  45. writer/static/assets/{index-522ZtJjE.js → index-CStxQ_Zn.js} +1 -1
  46. writer/static/assets/{index-Bz7k91zI.js → index-Tfvjt7wd.js} +1684 -1684
  47. writer/static/assets/{javascript-B93kRLOk.js → javascript-DEKuJ5Kr.js} +1 -1
  48. writer/static/assets/{jsonMode-BvzFLYFi.js → jsonMode-P6mvp974.js} +1 -1
  49. writer/static/assets/{liquid-DUum66og.js → liquid-CLV-Oo7T.js} +1 -1
  50. writer/static/assets/{mapbox-gl-CxU14gUr.js → mapbox-gl-DBM-6gcD.js} +1 -1
  51. writer/static/assets/{mdx-dIi1xsKV.js → mdx-D9lLpWK9.js} +1 -1
  52. writer/static/assets/{pdf-C6_Z6EhB.js → pdf-Car1WtOr.js} +1 -1
  53. writer/static/assets/{plotly.min-B2Fen0AF.js → plotly.min-B_7RxSHC.js} +1 -1
  54. writer/static/assets/{python-DbQOvIm1.js → python-CKNDy5FF.js} +1 -1
  55. writer/static/assets/{razor-BmVb2CjQ.js → razor-Hz0J-1ka.js} +1 -1
  56. writer/static/assets/{tsMode-CA0I8nL6.js → tsMode-CNnhj71T.js} +1 -1
  57. writer/static/assets/{typescript-DZ0ESF3e.js → typescript-DBSqcEcy.js} +1 -1
  58. writer/static/assets/{useBlueprintRun-DSOR9GMr.js → useBlueprintRun-BfljCQFl.js} +1 -1
  59. writer/static/assets/useKeyValueEditor-D9cp0yxU.js +1 -0
  60. writer/static/assets/{useListResources-yMzGtfQ-.js → useListResources-Dz7zv-sv.js} +1 -1
  61. writer/static/assets/{xml-C_vN9YaG.js → xml-9fwRtLLU.js} +1 -1
  62. writer/static/assets/{yaml-CkZwQHIk.js → yaml-COXu8O5A.js} +1 -1
  63. writer/static/index.html +2 -2
  64. {writer-1.23.0rc6.dist-info → writer-1.26.0rc3.dist-info}/METADATA +2 -2
  65. {writer-1.23.0rc6.dist-info → writer-1.26.0rc3.dist-info}/RECORD +69 -64
  66. writer/static/assets/BaseMarkdown-CkzyohPW.js +0 -1
  67. writer/static/assets/BlueprintToolbar-Beg4BHcc.js +0 -1
  68. writer/static/assets/BuilderJournal-Cyr5afZb.js +0 -7
  69. writer/static/assets/BuilderSettings-oKMwMRAY.js +0 -16
  70. writer/static/assets/BuilderSettingsHandlers-B3yTZdYU.js +0 -1
  71. writer/static/assets/BuilderSidebarComponentTree-C5AMKQcR.css +0 -1
  72. writer/static/assets/BuilderSidebarComponentTree-l1fr5tUm.js +0 -1
  73. writer/static/assets/BuilderSidebarToolkit-OFxghtWy.css +0 -1
  74. writer/static/assets/BuilderSidebarToolkit-iUsHlK39.js +0 -1
  75. writer/static/assets/BuilderVault-CaBwjxyR.js +0 -1
  76. writer/static/assets/useComponentDescription-CI_QLr37.js +0 -1
  77. writer/static/assets/useKeyValueEditor-DctSXoZx.js +0 -1
  78. /writer/static/assets/{useKeyValueEditor-CsemOh8D.css → WdsFieldWrapper-CsemOh8D.css} +0 -0
  79. {writer-1.23.0rc6.dist-info → writer-1.26.0rc3.dist-info}/WHEEL +0 -0
  80. {writer-1.23.0rc6.dist-info → writer-1.26.0rc3.dist-info}/entry_points.txt +0 -0
  81. {writer-1.23.0rc6.dist-info → writer-1.26.0rc3.dist-info}/licenses/LICENSE.txt +0 -0
@@ -0,0 +1 @@
1
+ import{d as L,i as S,a as h,c as a,o as g,f as $,J as R,g as b,x as l,y as H,R as o,at as E,aF as U,S as N,_ as O,u as Q,bx as X,V as Y,z as w,W,t as Z,b as q,D as J,E as K,ax as ee,aI as te,A as ne,l as se}from"./index-Tfvjt7wd.js";import{W as V,b as G}from"./BuilderApp-CVdXjiyA.js";import{a as re}from"./useBlueprintRun-BfljCQFl.js";import{W as ie}from"./BuilderSettings-7A3iq6cl.js";import"./WdsCheckbox-BYGFbKQr.js";import"./marked.esm-273vDTCT.js";import"./WdsDropdownMenu-C1nXnj7Y.js";import"./WdsTabs-D3_pIGba.js";import"./WdsFieldWrapper-DUvtHQhU.js";import"./useKeyValueEditor-D9cp0yxU.js";const oe={class:"BuilderBlueprintState"},le={class:"BuilderBlueprintState__status BuilderBlueprintState__status--success"},ae={class:"BuilderBlueprintState__status BuilderBlueprintState__status--error"},ue=L({__name:"BuilderBlueprintState",props:{blueprintId:{type:String,required:!0}},setup(y){const r=y,u=S(h.core),i=S(h.builderManager),m=a(()=>u.getComponents(r.blueprintId)),x=a(()=>m.value.map(c=>c.id)),_=a(()=>{var t,f,p;const d=(t=i.getLogEntries().filter(B=>B.blueprintExecution?B.blueprintExecution.summary.some(C=>x.value.includes(C.componentId)):!1).at(0))==null?void 0:t.blueprintExecution.summary.at(-1);if(!d)return;if(d.outcome==="in_progress")return"in_progress";const k=u.getComponentById(d.componentId);return((p=(f=u.getComponentDefinition(k.type).outs)==null?void 0:f[d.outcome])==null?void 0:p.style)??"success"});return(c,d)=>(g(),$("div",oe,[_.value?_.value==="success"?R(c.$slots,"success",{key:1},()=>[b("div",le,[l(H,{name:"check"})])],!0):_.value==="error"?R(c.$slots,"error",{key:2},()=>[b("div",ae,[l(H,{name:"circle-alert"})])],!0):_.value==="in_progress"?R(c.$slots,"running",{key:3},()=>[l(U,{class:"BuilderBlueprintState__status",color:o(E).Gray5},null,8,["color"])],!0):N("",!0):R(c.$slots,"unknown",{key:0},void 0,!0)]))}}),ce=O(ue,[["__scopeId","data-v-1ef50b43"]]),de=["aria-busy"],pe={class:"BuilderSettingsHandlersBlueprint__title"},me={class:"BuilderSettingsHandlersBlueprint__list"},_e={class:"BuilderSettingsHandlersBlueprint__list__item"},ve={class:"BuilderSettingsHandlersBlueprint__list__item"},fe=L({__name:"BuilderSettingsHandlersBlueprint",props:{component:{type:Object,required:!0},eventType:{type:String,required:!0},eventDescription:{type:String,required:!1,default:void 0}},setup(y){const r=S(h.core),u=S(h.builderManager),i=y,m=Q(r),{createAndInsertComponentsTree:x,removeComponentsSubtree:_}=ee(r,u,m),c=a(()=>i.eventType.replace(/^wf-/,"").replaceAll("-"," ")),{blueprints:d,triggers:k}=X(r,a(()=>i.component.id),a(()=>i.eventType)),{run:v,isRunning:t}=re(r,a(()=>k.value.map(e=>({blueprintId:e.parentId,branchId:e.id})))),{pushToast:f}=Y();function p(){const e=d.value.map(s=>{const n=(s.content.key??"0").match(/\d+/);return n?Number(n[0]):0});return e.length===0?1:Math.max(...e)+1}async function B(){var A;const{type:e}=i.component,{name:s,events:n}=r.getComponentDefinition(e),D=`${s} - ${i.eventType}`,j=`${e}@${i.eventType.replace(/^wf-/,"")}_${p()}`;let T=(A=n==null?void 0:n[i.eventType])==null?void 0:A.eventPayloadExample;typeof T=="object"&&T!==null&&(T=JSON.stringify(T));const[z]=x("blueprints_root",[{type:"blueprints_blueprint",initProperties:{content:{key:j}}},{type:"blueprints_uieventtrigger",initProperties:{content:{alias:D,refComponentId:i.component.id,refEventType:i.eventType,defaultResult:T?String(T):void 0},x:96,y:96}}]);f({type:"success",message:`${D} added`,action:{label:"Go to blueprint",func:()=>{var F;return P(z,(F=I(z))==null?void 0:F.id)},icon:"wds-blueprints"}})}function I(e){return r.getComponents(e).find(s=>s.type==="blueprints_uieventtrigger"&&s.content.refComponentId===i.component.id&&s.content.refEventType===i.eventType)}function C(e){const s=[e.id];r.getComponents(e.parentId).length===1&&s.push(e.parentId),_(...s)}function M(e){var s,n;return((n=(s=r.getComponentById(e.parentId))==null?void 0:s.content)==null?void 0:n.key)||"Blueprint"}function P(e,s){r.setActivePageId(e),u.setMode("blueprints"),u.setSelection(s??e,void 0,"click")}return(e,s)=>(g(),$("div",{class:"BuilderSettingsHandlersBlueprint","aria-busy":o(t)},[b("div",pe,[l(W,{class:"BuilderSettingsHandlersBlueprint__title__btn",variant:"special",size:"icon","aria-label":"Run the attached blueprints",disabled:o(t),loading:o(t),onClick:o(v)},{default:w(()=>[l(H,{name:"play"})]),_:1},8,["disabled","loading","onClick"]),b("p",null,Z(c.value),1),y.eventDescription?(g(),q(W,{key:0,"data-writer-tooltip":y.eventDescription,variant:"neutral",size:"smallIcon","custom-size":"18px"},{default:w(()=>[l(H,{name:"circle-question-mark"})]),_:1},8,["data-writer-tooltip"])):N("",!0)]),b("div",me,[(g(!0),$(J,null,K(o(k),(n,D)=>(g(),q(G,{key:n.id,color:o(E).Blue6,"color-last":o(k).length===D+1?o(E).Blue2:o(E).Blue6},{default:w(()=>[b("div",_e,[l(V,{variant:"secondary",disabled:o(t),text:M(n),"data-writer-tooltip":M(n),"data-writer-tooltip-strategy":"overflow",onClick:j=>P(n.parentId,n.id)},null,8,["disabled","text","data-writer-tooltip","onClick"]),l(ce,{"blueprint-id":n.parentId},null,8,["blueprint-id"]),l(W,{variant:"neutral",size:"smallIcon","custom-size":"18px","aria-label":"Unlink blueprint","data-writer-tooltip":"This will remove the trigger but will not delete the blueprint",disabled:o(t),onClick:j=>C(n)},{default:w(()=>[l(H,{name:"link-2-off"})]),_:2},1032,["disabled","onClick"])])]),_:2},1032,["color","color-last"]))),128)),l(G,{"is-last":"",color:o(E).Blue2},{default:w(()=>[b("div",ve,[l(V,{variant:"primary",weight:"semibold",disabled:o(t),"left-icon":"plus",text:"Create blueprint",onClick:B},null,8,["disabled"])])]),_:1},8,["color"])])],8,de))}}),Be=O(fe,[["__scopeId","data-v-5af57bf8"]]),be=["inert"],ge={class:"BuilderSettingsHandlers__list"},ye=L({__name:"BuilderSettingsHandlers",props:{isReadOnly:{type:Boolean}},setup(y){const r=S(h.core),u=S(h.builderManager),i=S(h.secretsManager),m=a(()=>r.getComponentById(u.firstSelectedId.value)),x=a(()=>{var v,t;return te((t=(v=u.firstSelectedItem)==null?void 0:v.value)==null?void 0:t.instancePath)}),{getEvaluatedFields:_}=se(r,i),c=a(()=>_(x.value)),d=a(()=>{if(!m.value)return{};const{type:v}=m.value,t=r.getComponentDefinition(v),f=(t==null?void 0:t.events)??{},p=Object.entries(f).filter(([I,C])=>C.enabled===void 0?!0:C.enabled({evaluatedFields:c.value})),B=Object.fromEntries(p);return Object.keys({...m.value.handlers}).forEach(I=>{B[I]||(B[I]={desc:"Custom event"})}),B}),k=a(()=>u.isSingleSelectionActive.value?Object.keys(d.value).length>0:!1);return(v,t)=>k.value?(g(),$("div",{key:0,inert:y.isReadOnly,class:"BuilderSettingsHandlers"},[l(ie,{class:"BuilderSettingsHandlers__title"},{default:w(()=>t[0]||(t[0]=[ne("Blueprints")])),_:1}),b("div",ge,[(g(!0),$(J,null,K(d.value,(f,p)=>(g(),$("div",{key:p},[l(Be,{component:m.value,"event-type":p,"event-description":f.desc},null,8,["component","event-type","event-description"])]))),128))])],8,be)):N("",!0)}}),He=O(ye,[["__scopeId","data-v-7bb69b92"]]);export{He as default};
@@ -0,0 +1 @@
1
+ import{a as pe,B as me}from"./BuilderApp-CVdXjiyA.js";import{c as p,d as J,r as X,i as N,a as L,u as ee,w as F,aZ as ge,aY as ve,L as S,o as l,b as T,z as b,g as h,f as v,D as I,x as _,y as k,S as y,R as u,t as z,E as Y,bv as fe,C as H,ax as te,l as he,aM as ye,_ as ne,aT as K,bw as Ce,W as j,A as Z}from"./index-Tfvjt7wd.js";import"./WdsCheckbox-BYGFbKQr.js";import"./marked.esm-273vDTCT.js";function ae(c,s){function o(r){if(!s.value)return!0;const t=c.getComponentDefinition(r.type);return!!(t!=null&&t.name.toLocaleLowerCase().includes(s.value)||Object.values(r.content).filter(f=>typeof f=="string"&&f.toLocaleLowerCase().includes(s.value)).length>0)}return{isComponentMatchingQuery:o}}function _e(c,s,o){const{isComponentMatchingQuery:r}=ae(c,s);return{searchResultCount:p(()=>{if(!s.value)return;let d=0;for(const f of c.getComponentsNested(o.value))r(f)&&d++;return d})}}function be(c,s,o){const{isComponentMatchingQuery:r}=ae(c,s),t=p(()=>!s.value||r(o.value));return{hasMatchingChildren:p(()=>{if(!s.value)return!0;for(const f of c.getComponentsNested(o.value.id))if(r(f))return!0;return!1}),matched:t}}const Ie={class:"BuilderSidebarComponentTreeBranch__nameRight"},Be={class:"previewText"},Te=J({__name:"BuilderSidebarComponentTreeBranch",props:{componentId:{type:String,required:!0},query:{type:String,required:!1,default:""}},emits:["expandBranch"],setup(c,{emit:s}){const o=c,r=X(),t=N(L.core),d=N(L.builderManager),f=p(()=>d.isComponentIdSelected(o.componentId)),C=ee(t),{createAndInsertComponent:R,moveComponent:P,goToComponentParentPage:O,isDraggingAllowed:q}=te(t,d,C),{getComponentInfoFromDrag:A,removeInsertionCandidacy:x,isParentSuitable:D}=ye(t),{isComponentVisible:V}=he(t),i=s,m=p(()=>{var e;return((e=o.query)==null?void 0:e.toLocaleLowerCase())??""}),n=p(()=>t.getComponentById(o.componentId)),{hasMatchingChildren:E,matched:oe}=be(t,m,n);F(E,e=>{var a;return(a=r.value)==null?void 0:a.toggleCollapse(!e)},{immediate:!0});const U=p(()=>t.getComponents(o.componentId,{sortedByPosition:!0}).filter(e=>{var a;return((a=t.getComponentDefinition(e.type))==null?void 0:a.category)!=="Internal"})),{name:re,previewText:W}=ge(t,n);async function se(e){O(o.componentId),await S(),d.handleSelectionFromEvent(e,o.componentId,void 0,"tree"),$()}function $(){r.value&&(r.value.expand(),i("expandBranch"))}function ie(){var M;const e=(M=r.value)==null?void 0:M.$el;if(!e)return;const a=e.closest(".BuilderSidebarComponentTree"),g=a.getBoundingClientRect(),B=r.value.$el.offsetTop-g.height/2,w=r.value.$el.offsetLeft-g.left-16;a.scrollTo({top:B,left:Math.max(0,w),behavior:"smooth"})}function le(e){d.setSelection(null),e.dataTransfer.setData(`application/json;writer=${n.value.type},${n.value.id}`,"{}")}function de(e){x(e)}function ue(e){const a=A(e);if(!a)return;const{draggedType:g,draggedId:B}=a;D(o.componentId,B,g)&&e.preventDefault()}function ce(e){const a=A(e);if(!a)return;const{draggedType:g,draggedId:B,sourceBlueprintId:w}=a;if(B)P(B,n.value.id);else{const M=w?{content:{sourceBlueprintId:w}}:void 0;R(g,n.value.id,void 0,M)}x(e)}const G=p(()=>{if(!t.activePageId.value)return!1;const e=t.getComponents(d.activeRootId.value).some(g=>g.id===t.activePageId.value);return ve.has(n.value.type)&&e&&o.componentId!==t.activePageId.value});return F(t.activePageId,()=>{var e;t.activePageId.value&&G.value&&((e=r.value)==null||e.toggleCollapse(!0))}),F(d.firstSelectedItem,async e=>{e&&e.componentId===o.componentId&&e.source!="tree"&&($(),await S(),ie())},{immediate:!0}),(e,a)=>n.value?(l(),T(pe,{key:0,ref_key:"treeBranch",ref:r,class:"BuilderSidebarComponentTreeBranch","component-id":c.componentId,name:u(re),query:c.query,"has-children":U.value.length>0,"data-automation-key":n.value.type,draggable:u(q)(c.componentId),matched:u(oe),selected:f.value,variant:u(fe).has(n.value.type)?"root":void 0,"disable-collapse":u(H).has(n.value.type),"no-nested-space":u(H).has(n.value.type),collapsed:G.value,onSelect:se,onDragover:ue,onDragstart:le,onDragend:de,onDrop:ce},{nameRight:b(()=>[h("span",Ie,[Object.keys(n.value.handlers??{}).length>0?(l(),v(I,{key:0},[a[0]||(a[0]=h("span",{class:"middot"},null,-1)),_(k,{name:"zap"})],64)):y("",!0),u(V)(n.value.id)?y("",!0):(l(),v(I,{key:1},[a[1]||(a[1]=h("span",{class:"middot"},null,-1)),_(k,{name:"eye-off"})],64)),n.value.isCodeManaged?(l(),v(I,{key:2},[a[2]||(a[2]=h("span",{class:"middot"},null,-1)),_(k,{name:"square-terminal"})],64)):y("",!0),u(W)?(l(),v(I,{key:3},[a[3]||(a[3]=h("span",{class:"middot"},null,-1)),h("span",Be,z(u(W)),1)],64)):y("",!0)])]),children:b(()=>[(l(!0),v(I,null,Y(U.value,g=>(l(),T(Q,{key:g.id,"component-id":g.id,query:c.query,onExpandBranch:$},null,8,["component-id","query"]))),128))]),_:1},8,["component-id","name","query","has-children","data-automation-key","draggable","matched","selected","variant","disable-collapse","no-nested-space","collapsed"])):y("",!0)}}),Q=ne(Te,[["__scopeId","data-v-a553e087"]]),ke={key:0},Se={key:1,class:"sections"},Pe={class:"section__header"},Ae={class:"section__title"},xe={class:"section__content"},De={key:0,class:"section__empty"},Ee={class:"add"},we=J({__name:"BuilderSidebarComponentTree",setup(c){const s=N(L.core),o=N(L.builderManager),r=X(""),t=ee(s),{createAndInsertComponent:d,setContentValue:f}=te(s,o,t),C=o.activeRootId,{searchResultCount:R}=_e(s,r,C),P=p(()=>s.getComponents("blueprints_root",{sortedByPosition:!0})),O=p(()=>P.value.filter(i=>!K(i))),q=p(()=>P.value.filter(i=>K(i))),A=p(()=>{var m;const i=[{key:"blueprints",title:"Blueprints",items:O.value,addAction:"add-blueprint",onAdd:D,emptyText:"No blueprints yet"}];return(m=s.featureFlags.value)!=null&&m.includes("shared_blueprints")&&i.push({key:"shared-blueprints",title:"Shared Blueprints",items:q.value,addAction:"add-shared-blueprint",onAdd:V,emptyText:"No shared blueprints yet"}),i});async function x(){const i=d("page","root");s.setActivePageId(i),await S(),o.setSelection(i),t.track("ui_page_added")}async function D(){const i=d("blueprints_blueprint","blueprints_root");s.setActivePageId(i),await S(),o.setSelection(i),t.track("blueprints_new_added")}async function V(){const i=d("blueprints_blueprint","blueprints_root");f(i,"isSharedBlueprint",Ce),s.setActivePageId(i),await S(),o.setSelection(i),t.track("blueprints_shared_added")}return(i,m)=>(l(),T(me,{modelValue:r.value,"onUpdate:modelValue":m[0]||(m[0]=n=>r.value=n),class:"BuilderSidebarComponentTree",placeholder:"Component tree","search-count":u(R)},{footer:b(()=>[h("div",Ee,[u(C)=="root"?(l(),T(j,{key:0,variant:"special",size:"small","data-automation-action":"add-page",onClick:x},{default:b(()=>[_(k,{name:"plus"}),m[1]||(m[1]=Z(" Add page "))]),_:1})):y("",!0),u(C)=="blueprints_root"?(l(),T(j,{key:1,variant:"special",size:"small","data-automation-action":"add-blueprint-footer",onClick:D},{default:b(()=>[_(k,{name:"plus"}),m[2]||(m[2]=Z(" Add blueprint "))]),_:1})):y("",!0)])]),default:b(()=>[u(C)=="root"?(l(),v("div",ke,[_(Q,{class:"rootBranch","component-id":u(C),query:r.value},null,8,["component-id","query"])])):u(C)=="blueprints_root"?(l(),v("div",Se,[(l(!0),v(I,null,Y(A.value,n=>(l(),v("div",{key:n.key,class:"section"},[h("div",Pe,[h("span",Ae,z(n.title),1),_(j,{variant:"neutral",size:"smallIcon","data-automation-action":n.addAction,onClick:n.onAdd},{default:b(()=>[_(k,{name:"plus"})]),_:2},1032,["data-automation-action","onClick"])]),h("div",xe,[(l(!0),v(I,null,Y(n.items,E=>(l(),T(Q,{key:E.id,"component-id":E.id,query:r.value},null,8,["component-id","query"]))),128)),n.items.length===0?(l(),v("div",De,z(n.emptyText),1)):y("",!0)])]))),128))])):y("",!0)]),_:1},8,["modelValue","search-count"]))}}),Oe=ne(we,[["__scopeId","data-v-45d321fc"]]);export{Oe as default};
@@ -0,0 +1 @@
1
+ @layer wf{.BuilderSidebarComponentTreeBranch[data-v-a553e087]{min-width:170px}.BuilderSidebarComponentTreeBranch__nameRight[data-v-a553e087]{display:flex;align-items:center;gap:4px;flex-wrap:nowrap;text-wrap:nowrap;text-overflow:ellipsis;min-width:0}.previewText[data-v-a553e087]{flex-wrap:nowrap;text-wrap:nowrap;flex-grow:1;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.middot[data-v-a553e087]{display:inline-block;border-radius:3px;width:3px;min-width:3px;height:3px;background:var(--builderSecondaryTextColor);opacity:.5}}@layer wf{.BuilderSidebarComponentTree[data-v-45d321fc]{height:100%;position:relative}.category .header[data-v-45d321fc]{font-size:12px;font-weight:500;line-height:12px;letter-spacing:1.3px;text-transform:uppercase;color:var(--builderSecondaryTextColor);margin-bottom:16px}.rootBranch[data-v-45d321fc]{flex:1 0 auto}.tools[data-v-45d321fc]{display:grid;grid-template-columns:24px 1fr;grid-template-rows:auto;padding:0 8px;row-gap:12px;column-gap:4px}.add[data-v-45d321fc]{flex:0 0 var(--builderPanelSwitcherHeight);bottom:0;height:var(--builderPanelSwitcherHeight);display:flex;align-items:center;justify-content:center;border-top:1px solid var(--builderSeparatorColor);background:var(--builderBackgroundColor)}.sections[data-v-45d321fc]{display:flex;flex-direction:column;gap:16px}.section[data-v-45d321fc]{display:flex;flex-direction:column}.section__header[data-v-45d321fc]{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-bottom:1px solid var(--builderSeparatorColor)}.section__title[data-v-45d321fc]{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--builderSecondaryTextColor)}.section__content[data-v-45d321fc]{padding:8px 0}.section__empty[data-v-45d321fc]{padding:8px 16px;font-size:12px;color:var(--builderSecondaryTextColor);font-style:italic}}
@@ -0,0 +1 @@
1
+ @layer wf{.sharedBlueprintNotice[data-v-f4d50b43]{display:flex;align-items:flex-start;gap:8px;padding:12px;margin-bottom:12px;background:var(--builderSubtleBackgroundColor, #f8fafc);border-radius:6px;font-size:12px;line-height:1.4;color:var(--builderSecondaryTextColor)}.sharedBlueprintNotice[data-v-f4d50b43] svg{flex-shrink:0;margin-top:1px}.category .header[data-v-f4d50b43]{display:flex;align-items:center;justify-content:space-between;font-size:12px;font-weight:500;line-height:12px;letter-spacing:1.3px;text-transform:uppercase;color:var(--builderSecondaryTextColor);margin-bottom:8px}.header__library-btn[data-v-f4d50b43]{display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--builderSecondaryTextColor);border-radius:4px;opacity:.7;transition:opacity .2s,background .2s}.header__library-btn[data-v-f4d50b43]:hover{opacity:1;background:var(--builderSubtleSeparatorColor)}.header__library-btn[data-v-f4d50b43] svg{width:14px;height:14px}.tools[data-v-f4d50b43]{display:grid;grid-template-columns:1fr;grid-template-rows:auto}.tool[data-v-f4d50b43]{display:grid;grid-template-columns:18px 1fr auto;grid-template-rows:1fr;column-gap:8px;padding:8px;border-radius:4px;cursor:grab;position:relative}.tool--shared[data-v-f4d50b43]{grid-template-columns:18px 1fr auto}.tool img[data-v-f4d50b43]{max-width:18px;max-height:18px;aspect-ratio:1 / 1}.tool[data-v-f4d50b43]:hover{background:var(--builderSubtleSeparatorColor)}.tool__delete[data-v-f4d50b43]{display:none;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--builderSecondaryTextColor);border-radius:4px;opacity:.6;transition:opacity .2s,background .2s}.tool--shared:hover .tool__delete[data-v-f4d50b43]{display:flex}.tool__delete[data-v-f4d50b43]:hover{opacity:1;background:var(--builderSubtleSeparatorColor);color:var(--builderErrorColor)}.tool__delete[data-v-f4d50b43]:active{opacity:.8}.BuilderSidebarPanel__footer__actions[data-v-f4d50b43]{flex:0 0 var(--builderPanelSwitcherHeight);bottom:0;height:var(--builderPanelSwitcherHeight);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-top:1px solid var(--builderSeparatorColor);background:var(--builderBackgroundColor);padding:8px}.BuilderSidebarPanel__footer__btn[data-v-f4d50b43]{font-size:12px;font-weight:500;line-height:180%;min-width:190px}}
@@ -0,0 +1,7 @@
1
+ function __vite__mapDeps(indexes) {
2
+ if (!__vite__mapDeps.viteFileDeps) {
3
+ __vite__mapDeps.viteFileDeps = ["./BuilderBlueprintLibraryPanel-BB2BzDiO.js","./index-Tfvjt7wd.js","./index-BKNuk68o.css","./BuilderApp-CVdXjiyA.js","./WdsCheckbox-BYGFbKQr.js","./WdsCheckbox-DKvpPA4D.css","./marked.esm-273vDTCT.js","./BuilderApp-WimUfNZr.css","./BuilderBlueprintLibraryPanel-qrkMQJpE.css"]
4
+ }
5
+ return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
6
+ }
7
+ import{d as oe,ao as se,Q as ie,V as le,i as w,r as C,a as L,u as ue,c as d,aT as F,bt as de,bu as R,w as ce,o as u,f as c,x as p,au as pe,R as T,z as A,g as v,W as me,y,A as fe,S as B,D,E as q,t as W,G as ve,bn as ge,aq as he,b as _e,bo as j,ax as be,aM as ye,_ as Be}from"./index-Tfvjt7wd.js";import{B as Se}from"./BuilderApp-CVdXjiyA.js";import"./WdsCheckbox-BYGFbKQr.js";import"./marked.esm-273vDTCT.js";const ke={key:0,class:"sharedBlueprintNotice"},we={class:"header"},Ce={class:"tools"},Le=["data-writer-tooltip","data-component-type","onDragstart"],Te={class:"name"},Ae=["data-writer-tooltip","onClick"],De={class:"BuilderSidebarPanel__footer__actions"},Ee=oe({__name:"BuilderSidebarToolkit",setup(Ie){const M=se({loader:()=>ie(()=>import("./BuilderBlueprintLibraryPanel-BB2BzDiO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url)}),{pushToast:E}=le(),N=w(L.isAutogenModalShown,C(!1));function O(){N.value=!0}const S=C(!1);function U(){S.value=!0}const s=w(L.core),h=w(L.builderManager),z=ue(s),{removeComponentsSubtree:K}=be(s,h,z),{removeInsertionCandidacy:G}=ye(s),m=C(""),g=d(()=>Array.isArray(s.featureFlags.value)&&s.featureFlags.value.includes("shared_blueprints")),I=d(()=>Array.isArray(s.featureFlags.value)&&s.featureFlags.value.includes("blueprint_library")),_=h.activeRootId,H=d(()=>g.value?s.getComponents("blueprints_root",{sortedByPosition:!0}).filter(e=>F(e)):[]),Q=new Set(["blueprints_runblueprint","blueprints_apitrigger","blueprints_uieventtrigger","blueprints_crontrigger"]),b=d(()=>{if(_.value!=="blueprints_root")return!1;const t=s.activePageId.value;if(!t)return!1;const e=s.getComponentById(t);return F(e)}),J=["Layout","Content","Input","Embed","Writer","Logic","Triggers","Other","Shared Blueprints"],f=d(()=>h.mode.value=="blueprints"?"blueprints":"core"),$=d(()=>{const t=J.map(e=>[e,Z(e)]).filter(([e,a])=>a.length>0||e==="Shared Blueprints"&&_.value=="blueprints_root"&&g.value&&!b.value);return Object.fromEntries(t)}),X=d(()=>{if(m.value)return Object.values($.value).reduce((t,e)=>t+e.length,0)}),Y=d(()=>f.value=="core"?"Interface toolkit":f.value=="blueprints"?"Blueprints toolkit":"Toolkit");function Z(t){if(t==="Shared Blueprints"){if(!g.value||b.value)return[];const r=H.value.map(l=>{var V,x;const k=((V=l.content)==null?void 0:V.key)||"Untitled Blueprint",ne=((x=l.content)==null?void 0:x.description)||"A shared blueprint";return{type:`blueprints_shared:${l.id}`,name:k,description:ne,category:"Shared Blueprints",sourceBlueprintId:l.id}}),o=m.value.toLocaleLowerCase();return r.filter(l=>!o||l.name.toLocaleLowerCase().includes(o)).sort((l,k)=>l.name.localeCompare(k.name,void 0,{sensitivity:"base"}))}const a=de().filter(r=>{const o=R(r);return!(r.startsWith("shared_")||o.category!=t||!o.toolkit&&f.value!=="core"||o.toolkit&&o.toolkit!==f.value||o.deprecated||b.value&&Q.has(r))}).map(r=>{const{name:o,description:P,category:l}=R(r);return{type:r,name:o,description:P,category:l??"Other"}}),i=m.value.toLocaleLowerCase();return a.filter(r=>!i||r.name.toLocaleLowerCase().includes(i)).sort((r,o)=>r.name.localeCompare(o.name,void 0,{sensitivity:"base"}))}function ee(t,e,a){h.setSelection(null);const i=a?`application/json;writer=blueprints_shared,${a}`:`application/json;writer=${e},`;t.dataTransfer.setData(i,"{}")}function te(t){G(t)}function re(t){return t.sourceBlueprintId?["/components/blueprints_category_Logic.svg"].map(e=>j(e)):[`/components/${t.type}.svg`,`/components/${f.value=="blueprints"?"blueprints_":""}category_${t.category}.svg`].map(e=>j(e))}function ae(t,e){if(confirm(`Are you sure you want to delete the shared blueprint "${e}"?`))try{K(t),E({type:"success",message:`Shared blueprint '${e}' deleted.`})}catch(a){E({type:"error",message:`Failed to delete shared blueprint: ${a instanceof Error?a.message:String(a)}`})}}return ce(f,()=>{m.value=""}),(t,e)=>(u(),c(D,null,[p(Se,{modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=a=>m.value=a),class:"BuilderSidebarToolkit",placeholder:Y.value,"search-count":X.value},pe({default:A(()=>[b.value?(u(),c("div",ke,[p(y,{name:"info"}),e[3]||(e[3]=v("span",null,"Some blocks are hidden because they can't be used in shared blueprints.",-1))])):B("",!0),(u(!0),c(D,null,q($.value,(a,i)=>(u(),c("div",{key:i,class:"category"},[v("div",we,[v("span",null,W(i),1),i==="Shared Blueprints"&&T(_)=="blueprints_root"&&I.value?(u(),c("button",{key:0,class:"header__library-btn","data-writer-tooltip":"Blueprint Library","data-writer-tooltip-placement":"right",onClick:U},[p(y,{name:"layout-grid"})])):B("",!0)]),v("div",Ce,[(u(!0),c(D,null,q(a,n=>(u(),c("div",{key:n.type,class:ve(["tool",{"tool--shared":i==="Shared Blueprints"&&g.value}]),"data-writer-tooltip":n.description,"data-writer-tooltip-placement":"right","data-writer-tooltip-gap":"8",draggable:"true","data-component-type":n.type,onDragend:e[0]||(e[0]=r=>te(r)),onDragstart:r=>ee(r,n.type,n.sourceBlueprintId)},[p(ge,{alt:`(Icon for ${n.name})`,draggable:"false",urls:re(n),"loader-max-width-px":18,"loader-max-height-px":18},null,8,["alt","urls"]),v("div",Te,W(n.name),1),i==="Shared Blueprints"&&g.value&&n.sourceBlueprintId?(u(),c("button",{key:0,class:"tool__delete","data-writer-tooltip":`Delete ${n.name}`,"data-writer-tooltip-placement":"right",onClick:he(r=>ae(n.sourceBlueprintId,n.name),["stop"])},[p(y,{name:"trash"})],8,Ae)):B("",!0)],42,Le))),128))])]))),128))]),_:2},[T(_)=="blueprints_root"?{name:"footer",fn:A(()=>[v("div",De,[p(me,{variant:"special",size:"small",class:"BuilderSidebarPanel__footer__btn",onClick:O},{default:A(()=>[p(y,{name:"wand-sparkles"}),e[4]||(e[4]=fe(" Autogenerate "))]),_:1})])]),key:"0"}:void 0]),1032,["modelValue","placeholder","search-count"]),I.value?(u(),_e(T(M),{key:0,modelValue:S.value,"onUpdate:modelValue":e[2]||(e[2]=a=>S.value=a)},null,8,["modelValue"])):B("",!0)],64))}}),Fe=Be(Ee,[["__scopeId","data-v-f4d50b43"]]);export{Fe as default};
@@ -1,4 +1,4 @@
1
- import{d as $i,r as _o,bs as Uo,av as Go,L as Yo,R as Fn,b0 as Wi,k as Xo,Y as Zo,q as Qo,bt as el,bu as tl,an as nl,i as vr,a as Or,ap as rl,c as il,at as Nt,aV as lt,w as sl,o as ol,b as ll,b2 as al,_ as cl}from"./index-Bz7k91zI.js";import{u as fl}from"./BuilderSettings-oKMwMRAY.js";import"./useComponentDescription-CI_QLr37.js";import"./WdsDropdownMenu-1kTugbx4.js";import"./WdsCheckbox-DyaMkyjM.js";import"./WdsTabs-cGyj5MvP.js";import"./useKeyValueEditor-DctSXoZx.js";function q(r){this.content=r}q.prototype={constructor:q,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),s=n.content.slice();return i==-1?s.push(t||r,e):(s[i+1]=e,t&&(s[i]=t)),new q(s)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new q(t)},addToStart:function(r,e){return new q([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new q(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),s=n.find(r);return i.splice(s==-1?i.length:s,0,e,t),new q(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=q.from(r),r.size?new q(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=q.from(r),r.size?new q(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=q.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};q.from=function(r){if(r instanceof q)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new q(e)};function ji(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=ji(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Ji(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,n-=a;continue}if(!o.sameMarkup(l))return{a:t,b:n};if(o.isText&&o.text!=l.text){let c=0,f=Math.min(o.text.length,l.text.length);for(;c<f&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,n--;return{a:t,b:n}}if(o.content.size||l.content.size){let c=Ji(o.content,l.content,t-1,n-1);if(c)return c}t-=a,n-=a}}class b{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,s){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&n(a,i+l,s||null,o)!==!1&&a.content.size){let f=l+1;a.nodesBetween(Math.max(0,e-f),Math.min(a.content.size,t-f),n,i+f)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&n&&(o?o=!1:s+=n),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new b(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),i+=l.nodeSize),o=a}return new b(n,i)}cutByIndex(e,t){return e==t?b.empty:e==0&&t==this.content.length?this:new b(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new b(i,s)}addToStart(e){return new b([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new b(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return ji(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ji(this,e,t,n)}findIndex(e){if(e==0)return Dt(0,e);if(e==this.size)return Dt(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),s=n+i.nodeSize;if(s>=e)return s==e?Dt(t+1,s):Dt(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return b.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new b(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return b.empty;let t,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new b(t||e,n)}static from(e){if(!e)return b.empty;if(e instanceof b)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new b([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}b.empty=new b([],0);const yn={index:0,offset:0};function Dt(r,e){return yn.index=r,yn.offset=e,yn}function jt(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!jt(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!jt(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let D=class Vn{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&jt(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Vn.none;if(e instanceof Vn)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};D.none=[];class Jt extends Error{}class k{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Hi(this.content,e+this.openStart,t);return n&&new k(n,this.openStart,this.openEnd)}removeBetween(e,t){return new k(qi(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return k.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new k(b.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new k(e,n,i)}}k.empty=new k(b.empty,0,0);function qi(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:l}=r.findIndex(t);if(i==e||s.isText){if(l!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(qi(s.content,e-i-1,t-i-1)))}function Hi(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let l=Hi(o.content,e-s-1,t);return l&&r.replaceChild(i,o.copy(l))}function ul(r,e,t){if(t.openStart>r.depth)throw new Jt("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new Jt("Inconsistent open depths");return Ki(r,e,t,0)}function Ki(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=Ki(r,e,t,n+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,l=o.content;return Fe(o,l.cut(0,r.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=dl(t,r);return Fe(s,Ui(r,o,l,e,n))}else return Fe(s,qt(r,e,n))}function _i(r,e){if(!e.type.compatibleContent(r.type))throw new Jt("Cannot join "+e.type.name+" onto "+r.type.name)}function Ln(r,e,t){let n=r.node(t);return _i(n,e.node(t)),n}function ze(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function dt(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(ze(r.nodeAfter,n),s++));for(let l=s;l<o;l++)ze(i.child(l),n);e&&e.depth==t&&e.textOffset&&ze(e.nodeBefore,n)}function Fe(r,e){return r.type.checkContent(e),r.copy(e)}function Ui(r,e,t,n,i){let s=r.depth>i&&Ln(r,e,i+1),o=n.depth>i&&Ln(t,n,i+1),l=[];return dt(null,r,i,l),s&&o&&e.index(i)==t.index(i)?(_i(s,o),ze(Fe(s,Ui(r,e,t,n,i+1)),l)):(s&&ze(Fe(s,qt(r,e,i+1)),l),dt(e,t,i,l),o&&ze(Fe(o,qt(t,n,i+1)),l)),dt(n,null,i,l),new b(l)}function qt(r,e,t){let n=[];if(dt(null,r,t,n),r.depth>t){let i=Ln(r,e,t+1);ze(Fe(i,qt(r,e,t+1)),n)}return dt(e,null,t,n),new b(n)}function dl(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(b.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class gt{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return D.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let l=n;n=i,i=l}let s=n.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ht(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(n.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new gt(t,n,s)}static resolveCached(e,t){let n=Nr.get(e);if(n)for(let s=0;s<n.elts.length;s++){let o=n.elts[s];if(o.pos==t)return o}else Nr.set(e,n=new hl);let i=n.elts[n.i]=gt.resolve(e,t);return n.i=(n.i+1)%pl,i}}class hl{constructor(){this.elts=[],this.i=0}}const pl=12,Nr=new WeakMap;class Ht{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ml=Object.create(null);class ce{constructor(e,t,n,i=D.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||b.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&jt(this.attrs,t||e.defaultAttrs||ml)&&D.sameSet(this.marks,n||D.none)}copy(e=null){return e==this.content?this:new ce(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ce(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return k.empty;let i=this.resolve(e),s=this.resolve(t),o=n?0:i.sharedDepth(t),l=i.start(o),c=i.node(o).content.cut(i.pos-l,s.pos-l);return new k(c,i.depth-o,s.depth-o)}replace(e,t,n){return ul(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return gt.resolveCached(this,e)}resolveNoCache(e){return gt.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Gi(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=b.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=D.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!D.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=b.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,n);return s.type.checkAttrs(s.attrs),s}}ce.prototype.text=void 0;class Kt extends ce{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Gi(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Kt(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Kt(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Gi(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class We{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new gl(e,t);if(n.next==null)return We.empty;let i=Yi(n);n.next&&n.err("Unexpected trailing text");let s=Cl(wl(i));return Ml(s,n),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let s=t;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function s(o,l){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return b.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:f,next:u}=o.next[c];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let d=s(u,l.concat(f));if(d)return d}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!i.type||a.validEnd)&&(n.push({match:l.contentMatch,type:l,via:i}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)s+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return s}).join(`
1
+ import{d as $i,r as _o,by as Uo,av as Go,L as Yo,R as Fn,b3 as Wi,k as Xo,Y as Zo,q as Qo,bz as el,bA as tl,an as nl,i as vr,a as Or,ap as rl,c as il,at as Nt,aX as lt,w as sl,o as ol,b as ll,b5 as al,_ as cl}from"./index-Tfvjt7wd.js";import{u as fl}from"./BuilderSettings-7A3iq6cl.js";import"./WdsDropdownMenu-C1nXnj7Y.js";import"./WdsCheckbox-BYGFbKQr.js";import"./WdsTabs-D3_pIGba.js";import"./WdsFieldWrapper-DUvtHQhU.js";import"./useKeyValueEditor-D9cp0yxU.js";function q(r){this.content=r}q.prototype={constructor:q,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),s=n.content.slice();return i==-1?s.push(t||r,e):(s[i+1]=e,t&&(s[i]=t)),new q(s)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new q(t)},addToStart:function(r,e){return new q([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new q(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),s=n.find(r);return i.splice(s==-1?i.length:s,0,e,t),new q(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=q.from(r),r.size?new q(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=q.from(r),r.size?new q(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=q.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};q.from=function(r){if(r instanceof q)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new q(e)};function ji(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=ji(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Ji(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,n-=a;continue}if(!o.sameMarkup(l))return{a:t,b:n};if(o.isText&&o.text!=l.text){let c=0,f=Math.min(o.text.length,l.text.length);for(;c<f&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,n--;return{a:t,b:n}}if(o.content.size||l.content.size){let c=Ji(o.content,l.content,t-1,n-1);if(c)return c}t-=a,n-=a}}class b{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,s){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&n(a,i+l,s||null,o)!==!1&&a.content.size){let f=l+1;a.nodesBetween(Math.max(0,e-f),Math.min(a.content.size,t-f),n,i+f)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&n&&(o?o=!1:s+=n),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new b(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),i+=l.nodeSize),o=a}return new b(n,i)}cutByIndex(e,t){return e==t?b.empty:e==0&&t==this.content.length?this:new b(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new b(i,s)}addToStart(e){return new b([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new b(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return ji(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ji(this,e,t,n)}findIndex(e){if(e==0)return Dt(0,e);if(e==this.size)return Dt(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),s=n+i.nodeSize;if(s>=e)return s==e?Dt(t+1,s):Dt(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return b.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new b(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return b.empty;let t,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new b(t||e,n)}static from(e){if(!e)return b.empty;if(e instanceof b)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new b([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}b.empty=new b([],0);const yn={index:0,offset:0};function Dt(r,e){return yn.index=r,yn.offset=e,yn}function jt(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!jt(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!jt(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let D=class Vn{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&jt(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Vn.none;if(e instanceof Vn)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};D.none=[];class Jt extends Error{}class k{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Hi(this.content,e+this.openStart,t);return n&&new k(n,this.openStart,this.openEnd)}removeBetween(e,t){return new k(qi(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return k.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new k(b.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new k(e,n,i)}}k.empty=new k(b.empty,0,0);function qi(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:l}=r.findIndex(t);if(i==e||s.isText){if(l!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(qi(s.content,e-i-1,t-i-1)))}function Hi(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let l=Hi(o.content,e-s-1,t);return l&&r.replaceChild(i,o.copy(l))}function ul(r,e,t){if(t.openStart>r.depth)throw new Jt("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new Jt("Inconsistent open depths");return Ki(r,e,t,0)}function Ki(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=Ki(r,e,t,n+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,l=o.content;return Fe(o,l.cut(0,r.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=dl(t,r);return Fe(s,Ui(r,o,l,e,n))}else return Fe(s,qt(r,e,n))}function _i(r,e){if(!e.type.compatibleContent(r.type))throw new Jt("Cannot join "+e.type.name+" onto "+r.type.name)}function Ln(r,e,t){let n=r.node(t);return _i(n,e.node(t)),n}function ze(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function dt(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(ze(r.nodeAfter,n),s++));for(let l=s;l<o;l++)ze(i.child(l),n);e&&e.depth==t&&e.textOffset&&ze(e.nodeBefore,n)}function Fe(r,e){return r.type.checkContent(e),r.copy(e)}function Ui(r,e,t,n,i){let s=r.depth>i&&Ln(r,e,i+1),o=n.depth>i&&Ln(t,n,i+1),l=[];return dt(null,r,i,l),s&&o&&e.index(i)==t.index(i)?(_i(s,o),ze(Fe(s,Ui(r,e,t,n,i+1)),l)):(s&&ze(Fe(s,qt(r,e,i+1)),l),dt(e,t,i,l),o&&ze(Fe(o,qt(t,n,i+1)),l)),dt(n,null,i,l),new b(l)}function qt(r,e,t){let n=[];if(dt(null,r,t,n),r.depth>t){let i=Ln(r,e,t+1);ze(Fe(i,qt(r,e,t+1)),n)}return dt(e,null,t,n),new b(n)}function dl(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(b.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class gt{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return D.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let l=n;n=i,i=l}let s=n.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ht(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(n.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new gt(t,n,s)}static resolveCached(e,t){let n=Nr.get(e);if(n)for(let s=0;s<n.elts.length;s++){let o=n.elts[s];if(o.pos==t)return o}else Nr.set(e,n=new hl);let i=n.elts[n.i]=gt.resolve(e,t);return n.i=(n.i+1)%pl,i}}class hl{constructor(){this.elts=[],this.i=0}}const pl=12,Nr=new WeakMap;class Ht{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ml=Object.create(null);class ce{constructor(e,t,n,i=D.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||b.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&jt(this.attrs,t||e.defaultAttrs||ml)&&D.sameSet(this.marks,n||D.none)}copy(e=null){return e==this.content?this:new ce(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ce(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return k.empty;let i=this.resolve(e),s=this.resolve(t),o=n?0:i.sharedDepth(t),l=i.start(o),c=i.node(o).content.cut(i.pos-l,s.pos-l);return new k(c,i.depth-o,s.depth-o)}replace(e,t,n){return ul(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return gt.resolveCached(this,e)}resolveNoCache(e){return gt.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Gi(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=b.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=D.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!D.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=b.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,n);return s.type.checkAttrs(s.attrs),s}}ce.prototype.text=void 0;class Kt extends ce{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Gi(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Kt(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Kt(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Gi(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class We{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new gl(e,t);if(n.next==null)return We.empty;let i=Yi(n);n.next&&n.err("Unexpected trailing text");let s=Cl(wl(i));return Ml(s,n),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let s=t;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function s(o,l){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return b.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:f,next:u}=o.next[c];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let d=s(u,l.concat(f));if(d)return d}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!i.type||a.validEnd)&&(n.push({match:l.contentMatch,type:l,via:i}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)s+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return s}).join(`
2
2
  `)}}We.empty=new We(!0);class gl{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Yi(r){let e=[];do e.push(yl(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function yl(r){let e=[];do e.push(bl(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function bl(r){let e=Sl(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=kl(r,e);else break;return e}function Dr(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function kl(r,e){let t=Dr(r),n=t;return r.eat(",")&&(r.next!="}"?n=Dr(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function xl(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function Sl(r){if(r.eat("(")){let e=Yi(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=xl(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function wl(r){let e=[[]];return i(s(r,0),t()),e;function t(){return e.push([])-1}function n(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;i(c,l=t())}else if(o.type=="star"){let a=t();return n(l,a),i(s(o.expr,a),a),[n(a)]}else if(o.type=="plus"){let a=t();return i(s(o.expr,l),a),i(s(o.expr,a),a),[n(a)]}else{if(o.type=="opt")return[n(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let f=t();i(s(o.expr,a),f),a=f}if(o.max==-1)i(s(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let f=t();n(a,f),i(s(o.expr,a),f),a=f}return[n(a)]}else{if(o.type=="name")return[n(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Xi(r,e){return e-r}function Ar(r,e){let t=[];return n(e),t.sort(Xi);function n(i){let s=r[i];if(s.length==1&&!s[0].term)return n(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:l,to:a}=s[o];!l&&t.indexOf(a)==-1&&n(a)}}}function Cl(r){let e=Object.create(null);return t(Ar(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let f=0;f<i.length;f++)i[f][0]==l&&(c=i[f][1]);Ar(r,a).forEach(f=>{c||i.push([l,c=[]]),c.indexOf(f)==-1&&c.push(f)})})});let s=e[n.join(",")]=new We(n.indexOf(r.length-1)>-1);for(let o=0;o<i.length;o++){let l=i[o][1].sort(Xi);s.next.push({type:i[o][0],next:e[l.join(",")]||t(l)})}return s}}function Ml(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],s=!i.validEnd,o=[];for(let l=0;l<i.next.length;l++){let{type:a,next:c}=i.next[l];o.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),n.indexOf(c)==-1&&n.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Zi(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function Qi(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let s=r[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function es(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in r){let s=r[i];s.validate&&s.validate(e[i])}}function ts(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new El(r,n,e[n]);return t}let Ir=class ns{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=ts(e,n.attrs),this.defaultAttrs=Zi(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==We.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Qi(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ce(this,this.computeAttrs(e),b.from(t),D.setFrom(n))}createChecked(e=null,t,n){return t=b.from(t),this.checkContent(t),new ce(this,this.computeAttrs(e),t,D.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=b.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(b.empty,!0);return s?new ce(this,e,t.append(s),D.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){es(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:D.none:e}static compile(e,t){let n=Object.create(null);e.forEach((s,o)=>n[s]=new ns(s,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function Tl(r,e,t){let n=t.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${s}`)}}class El{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?Tl(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class nn{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=ts(e,i.attrs),this.excluded=null;let s=Zi(this.attrs);this.instance=s?new D(this,s):null}create(e=null){return!e&&this.instance?this.instance:new D(this,Qi(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new nn(s,i++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){es(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class rs{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=q.from(e.nodes),t.marks=q.from(e.marks||{}),this.nodes=Ir.compile(this.spec.nodes,this),this.marks=nn.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=n[o]||(n[o]=We.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?Rr(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Rr(this,o.split(" "))}this.nodeFromJSON=i=>ce.fromJSON(this,i),this.markFromJSON=i=>D.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ir){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new Kt(n,n.defaultAttrs,e,D.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Rr(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],s=r.marks[i],o=s;if(s)t.push(s);else for(let l in r.marks){let a=r.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function vl(r){return r.tag!=null}function Ol(r){return r.style!=null}class Ee{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(vl(i))this.tags.push(i);else if(Ol(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let n=new Br(this,t,!1);return n.addAll(e,D.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Br(this,t,!0);return n.addAll(e,D.none,t.from,t.to),k.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Al(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,n,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{n(o=zr(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=zr(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ee(e,Ee.schemaRules(e)))}}const is={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Nl={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ss={ol:!0,ul:!0},yt=1,$n=2,ht=4;function Pr(r,e,t){return e!=null?(e?yt:0)|(e==="full"?$n:0):r&&r.whitespace=="pre"?yt|$n:t&~ht}class At{constructor(e,t,n,i,s,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=D.none,this.match=s||(o&ht?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(b.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&yt)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=b.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(b.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!is.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Br{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=Pr(null,t.preserveWhitespace,0)|(n?ht:0);i?s=new At(i.type,i.attrs,D.none,!0,t.topMatch||i.type.contentMatch,o):n?s=new At(null,null,D.none,!0,null,o):s=new At(e.schema.topNodeType,null,D.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,s=i.options&$n?"full":this.localPreserveWS||(i.options&yt)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)s!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
3
3
  `);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],l=e.previousSibling;(!o||l&&l.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;ss.hasOwnProperty(o)&&this.parser.normalizeLists&&Dl(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,n));e:if(a?a.ignore:Nl.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,f=this.needsBlock;if(is.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let u=a&&a.skip?t:this.readStyles(e,t);u&&this.addAll(e,u),c&&this.sync(s),this.needsBlock=f}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=n.getPropertyValue(s);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(s,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,n,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let a=this.enter(o,t.attrs||null,n,t.preserveWhitespace);a&&(s=!0,n=a)}else{let a=this.parser.schema.marks[t.mark];n=n.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,n,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,n),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,t,n,i){let s=n||0;for(let o=n?e.childNodes[n]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,n){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,s=a,!c.length))break;if(a.solid){if(n)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=D.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):Fr(l.type,e.type))&&(o=l.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let s=this.findPlace(e.create(t),n,!1);return s&&(s=this.enterInner(e,t,n,!0,i)),s}enterInner(e,t,n,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Pr(e,s,o.options);o.options&ht&&o.content.length==0&&(l|=ht);let a=D.none;return n=n.filter(c=>(o.type?o.type.allowsMarkType(c.type):Fr(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new At(e,t,a,i,null,l)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=yt)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let f=a>0||a==0&&i?this.nodes[a].type:n&&a>=s?n.node(a-s).type:null;if(!f||f.name!=c&&!f.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function Dl(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&ss.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function Al(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function zr(r){let e={};for(let t in r)e[t]=r[t];return e}function Fr(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:f}=l.edge(a);if(c==e||s.indexOf(f)<0&&o(f))return!0}};if(o(i.contentMatch))return!0}}class He{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=bn(t).createDocumentFragment());let i=n,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let l=0,a=0;for(;l<s.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)i=s.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],f=this.serializeMark(c,o.isInline,t);f&&(s.push([c,i]),i.appendChild(f.dom),i=f.contentDOM||f.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=Vt(bn(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Vt(bn(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return Vt(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new He(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Vr(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return Vr(e.marks)}}function Vr(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function bn(r){return r.document||window.document}const Lr=new WeakMap;function Il(r){let e=Lr.get(r);return e===void 0&&Lr.set(r,e=Rl(r)),e}function Rl(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function Vt(r,e,t,n){if(typeof e=="string")return{dom:r.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=Il(n))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let l,a=t?r.createElementNS(t,i):r.createElement(i),c=e[1],f=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){f=2;for(let u in c)if(c[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),c[u]):u=="style"&&a.style?a.style.cssText=c[u]:a.setAttribute(u,c[u])}}for(let u=f;u<e.length;u++){let d=e[u];if(d===0){if(u<e.length-1||u>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Vt(r,d,t,n);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const ls=65535,as=Math.pow(2,16);function Pl(r,e){return r+e*as}function $r(r){return r&ls}function Bl(r){return(r-(r&ls))/as}const cs=1,fs=2,Lt=4,us=8;class Wn{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&us)>0}get deletedBefore(){return(this.delInfo&(cs|Lt))>0}get deletedAfter(){return(this.delInfo&(fs|Lt))>0}get deletedAcross(){return(this.delInfo&Lt)>0}}class ne{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ne.empty)return ne.empty}recover(e){let t=0,n=$r(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+Bl(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let c=this.ranges[l+s],f=this.ranges[l+o],u=a+c;if(e<=u){let d=c?e==a?-1:e==u?1:t:t,h=a+i+(d<0?0:f);if(n)return h;let p=e==(t<0?a:u)?null:Pl(l/3,e-a),m=e==a?fs:e==u?cs:Lt;return(t<0?e!=a:e!=u)&&(m|=us),new Wn(h,m,p)}i+=f-c}return n?e+i:new Wn(e+i,0,null)}touches(e,t){let n=0,i=$r(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?n:0);if(a>e)break;let c=this.ranges[l+s],f=a+c;if(e<=f&&l==i*3)return!0;n+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),a=o+(this.inverted?0:s),c=this.ranges[i+t],f=this.ranges[i+n];e(l,l+c,a,a+f),s+=f-c}}invert(){return new ne(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ne.empty:new ne(e<0?[0,-e,0]:[0,0,e])}}ne.empty=new ne([]);class bt{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new bt(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new bt;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return n?e:new Wn(e,i,null)}}const kn=Object.create(null);class Y{getMap(){return ne.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=kn[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in kn)throw new RangeError("Duplicate use of step JSON ID "+e);return kn[e]=t,t.prototype.jsonID=e,t}}class z{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new z(e,null)}static fail(e){return new z(null,e)}static fromReplace(e,t,n,i){try{return z.ok(e.replace(t,n,i))}catch(s){if(s instanceof Jt)return z.fail(s.message);throw s}}}function tr(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let s=r.child(i);s.content.size&&(s=s.copy(tr(s.content,e,s))),s.isInline&&(s=e(s,t,i)),n.push(s)}return b.fromArray(n)}class Ce extends Y{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new k(tr(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return z.fromReplace(e,this.from,this.to,s)}invert(){return new ae(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Ce(t.pos,n.pos,this.mark)}merge(e){return e instanceof Ce&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ce(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ce(t.from,t.to,e.markFromJSON(t.mark))}}Y.jsonID("addMark",Ce);class ae extends Y{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new k(tr(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return z.fromReplace(e,this.from,this.to,n)}invert(){return new Ce(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new ae(t.pos,n.pos,this.mark)}merge(e){return e instanceof ae&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ae(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ae(t.from,t.to,e.markFromJSON(t.mark))}}Y.jsonID("removeMark",ae);class Me extends Y{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return z.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return z.fromReplace(e,this.pos,this.pos+1,new k(b.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new Me(this.pos,t.marks[i]);return new Me(this.pos,this.mark)}}return new je(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Me(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Me(t.pos,e.markFromJSON(t.mark))}}Y.jsonID("addNodeMark",Me);class je extends Y{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return z.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return z.fromReplace(e,this.pos,this.pos+1,new k(b.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Me(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new je(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new je(t.pos,e.markFromJSON(t.mark))}}Y.jsonID("removeNodeMark",je);class V extends Y{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&jn(e,this.from,this.to)?z.fail("Structure replace would overwrite content"):z.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ne([this.from,this.to-this.from,this.slice.size])}invert(e){return new V(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new V(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof V)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?k.empty:new k(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new V(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?k.empty:new k(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new V(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new V(t.from,t.to,k.fromJSON(e,t.slice),!!t.structure)}}Y.jsonID("replace",V);class L extends Y{constructor(e,t,n,i,s,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(e){if(this.structure&&(jn(e,this.from,this.gapFrom)||jn(e,this.gapTo,this.to)))return z.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return z.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?z.fromReplace(e,this.from,this.to,n):z.fail("Content does not fit in gap")}getMap(){return new ne([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new L(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||s>n.pos?null:new L(t.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new L(t.from,t.to,t.gapFrom,t.gapTo,k.fromJSON(e,t.slice),t.insert,!!t.structure)}}Y.jsonID("replaceAround",L);function jn(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function zl(r,e,t,n){let i=[],s=[],o,l;r.doc.nodesBetween(e,t,(a,c,f)=>{if(!a.isInline)return;let u=a.marks;if(!n.isInSet(u)&&f.type.allowsMarkType(n.type)){let d=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=n.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(p)||(o&&o.to==d&&o.mark.eq(u[m])?o.to=h:i.push(o=new ae(d,h,u[m])));l&&l.to==d?l.to=h:s.push(l=new Ce(d,h,n))}}),i.forEach(a=>r.step(a)),s.forEach(a=>r.step(a))}function Fl(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(n instanceof nn){let c=o.marks,f;for(;f=n.isInSet(c);)(a||(a=[])).push(f),c=f.removeFromSet(c)}else n?n.isInSet(o.marks)&&(a=[n]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let f=0;f<a.length;f++){let u=a[f],d;for(let h=0;h<i.length;h++){let p=i[h];p.step==s-1&&u.eq(i[h].style)&&(d=p)}d?(d.to=c,d.step=s):i.push({style:u,from:Math.max(l,e),to:c,step:s})}}}),i.forEach(o=>r.step(new ae(o.from,o.to,o.style)))}function nr(r,e,t,n=t.contentMatch,i=!0){let s=r.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<s.childCount;a++){let c=s.child(a),f=l+c.nodeSize,u=n.matchType(c.type);if(!u)o.push(new V(l,f,k.empty));else{n=u;for(let d=0;d<c.marks.length;d++)t.allowsMarkType(c.marks[d].type)||r.step(new ae(l,f,c.marks[d]));if(i&&c.isText&&t.whitespace!="pre"){let d,h=/\r?\n|\r/g,p;for(;d=h.exec(c.text);)p||(p=new k(b.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new V(l+d.index,l+d.index+d[0].length,p))}}l=f}if(!n.validEnd){let a=n.fillBefore(b.empty,!0);r.replace(l,l,new k(a,0,0))}for(let a=o.length-1;a>=0;a--)r.step(o[a])}function Vl(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function ot(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),s=r.$from.index(n),o=r.$to.indexAfter(n);if(n<r.depth&&i.canReplace(s,o,t))return n;if(n==0||i.type.spec.isolating||!Vl(i,s,o))break}return null}function Ll(r,e,t){let{$from:n,$to:i,depth:s}=e,o=n.before(s+1),l=i.after(s+1),a=o,c=l,f=b.empty,u=0;for(let p=s,m=!1;p>t;p--)m||n.index(p)>0?(m=!0,f=b.from(n.node(p).copy(f)),u++):a--;let d=b.empty,h=0;for(let p=s,m=!1;p>t;p--)m||i.after(p+1)<i.end(p)?(m=!0,d=b.from(i.node(p).copy(d)),h++):c++;r.step(new L(a,c,o,l,new k(f.append(d),u,h),f.size-u,!0))}function ds(r,e,t=null,n=r){let i=$l(r,e),s=i&&Wl(n,e);return s?i.map(Wr).concat({type:e,attrs:t}).concat(s.map(Wr)):null}function Wr(r){return{type:r,attrs:null}}function $l(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.contentMatchAt(n).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(n,i,o)?s:null}function Wl(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.child(n),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=n;a&&c<i;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function jl(r,e,t){let n=b.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let l=t[o].type.contentMatch.matchFragment(n);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=b.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new L(i,s,i,s,new k(n,0,0),t.length,!0))}function Jl(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,a)&&ql(r.doc,r.mapping.slice(s).map(l),n)){let c=null;if(n.schema.linebreakReplacement){let h=n.whitespace=="pre",p=!!n.contentMatch.matchType(n.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&ps(r,o,l,s),nr(r,r.mapping.slice(s).map(l,1),n,void 0,c===null);let f=r.mapping.slice(s),u=f.map(l,1),d=f.map(l+o.nodeSize,1);return r.step(new L(u,d,u+1,d-1,new k(b.from(n.create(a,null,o.marks)),0,0),1,!0)),c===!0&&hs(r,o,l,s),!1}})}function hs(r,e,t,n){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=r.mapping.slice(n).map(t+1+s+o.index);r.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function ps(r,e,t,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+s);r.replaceWith(o,o+1,e.type.schema.text(`
@@ -0,0 +1 @@
1
+ import{u as sa}from"./useKeyValueEditor-D9cp0yxU.js";import{W as _e}from"./WdsFieldWrapper-DUvtHQhU.js";import{aQ as H,aO as ia,d as Ue,an as oa,ap as la,r as ua,c as q,o as F,b as ca,aw as qe,i as pe,a as ge,q as va,f as N,g as S,x as d,y as ee,A as D,R as h,D as ae,a1 as B,E as fa,z as G,W as re,_ as da}from"./index-Tfvjt7wd.js";function _a(){this.__data__=[],this.size=0}var pa=_a;function ga(e,a){return e===a||e!==e&&a!==a}var Ke=ga,ya=Ke;function ha(e,a){for(var r=e.length;r--;)if(ya(e[r][0],a))return r;return-1}var k=ha,$a=k,ba=Array.prototype,Aa=ba.splice;function Ta(e){var a=this.__data__,r=$a(a,e);if(r<0)return!1;var t=a.length-1;return r==t?a.pop():Aa.call(a,r,1),--this.size,!0}var ma=Ta,Sa=k;function Ca(e){var a=this.__data__,r=Sa(a,e);return r<0?void 0:a[r][1]}var Oa=Ca,ja=k;function wa(e){return ja(this.__data__,e)>-1}var Pa=wa,Ea=k;function xa(e,a){var r=this.__data__,t=Ea(r,e);return t<0?(++this.size,r.push([e,a])):r[t][1]=a,this}var Ia=xa,La=pa,Ma=ma,Da=Oa,Ba=Pa,Ga=Ia;function P(e){var a=-1,r=e==null?0:e.length;for(this.clear();++a<r;){var t=e[a];this.set(t[0],t[1])}}P.prototype.clear=La;P.prototype.delete=Ma;P.prototype.get=Da;P.prototype.has=Ba;P.prototype.set=Ga;var J=P,Va=J;function Fa(){this.__data__=new Va,this.size=0}var Ra=Fa;function Ha(e){var a=this.__data__,r=a.delete(e);return this.size=a.size,r}var Na=Ha;function Ua(e){return this.__data__.get(e)}var qa=Ua;function Ka(e){return this.__data__.has(e)}var za=Ka,Wa=typeof H=="object"&&H&&H.Object===Object&&H,ze=Wa,ka=ze,Ja=typeof self=="object"&&self&&self.Object===Object&&self,Xa=ka||Ja||Function("return this")(),C=Xa,Qa=C,Ya=Qa.Symbol,ve=Ya,ye=ve,We=Object.prototype,Za=We.hasOwnProperty,er=We.toString,V=ye?ye.toStringTag:void 0;function ar(e){var a=Za.call(e,V),r=e[V];try{e[V]=void 0;var t=!0}catch{}var s=er.call(e);return t&&(a?e[V]=r:delete e[V]),s}var rr=ar,tr=Object.prototype,nr=tr.toString;function sr(e){return nr.call(e)}var ir=sr,he=ve,or=rr,lr=ir,ur="[object Null]",cr="[object Undefined]",$e=he?he.toStringTag:void 0;function vr(e){return e==null?e===void 0?cr:ur:$e&&$e in Object(e)?or(e):lr(e)}var X=vr;function fr(e){var a=typeof e;return e!=null&&(a=="object"||a=="function")}var ke=fr,dr=X,_r=ke,pr="[object AsyncFunction]",gr="[object Function]",yr="[object GeneratorFunction]",hr="[object Proxy]";function $r(e){if(!_r(e))return!1;var a=dr(e);return a==gr||a==yr||a==pr||a==hr}var Je=$r,br=C,Ar=br["__core-js_shared__"],Tr=Ar,te=Tr,be=function(){var e=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function mr(e){return!!be&&be in e}var Sr=mr,Cr=Function.prototype,Or=Cr.toString;function jr(e){if(e!=null){try{return Or.call(e)}catch{}try{return e+""}catch{}}return""}var Xe=jr,wr=Je,Pr=Sr,Er=ke,xr=Xe,Ir=/[\\^$.*+?()[\]{}|]/g,Lr=/^\[object .+?Constructor\]$/,Mr=Function.prototype,Dr=Object.prototype,Br=Mr.toString,Gr=Dr.hasOwnProperty,Vr=RegExp("^"+Br.call(Gr).replace(Ir,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fr(e){if(!Er(e)||Pr(e))return!1;var a=wr(e)?Vr:Lr;return a.test(xr(e))}var Rr=Fr;function Hr(e,a){return e==null?void 0:e[a]}var Nr=Hr,Ur=Rr,qr=Nr;function Kr(e,a){var r=qr(e,a);return Ur(r)?r:void 0}var E=Kr,zr=E,Wr=C,kr=zr(Wr,"Map"),fe=kr,Jr=E,Xr=Jr(Object,"create"),Q=Xr,Ae=Q;function Qr(){this.__data__=Ae?Ae(null):{},this.size=0}var Yr=Qr;function Zr(e){var a=this.has(e)&&delete this.__data__[e];return this.size-=a?1:0,a}var et=Zr,at=Q,rt="__lodash_hash_undefined__",tt=Object.prototype,nt=tt.hasOwnProperty;function st(e){var a=this.__data__;if(at){var r=a[e];return r===rt?void 0:r}return nt.call(a,e)?a[e]:void 0}var it=st,ot=Q,lt=Object.prototype,ut=lt.hasOwnProperty;function ct(e){var a=this.__data__;return ot?a[e]!==void 0:ut.call(a,e)}var vt=ct,ft=Q,dt="__lodash_hash_undefined__";function _t(e,a){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ft&&a===void 0?dt:a,this}var pt=_t,gt=Yr,yt=et,ht=it,$t=vt,bt=pt;function x(e){var a=-1,r=e==null?0:e.length;for(this.clear();++a<r;){var t=e[a];this.set(t[0],t[1])}}x.prototype.clear=gt;x.prototype.delete=yt;x.prototype.get=ht;x.prototype.has=$t;x.prototype.set=bt;var At=x,Te=At,Tt=J,mt=fe;function St(){this.size=0,this.__data__={hash:new Te,map:new(mt||Tt),string:new Te}}var Ct=St;function Ot(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}var jt=Ot,wt=jt;function Pt(e,a){var r=e.__data__;return wt(a)?r[typeof a=="string"?"string":"hash"]:r.map}var Y=Pt,Et=Y;function xt(e){var a=Et(this,e).delete(e);return this.size-=a?1:0,a}var It=xt,Lt=Y;function Mt(e){return Lt(this,e).get(e)}var Dt=Mt,Bt=Y;function Gt(e){return Bt(this,e).has(e)}var Vt=Gt,Ft=Y;function Rt(e,a){var r=Ft(this,e),t=r.size;return r.set(e,a),this.size+=r.size==t?0:1,this}var Ht=Rt,Nt=Ct,Ut=It,qt=Dt,Kt=Vt,zt=Ht;function I(e){var a=-1,r=e==null?0:e.length;for(this.clear();++a<r;){var t=e[a];this.set(t[0],t[1])}}I.prototype.clear=Nt;I.prototype.delete=Ut;I.prototype.get=qt;I.prototype.has=Kt;I.prototype.set=zt;var Qe=I,Wt=J,kt=fe,Jt=Qe,Xt=200;function Qt(e,a){var r=this.__data__;if(r instanceof Wt){var t=r.__data__;if(!kt||t.length<Xt-1)return t.push([e,a]),this.size=++r.size,this;r=this.__data__=new Jt(t)}return r.set(e,a),this.size=r.size,this}var Yt=Qt,Zt=J,en=Ra,an=Na,rn=qa,tn=za,nn=Yt;function L(e){var a=this.__data__=new Zt(e);this.size=a.size}L.prototype.clear=en;L.prototype.delete=an;L.prototype.get=rn;L.prototype.has=tn;L.prototype.set=nn;var sn=L,on="__lodash_hash_undefined__";function ln(e){return this.__data__.set(e,on),this}var un=ln;function cn(e){return this.__data__.has(e)}var vn=cn,fn=Qe,dn=un,_n=vn;function K(e){var a=-1,r=e==null?0:e.length;for(this.__data__=new fn;++a<r;)this.add(e[a])}K.prototype.add=K.prototype.push=dn;K.prototype.has=_n;var pn=K;function gn(e,a){for(var r=-1,t=e==null?0:e.length;++r<t;)if(a(e[r],r,e))return!0;return!1}var yn=gn;function hn(e,a){return e.has(a)}var $n=hn,bn=pn,An=yn,Tn=$n,mn=1,Sn=2;function Cn(e,a,r,t,s,n){var i=r&mn,o=e.length,u=a.length;if(o!=u&&!(i&&u>o))return!1;var l=n.get(e),g=n.get(a);if(l&&g)return l==a&&g==e;var _=-1,f=!0,$=r&Sn?new bn:void 0;for(n.set(e,a),n.set(a,e);++_<o;){var p=e[_],y=a[_];if(t)var b=i?t(y,p,_,a,e,n):t(p,y,_,e,a,n);if(b!==void 0){if(b)continue;f=!1;break}if($){if(!An(a,function(T,m){if(!Tn($,m)&&(p===T||s(p,T,r,t,n)))return $.push(m)})){f=!1;break}}else if(!(p===y||s(p,y,r,t,n))){f=!1;break}}return n.delete(e),n.delete(a),f}var Ye=Cn,On=C,jn=On.Uint8Array,wn=jn;function Pn(e){var a=-1,r=Array(e.size);return e.forEach(function(t,s){r[++a]=[s,t]}),r}var En=Pn;function xn(e){var a=-1,r=Array(e.size);return e.forEach(function(t){r[++a]=t}),r}var In=xn,me=ve,Se=wn,Ln=Ke,Mn=Ye,Dn=En,Bn=In,Gn=1,Vn=2,Fn="[object Boolean]",Rn="[object Date]",Hn="[object Error]",Nn="[object Map]",Un="[object Number]",qn="[object RegExp]",Kn="[object Set]",zn="[object String]",Wn="[object Symbol]",kn="[object ArrayBuffer]",Jn="[object DataView]",Ce=me?me.prototype:void 0,ne=Ce?Ce.valueOf:void 0;function Xn(e,a,r,t,s,n,i){switch(r){case Jn:if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case kn:return!(e.byteLength!=a.byteLength||!n(new Se(e),new Se(a)));case Fn:case Rn:case Un:return Ln(+e,+a);case Hn:return e.name==a.name&&e.message==a.message;case qn:case zn:return e==a+"";case Nn:var o=Dn;case Kn:var u=t&Gn;if(o||(o=Bn),e.size!=a.size&&!u)return!1;var l=i.get(e);if(l)return l==a;t|=Vn,i.set(e,a);var g=Mn(o(e),o(a),t,s,n,i);return i.delete(e),g;case Wn:if(ne)return ne.call(e)==ne.call(a)}return!1}var Qn=Xn;function Yn(e,a){for(var r=-1,t=a.length,s=e.length;++r<t;)e[s+r]=a[r];return e}var Zn=Yn,es=Array.isArray,de=es,as=Zn,rs=de;function ts(e,a,r){var t=a(e);return rs(e)?t:as(t,r(e))}var ns=ts;function ss(e,a){for(var r=-1,t=e==null?0:e.length,s=0,n=[];++r<t;){var i=e[r];a(i,r,e)&&(n[s++]=i)}return n}var is=ss;function os(){return[]}var ls=os,us=is,cs=ls,vs=Object.prototype,fs=vs.propertyIsEnumerable,Oe=Object.getOwnPropertySymbols,ds=Oe?function(e){return e==null?[]:(e=Object(e),us(Oe(e),function(a){return fs.call(e,a)}))}:cs,_s=ds;function ps(e,a){for(var r=-1,t=Array(e);++r<e;)t[r]=a(r);return t}var gs=ps;function ys(e){return e!=null&&typeof e=="object"}var Z=ys,hs=X,$s=Z,bs="[object Arguments]";function As(e){return $s(e)&&hs(e)==bs}var Ts=As,je=Ts,ms=Z,Ze=Object.prototype,Ss=Ze.hasOwnProperty,Cs=Ze.propertyIsEnumerable,Os=je(function(){return arguments}())?je:function(e){return ms(e)&&Ss.call(e,"callee")&&!Cs.call(e,"callee")},js=Os,z={exports:{}};function ws(){return!1}var Ps=ws;z.exports;(function(e,a){var r=C,t=Ps,s=a&&!a.nodeType&&a,n=s&&!0&&e&&!e.nodeType&&e,i=n&&n.exports===s,o=i?r.Buffer:void 0,u=o?o.isBuffer:void 0,l=u||t;e.exports=l})(z,z.exports);var ea=z.exports,Es=9007199254740991,xs=/^(?:0|[1-9]\d*)$/;function Is(e,a){var r=typeof e;return a=a??Es,!!a&&(r=="number"||r!="symbol"&&xs.test(e))&&e>-1&&e%1==0&&e<a}var Ls=Is,Ms=9007199254740991;function Ds(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ms}var aa=Ds,Bs=X,Gs=aa,Vs=Z,Fs="[object Arguments]",Rs="[object Array]",Hs="[object Boolean]",Ns="[object Date]",Us="[object Error]",qs="[object Function]",Ks="[object Map]",zs="[object Number]",Ws="[object Object]",ks="[object RegExp]",Js="[object Set]",Xs="[object String]",Qs="[object WeakMap]",Ys="[object ArrayBuffer]",Zs="[object DataView]",ei="[object Float32Array]",ai="[object Float64Array]",ri="[object Int8Array]",ti="[object Int16Array]",ni="[object Int32Array]",si="[object Uint8Array]",ii="[object Uint8ClampedArray]",oi="[object Uint16Array]",li="[object Uint32Array]",c={};c[ei]=c[ai]=c[ri]=c[ti]=c[ni]=c[si]=c[ii]=c[oi]=c[li]=!0;c[Fs]=c[Rs]=c[Ys]=c[Hs]=c[Zs]=c[Ns]=c[Us]=c[qs]=c[Ks]=c[zs]=c[Ws]=c[ks]=c[Js]=c[Xs]=c[Qs]=!1;function ui(e){return Vs(e)&&Gs(e.length)&&!!c[Bs(e)]}var ci=ui;function vi(e){return function(a){return e(a)}}var fi=vi,W={exports:{}};W.exports;(function(e,a){var r=ze,t=a&&!a.nodeType&&a,s=t&&!0&&e&&!e.nodeType&&e,n=s&&s.exports===t,i=n&&r.process,o=function(){try{var u=s&&s.require&&s.require("util").types;return u||i&&i.binding&&i.binding("util")}catch{}}();e.exports=o})(W,W.exports);var di=W.exports,_i=ci,pi=fi,we=di,Pe=we&&we.isTypedArray,gi=Pe?pi(Pe):_i,ra=gi,yi=gs,hi=js,$i=de,bi=ea,Ai=Ls,Ti=ra,mi=Object.prototype,Si=mi.hasOwnProperty;function Ci(e,a){var r=$i(e),t=!r&&hi(e),s=!r&&!t&&bi(e),n=!r&&!t&&!s&&Ti(e),i=r||t||s||n,o=i?yi(e.length,String):[],u=o.length;for(var l in e)(a||Si.call(e,l))&&!(i&&(l=="length"||s&&(l=="offset"||l=="parent")||n&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Ai(l,u)))&&o.push(l);return o}var Oi=Ci,ji=Object.prototype;function wi(e){var a=e&&e.constructor,r=typeof a=="function"&&a.prototype||ji;return e===r}var Pi=wi;function Ei(e,a){return function(r){return e(a(r))}}var xi=Ei,Ii=xi,Li=Ii(Object.keys,Object),Mi=Li,Di=Pi,Bi=Mi,Gi=Object.prototype,Vi=Gi.hasOwnProperty;function Fi(e){if(!Di(e))return Bi(e);var a=[];for(var r in Object(e))Vi.call(e,r)&&r!="constructor"&&a.push(r);return a}var Ri=Fi,Hi=Je,Ni=aa;function Ui(e){return e!=null&&Ni(e.length)&&!Hi(e)}var qi=Ui,Ki=Oi,zi=Ri,Wi=qi;function ki(e){return Wi(e)?Ki(e):zi(e)}var Ji=ki,Xi=ns,Qi=_s,Yi=Ji;function Zi(e){return Xi(e,Yi,Qi)}var eo=Zi,Ee=eo,ao=1,ro=Object.prototype,to=ro.hasOwnProperty;function no(e,a,r,t,s,n){var i=r&ao,o=Ee(e),u=o.length,l=Ee(a),g=l.length;if(u!=g&&!i)return!1;for(var _=u;_--;){var f=o[_];if(!(i?f in a:to.call(a,f)))return!1}var $=n.get(e),p=n.get(a);if($&&p)return $==a&&p==e;var y=!0;n.set(e,a),n.set(a,e);for(var b=i;++_<u;){f=o[_];var T=e[f],m=a[f];if(t)var j=i?t(m,T,f,a,e,n):t(T,m,f,e,a,n);if(!(j===void 0?T===m||s(T,m,r,t,n):j)){y=!1;break}b||(b=f=="constructor")}if(y&&!b){var v=e.constructor,A=a.constructor;v!=A&&"constructor"in e&&"constructor"in a&&!(typeof v=="function"&&v instanceof v&&typeof A=="function"&&A instanceof A)&&(y=!1)}return n.delete(e),n.delete(a),y}var so=no,io=E,oo=C,lo=io(oo,"DataView"),uo=lo,co=E,vo=C,fo=co(vo,"Promise"),_o=fo,po=E,go=C,yo=po(go,"Set"),ho=yo,$o=E,bo=C,Ao=$o(bo,"WeakMap"),To=Ao,ie=uo,oe=fe,le=_o,ue=ho,ce=To,ta=X,M=Xe,xe="[object Map]",mo="[object Object]",Ie="[object Promise]",Le="[object Set]",Me="[object WeakMap]",De="[object DataView]",So=M(ie),Co=M(oe),Oo=M(le),jo=M(ue),wo=M(ce),O=ta;(ie&&O(new ie(new ArrayBuffer(1)))!=De||oe&&O(new oe)!=xe||le&&O(le.resolve())!=Ie||ue&&O(new ue)!=Le||ce&&O(new ce)!=Me)&&(O=function(e){var a=ta(e),r=a==mo?e.constructor:void 0,t=r?M(r):"";if(t)switch(t){case So:return De;case Co:return xe;case Oo:return Ie;case jo:return Le;case wo:return Me}return a});var Po=O,se=sn,Eo=Ye,xo=Qn,Io=so,Be=Po,Ge=de,Ve=ea,Lo=ra,Mo=1,Fe="[object Arguments]",Re="[object Array]",U="[object Object]",Do=Object.prototype,He=Do.hasOwnProperty;function Bo(e,a,r,t,s,n){var i=Ge(e),o=Ge(a),u=i?Re:Be(e),l=o?Re:Be(a);u=u==Fe?U:u,l=l==Fe?U:l;var g=u==U,_=l==U,f=u==l;if(f&&Ve(e)){if(!Ve(a))return!1;i=!0,g=!1}if(f&&!g)return n||(n=new se),i||Lo(e)?Eo(e,a,r,t,s,n):xo(e,a,u,r,t,s,n);if(!(r&Mo)){var $=g&&He.call(e,"__wrapped__"),p=_&&He.call(a,"__wrapped__");if($||p){var y=$?e.value():e,b=p?a.value():a;return n||(n=new se),s(y,b,r,t,n)}}return f?(n||(n=new se),Io(e,a,r,t,s,n)):!1}var Go=Bo,Vo=Go,Ne=Z;function na(e,a,r,t,s){return e===a?!0:e==null||a==null||!Ne(e)&&!Ne(a)?e!==e&&a!==a:Vo(e,a,r,t,na,s)}var Fo=na,Ro=Fo;function Ho(e,a){return Ro(e,a)}var No=Ho;const Uo=ia(No),qo=Ue({__name:"WdsPasswordInput",props:oa({invalid:{type:Boolean,required:!1},revealable:{type:Boolean,default:!0,required:!1},variant:{type:String,default:void 0},rightText:{type:String,required:!1,default:""},autofocus:{type:Boolean}},{modelValue:{type:String},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=la(e,"modelValue"),r=ua(!1),t=q(()=>r.value?"eye-off":"eye"),s=q(()=>r.value?"text":"password");return(n,i)=>(F(),ca(qe,{modelValue:a.value,"onUpdate:modelValue":i[0]||(i[0]=o=>a.value=o),class:"WdsPasswordInput",type:s.value,"right-icon":e.revealable?t.value:void 0,autofocus:e.autofocus,invalid:e.invalid,variant:e.variant,onRightIconClick:i[1]||(i[1]=o=>e.revealable?r.value=!r.value:void 0)},null,8,["modelValue","type","right-icon","autofocus","invalid","variant"]))}}),Ko={class:"BuilderVault"},zo={class:"BuilderVault__editor"},Wo={class:"BuilderVault__editor__form"},ko={class:"BuilderVault__editor__toolbar"},Jo=Ue({__name:"BuilderVault",setup(e){const a=pe(ge.core),{secrets:r,load:t,readonly:s,isLoading:n,update:i,isSaving:o}=pe(ge.secretsManager),{currentValueObject:u,assistedEntries:l,getAssistedEntryError:g,updateAssistedEntryKey:_,updateAssistedEntryValue:f,updateAssistedEntries:$,removeAssistedEntry:p,addAssistedEntry:y}=sa({}),b=q(()=>Object.entries(u.value).reduce((j,[v,A])=>(v&&A&&(j[v]=A),j),{})),T=q(()=>s.value||n.value?!1:!Uo(b.value,r.value));async function m(){typeof u.value!="object"||u.value===null||(await i(u.value),await a.sendWriterVaultUpdate())}return va(async()=>{await t(),!(typeof r.value!="object"||r.value===null)&&$(r.value)}),(j,v)=>(F(),N("div",Ko,[S("h1",null,[d(ee,{name:"key-round"}),v[0]||(v[0]=D(" Secrets vault "))]),v[5]||(v[5]=S("p",null,[D(" Save the key value pairs for all of your integrations and secrets here, then reference them with "),S("code",null,"@{vault}"),D(" from any block in your blueprint. ")],-1)),S("div",zo,[S("div",Wo,[v[1]||(v[1]=S("p",{class:"BuilderVault__editor__form__labelKey"},"Key",-1)),v[2]||(v[2]=S("p",{class:"BuilderVault__editor__form__labelValue"},"Value",-1)),h(n)?(F(),N(ae,{key:0},[d(B,{class:"BuilderVault__editor__form__loader"}),d(B,{class:"BuilderVault__editor__form__loader"}),d(B,{class:"BuilderVault__editor__form__loader"}),d(B,{class:"BuilderVault__editor__form__loader"}),d(B,{class:"BuilderVault__editor__form__loader"})],64)):(F(!0),N(ae,{key:1},fa(h(l),(A,w)=>(F(),N(ae,{key:w},[d(_e,{error:h(g)(w)},{default:G(()=>[d(qe,{placeholder:"Type a key...","model-value":A.key,error:h(g)(w),readonly:h(s),"onUpdate:modelValue":R=>h(_)(w,R)},null,8,["model-value","error","readonly","onUpdate:modelValue"])]),_:2},1032,["error"]),d(_e,null,{default:G(()=>[d(qo,{autocomplete:"off",placeholder:"Type a value...","model-value":A.value,readonly:h(s),revealable:!1,"onUpdate:modelValue":R=>h(f)(w,R)},null,8,["model-value","readonly","onUpdate:modelValue"])]),_:2},1024),S("div",null,[d(re,{variant:"neutral",size:"smallIcon",class:"BuilderVault__editor__form__deleteBtn",disabled:h(s),onClick:R=>h(p)(w)},{default:G(()=>[d(ee,{name:"trash-2"})]),_:2},1032,["disabled","onClick"])])],64))),128))]),S("div",ko,[d(re,{variant:"tertiary",size:"small",disabled:h(s),onClick:h(y)},{default:G(()=>[d(ee,{name:"plus"}),v[3]||(v[3]=D(" Add a pair "))]),_:1},8,["disabled","onClick"]),d(re,{variant:"primary",size:"small",disabled:!T.value,loading:h(o),onClick:m},{default:G(()=>v[4]||(v[4]=[D("Save")])),_:1},8,["disabled","loading"])])])]))}}),Zo=da(Jo,[["__scopeId","data-v-4766db1d"]]);export{Zo as default};
@@ -1 +1 @@
1
- import{d as K,i as M,a as p,c as v,o as k,b as Q,B as _e,e as he,f as W,g as _,t as A,h as ye,u as Ce,C as te,r as R,j as be,p as T,w as z,F as Se,k as D,l as ae,_ as Z,m as Ie,n as Pe,q as re,s as ne,v as se,x as O,y as X,z as Ee,A as Me,W as Te,D as we,E as $e,G as ie,H as ke,I as Be,J as De,K as Ae,L as Re,M as Ve,N as xe,O as Le,P as J,Q as oe}from"./index-Bz7k91zI.js";const Oe=10,We=K({__name:"ChildlessPlaceholder",props:{componentId:{type:String,required:!0}},setup(C){const s=M(p.core),l=C,b=(r,u)=>{const f=r.map(g=>s.getComponentDefinition(g)).map(g=>g==null?void 0:g.name);return`${f.slice(0,-1).join(", ")} ${f.length>1?u:""} ${f.at(-1)}`},c=v(()=>{const r=s.getContainableTypes(l.componentId);let u;return r.length<=Oe&&(u=`You can add ${b(r,"and")} components`),u});return(r,u)=>(k(),Q(_e,{class:"ChildlessPlaceholder","component-id":C.componentId,message:c.value},null,8,["component-id","message"]))}}),qe=["draggable"],Fe={class:"title"},He={class:"message"},je=K({__name:"RenderError",props:{componentType:{type:String,required:!0},message:{type:String,required:!0},draggable:{type:Boolean,required:!1}},setup(C){const s=M(p.core),l=M(p.componentId),b=v(()=>s.getComponentById(l)),c=v(()=>{var u;return s.getComponentById((u=b.value)==null?void 0:u.parentId)}),r=v(()=>{var u;return((u=c.value)==null?void 0:u.type)==="blueprints_blueprint"});return(u,m)=>r.value?(k(),Q(he,{key:0,draggable:!1})):(k(),W("div",{key:1,class:"RenderError",draggable:C.draggable},[_("div",Fe,[_("h2",null,"Error rendering "+A(C.componentType),1)]),_("div",He,A(C.message),1)],8,qe))}}),ze={props:{componentId:{type:String,required:!0},instancePath:{type:Array,required:!0},instanceData:{type:Array,required:!0}},setup(C){const s=M(p.core),l=M(p.builderManager),b=M(p.secretsManager),c=C.componentId,r=v(()=>s.getComponentById(c)),u=ye(r.value.type),m=C.instancePath,f=C.instanceData,{getEvaluatedFields:I,isComponentVisible:g}=ae(s,b),S=I(m),V=Ce(s),x=v(()=>s.getComponents(c,{sortedByPosition:!0}).filter(t=>{var a;return((a=s.getComponentDefinition(t.type))==null?void 0:a.category)!=="Internal"})),w=v(()=>!!l&&l.getMode()!="preview"),N=v(()=>{var t;return w.value&&!r.value.isCodeManaged&&!te.has(r.value.type)&&((t=U.value)==null?void 0:t.toolkit)!=="blueprints"}),q=(t,a)=>(t?s.getContainableTypes(t):[...te]).includes(a),L=R(!1),e=()=>{if(!(x.value.length>0))return D(We,{componentId:r.value.id})},n=(t,a=0,i)=>D(le,{componentId:t,key:`${t}:${a}`,instancePath:[...m,{componentId:t,instanceNumber:a}],instanceData:[...f,R(null)],...i??{}}),o=t=>a=>{if(!q(c,a.type)&&t==="default")return!0;const h=s.getComponentDefinition(a.type).slot??"default";return h==="*"||h===t},d=(t=0,a="default",i=()=>!0,h=!1)=>{const P=y=>!w.value||h?[]:[D("div",{"data-writer-slot-of-id":c,"data-writer-position":y})],E=x.value.filter(o(a)).filter(i),B=E.filter(y=>!y.isCodeManaged).map(y=>n(y.id,t,{contextSlot:a})),H=E.filter(y=>y.isCodeManaged).map(y=>n(y.id,t,{contextSlot:a}));return[...P(0),...B.map((y,j)=>[y,P(j+1)]).flat(),...H]},$=be(m);T(p.evaluatedFields,S),T(p.componentId,c),T(p.isBeingEdited,w),T(p.isDisabled,L),T(p.instancePath,m),T(p.instanceData,f),T(p.renderProxiedComponent,n),T(p.getChildrenVNodes,d),T(p.flattenedInstancePath,$);const F={"data-writer-id":c,"data-writer-instance-path":$},U=v(()=>s.getComponentDefinition(r.value.type)),Y=v(()=>{var t;return(t=U.value)==null?void 0:t.fields}),G=R(!1);z(()=>l==null?void 0:l.isComponentIdSelected(c),t=>{G.value=t},{immediate:!0});const ce=v(()=>Object.entries(Y.value??{}).filter(([,t])=>t.category===Se.Style).reduce((t,[a])=>(t[a]=S[a].value,t),{}));z(ce,()=>{G.value=!1,V.track("ui_block_styles_updated")});const ee=v(()=>x.value.length==0),de=v(()=>g(c,m)),ue=(t,a)=>{if((!t||!(t!=null&&t.startsWith("$goToPage_")))&&!a)return h=>{s.forwardEvent(h,m,!0)};if(t!=null&&t.startsWith("$goToPage_")){const h=t.substring(10);return P=>s.setActivePageFromKey(h)}return null},pe=v(()=>{const t={};return Object.keys(U.value.events??{}).forEach(i=>{var E;const h=`on${i.charAt(0).toUpperCase()}${i.slice(1)}`,P=i===((E=r.value.binding)==null?void 0:E.eventType);t[h]=B=>{var y,j;P&&s.forwardEvent(B,m,!0);const H=((y=r.value.handlers)==null?void 0:y[i])??null;(j=ue(H,P))==null||j(B)}}),t}),ve=v(()=>{const t=Y.value;if(!t)return;const a={};return Object.keys(t).forEach(i=>{t[i].applyStyleVariable&&S[i]&&(a[`--${i}`]=S[i].value)}),a}),me=v(()=>{const t="cssClasses",a=Y.value;if(!a||!a[t]||!S[t])return;const i=String(S[t].value),h=i==null?void 0:i.split(" ").map(E=>E.trim()),P={};return h.forEach(E=>{P[E]=!0}),P}),fe=function(){return{class:{[`wf-type-${r.value.type}`]:!0,component:!0,childless:ee.value,selected:G.value,disabled:L.value,beingEdited:w.value,...me.value},style:{...ve.value,...de.value?{}:{display:"none"}},...F,...L.value?[]:pe.value,draggable:N.value}},ge=(t,a)=>w.value?D(je,{...t,componentType:r.value.type,message:a}):D("div");return()=>{const t=w.value?e():void 0,a=({instanceNumber:h=0,slotName:P="default",componentFilter:E=()=>!0,positionlessSlot:B=!1})=>ee.value?B?void 0:t:d(h,P,E,B),i=fe();return q(r.value.parentId,r.value.type)?D(u,i,{default:a}):ge(i,"Parent is not suitable for this component")}}},le=Z(ze,[["__scopeId","data-v-683afb33"]]),Ke={class:"counter"},Ne={class:"main"},Ue={class:"clearContainer"},Ye={class:"content"},Ge={class:"title"},Xe={class:"time"},Je={class:"message"},Qe=100,Ze=K({__name:"RendererNotifications",setup(C){const s=M(p.core),l=R(!1),b=Ie("balloon"),c=Pe([]),r=f=>{const{type:I,title:g,message:S,code:V}=f;c.unshift({type:I,title:g,message:S,code:V,timestampReceived:new Date}),c.splice(Qe),b.value.classList.remove("alert"),b.value.offsetWidth,b.value.classList.add("alert")};re(()=>{s.addMailSubscription("notification",r)});const u=()=>{c.length!=0&&(l.value=!l.value)},m=()=>{c.splice(0),l.value=!1};return(f,I)=>ne((k(),W("div",{class:"RendererNotifications colorTransformer",onClick:u},[_("div",{ref_key:"balloon",ref:b,class:"balloon",title:"Toggle notifications"},[O(X,{name:"bell"}),_("div",Ke,A(c.length),1)],512),I[1]||(I[1]=_("div",{class:"balloonFlash"},null,-1)),ne(_("div",Ne,[_("div",Ue,[O(Te,{onClick:m},{default:Ee(()=>[O(X,{name:"trash-2"}),I[0]||(I[0]=Me(" Clear all "))]),_:1})]),(k(!0),W(we,null,$e(c,(g,S)=>(k(),W("div",{key:S,class:"notification"},[_("div",{class:ie(["icon",g.type])},[O(X,{name:"triangle-alert"})],2),_("div",Ye,[_("header",null,[_("strong",Ge,A(g.title),1),_("span",Xe,A(g.timestampReceived.toLocaleTimeString()),1)]),_("div",Je,A(g.message),1)])]))),128))],512),[[se,l.value]])],512)),[[se,c.length>0]])}}),et=Z(Ze,[["__scopeId","data-v-758218e7"]]),tt={class:"rootComponentArea"},nt=K({__name:"ComponentRenderer",setup(C){const s=M(p.core),l=M(p.builderManager),b=M(p.secretsManager),c=ae(s,b),r={},u=R({}),m=v(()=>(l==null?void 0:l.activeRootId.value)??"root");z(m,(e,n)=>{var d;u.value[n]=s.activePageId;const o=(d=u.value)==null?void 0:d[e];o&&s.setActivePageId(o)});const f=c.getEvaluatedFields([{componentId:"root",instanceNumber:0}]),I=v(()=>{var e,n,o,d,$,F;return{...ke,"--accentColor":(e=f.accentColor)==null?void 0:e.value,"--emptinessColor":(n=f.emptinessColor)==null?void 0:n.value,"--containerBackgroundColor":(o=f.parentIdBackgroundColor)==null?void 0:o.value,"--primaryTextColor":(d=f.primaryTextColor)==null?void 0:d.value,"--secondaryTextColor":($=f.secondaryTextColor)==null?void 0:$.value,"--separatorColor":(F=f.separatorColor)==null?void 0:F.value}}),g=v(()=>s.frontendMessageMap.value.size>0);z(()=>{var e;return(e=f.appName)==null?void 0:e.value},e=>{e!=""&&S(e)},{immediate:!0});function S(e){const n=s.mode.value;let o;e&&n=="edit"?o=`${e} | Writer | Builder`:!e&&n=="edit"?o="Writer | Builder":e&&n=="run"?o=`${e}`:!e&&n=="run"&&(o="Writer"),document.title=o}async function V(e,n){const o=document.querySelector(`[data-writer-stylesheet-key="${e}"]`);o==null||o.remove();const d=document.createElement("link");d.dataset.writerStylesheetKey=e,d.setAttribute("href",J(n)),d.setAttribute("rel","stylesheet"),document.head.appendChild(d)}async function x(e,n){const o=document.querySelector(`[data-writer-script-key="${e}"]`);o==null||o.remove();const d=document.createElement("script");d.dataset.writerScriptKey=e,d.src=J(n),d.setAttribute("rel","modulepreload"),document.head.appendChild(d)}async function w(e,n){const o=J(n);r[e]=o,await oe(()=>import(o),[],import.meta.url)}async function N(e,n,o){const d=r[e],$=await oe(()=>import(d),[],import.meta.url);if(!$){console.warn(`The module with key "${e}" cannot be found. Please check that it has been imported.`);return}$[n](...o)}function q(){s.addMailSubscription("fileDownload",e=>{const n=document.createElement("a");n.href=e.data,n.download=e.fileName,n.click()}),s.addMailSubscription("openUrl",e=>{const n=document.createElement("a");n.href=e,n.target="_blank",n.rel="noopener noreferrer",n.click()}),s.addMailSubscription("pageChange",async e=>{(l==null?void 0:l.getMode())==="blueprints"&&l.setMode("ui"),await Re(),Ve(e),s.setActivePageFromKey(e)}),s.addMailSubscription("routeVarsChange",e=>{xe(e)}),s.addMailSubscription("importStylesheet",({stylesheetKey:e,path:n})=>{V(e,n)}),s.addMailSubscription("importScript",({scriptKey:e,path:n})=>{x(e,n)}),s.addMailSubscription("importModule",({moduleKey:e,specifier:n})=>{w(e,n)}),s.addMailSubscription("functionCall",({moduleKey:e,functionName:n,args:o})=>{N(e,n,o)})}function L(){const e=Le(),n=new CustomEvent("wf-app-open",{detail:{payload:e}}),o={componentId:"root",instanceNumber:0};s.forwardEvent(n,[o],!0)}return Be(()=>{q()}),re(()=>{L()}),(e,n)=>(k(),W("main",{class:ie(["ComponentRenderer",{loadingActive:g.value}]),tabindex:"-1",style:Ae(I.value)},[O(et,{class:"notifications"}),n[0]||(n[0]=_("div",{class:"loadingBar"},null,-1)),_("div",tt,[(k(),Q(le,{key:m.value,"component-id":m.value,"instance-path":[{componentId:m.value,instanceNumber:0}],"instance-data":[R(null)]},null,8,["component-id","instance-path","instance-data"])),De(e.$slots,"default",{},void 0,!0)])],6))}}),ot=Z(nt,[["__scopeId","data-v-2e3a99be"]]);export{ot as default};
1
+ import{d as K,i as M,a as p,c as v,o as k,b as Q,B as _e,e as he,f as W,g as _,t as A,h as ye,u as Ce,C as te,r as R,j as be,p as T,w as z,F as Se,k as D,l as ae,_ as Z,m as Ie,n as Pe,q as re,s as ne,v as se,x as O,y as X,z as Ee,A as Me,W as Te,D as we,E as $e,G as ie,H as ke,I as Be,J as De,K as Ae,L as Re,M as Ve,N as xe,O as Le,P as J,Q as oe}from"./index-Tfvjt7wd.js";const Oe=10,We=K({__name:"ChildlessPlaceholder",props:{componentId:{type:String,required:!0}},setup(C){const s=M(p.core),l=C,b=(r,u)=>{const f=r.map(g=>s.getComponentDefinition(g)).map(g=>g==null?void 0:g.name);return`${f.slice(0,-1).join(", ")} ${f.length>1?u:""} ${f.at(-1)}`},c=v(()=>{const r=s.getContainableTypes(l.componentId);let u;return r.length<=Oe&&(u=`You can add ${b(r,"and")} components`),u});return(r,u)=>(k(),Q(_e,{class:"ChildlessPlaceholder","component-id":C.componentId,message:c.value},null,8,["component-id","message"]))}}),qe=["draggable"],Fe={class:"title"},He={class:"message"},je=K({__name:"RenderError",props:{componentType:{type:String,required:!0},message:{type:String,required:!0},draggable:{type:Boolean,required:!1}},setup(C){const s=M(p.core),l=M(p.componentId),b=v(()=>s.getComponentById(l)),c=v(()=>{var u;return s.getComponentById((u=b.value)==null?void 0:u.parentId)}),r=v(()=>{var u;return((u=c.value)==null?void 0:u.type)==="blueprints_blueprint"});return(u,m)=>r.value?(k(),Q(he,{key:0,draggable:!1})):(k(),W("div",{key:1,class:"RenderError",draggable:C.draggable},[_("div",Fe,[_("h2",null,"Error rendering "+A(C.componentType),1)]),_("div",He,A(C.message),1)],8,qe))}}),ze={props:{componentId:{type:String,required:!0},instancePath:{type:Array,required:!0},instanceData:{type:Array,required:!0}},setup(C){const s=M(p.core),l=M(p.builderManager),b=M(p.secretsManager),c=C.componentId,r=v(()=>s.getComponentById(c)),u=ye(r.value.type),m=C.instancePath,f=C.instanceData,{getEvaluatedFields:I,isComponentVisible:g}=ae(s,b),S=I(m),V=Ce(s),x=v(()=>s.getComponents(c,{sortedByPosition:!0}).filter(t=>{var a;return((a=s.getComponentDefinition(t.type))==null?void 0:a.category)!=="Internal"})),w=v(()=>!!l&&l.getMode()!="preview"),N=v(()=>{var t;return w.value&&!r.value.isCodeManaged&&!te.has(r.value.type)&&((t=U.value)==null?void 0:t.toolkit)!=="blueprints"}),q=(t,a)=>(t?s.getContainableTypes(t):[...te]).includes(a),L=R(!1),e=()=>{if(!(x.value.length>0))return D(We,{componentId:r.value.id})},n=(t,a=0,i)=>D(le,{componentId:t,key:`${t}:${a}`,instancePath:[...m,{componentId:t,instanceNumber:a}],instanceData:[...f,R(null)],...i??{}}),o=t=>a=>{if(!q(c,a.type)&&t==="default")return!0;const h=s.getComponentDefinition(a.type).slot??"default";return h==="*"||h===t},d=(t=0,a="default",i=()=>!0,h=!1)=>{const P=y=>!w.value||h?[]:[D("div",{"data-writer-slot-of-id":c,"data-writer-position":y})],E=x.value.filter(o(a)).filter(i),B=E.filter(y=>!y.isCodeManaged).map(y=>n(y.id,t,{contextSlot:a})),H=E.filter(y=>y.isCodeManaged).map(y=>n(y.id,t,{contextSlot:a}));return[...P(0),...B.map((y,j)=>[y,P(j+1)]).flat(),...H]},$=be(m);T(p.evaluatedFields,S),T(p.componentId,c),T(p.isBeingEdited,w),T(p.isDisabled,L),T(p.instancePath,m),T(p.instanceData,f),T(p.renderProxiedComponent,n),T(p.getChildrenVNodes,d),T(p.flattenedInstancePath,$);const F={"data-writer-id":c,"data-writer-instance-path":$},U=v(()=>s.getComponentDefinition(r.value.type)),Y=v(()=>{var t;return(t=U.value)==null?void 0:t.fields}),G=R(!1);z(()=>l==null?void 0:l.isComponentIdSelected(c),t=>{G.value=t},{immediate:!0});const ce=v(()=>Object.entries(Y.value??{}).filter(([,t])=>t.category===Se.Style).reduce((t,[a])=>(t[a]=S[a].value,t),{}));z(ce,()=>{G.value=!1,V.track("ui_block_styles_updated")});const ee=v(()=>x.value.length==0),de=v(()=>g(c,m)),ue=(t,a)=>{if((!t||!(t!=null&&t.startsWith("$goToPage_")))&&!a)return h=>{s.forwardEvent(h,m,!0)};if(t!=null&&t.startsWith("$goToPage_")){const h=t.substring(10);return P=>s.setActivePageFromKey(h)}return null},pe=v(()=>{const t={};return Object.keys(U.value.events??{}).forEach(i=>{var E;const h=`on${i.charAt(0).toUpperCase()}${i.slice(1)}`,P=i===((E=r.value.binding)==null?void 0:E.eventType);t[h]=B=>{var y,j;P&&s.forwardEvent(B,m,!0);const H=((y=r.value.handlers)==null?void 0:y[i])??null;(j=ue(H,P))==null||j(B)}}),t}),ve=v(()=>{const t=Y.value;if(!t)return;const a={};return Object.keys(t).forEach(i=>{t[i].applyStyleVariable&&S[i]&&(a[`--${i}`]=S[i].value)}),a}),me=v(()=>{const t="cssClasses",a=Y.value;if(!a||!a[t]||!S[t])return;const i=String(S[t].value),h=i==null?void 0:i.split(" ").map(E=>E.trim()),P={};return h.forEach(E=>{P[E]=!0}),P}),fe=function(){return{class:{[`wf-type-${r.value.type}`]:!0,component:!0,childless:ee.value,selected:G.value,disabled:L.value,beingEdited:w.value,...me.value},style:{...ve.value,...de.value?{}:{display:"none"}},...F,...L.value?[]:pe.value,draggable:N.value}},ge=(t,a)=>w.value?D(je,{...t,componentType:r.value.type,message:a}):D("div");return()=>{const t=w.value?e():void 0,a=({instanceNumber:h=0,slotName:P="default",componentFilter:E=()=>!0,positionlessSlot:B=!1})=>ee.value?B?void 0:t:d(h,P,E,B),i=fe();return q(r.value.parentId,r.value.type)?D(u,i,{default:a}):ge(i,"Parent is not suitable for this component")}}},le=Z(ze,[["__scopeId","data-v-683afb33"]]),Ke={class:"counter"},Ne={class:"main"},Ue={class:"clearContainer"},Ye={class:"content"},Ge={class:"title"},Xe={class:"time"},Je={class:"message"},Qe=100,Ze=K({__name:"RendererNotifications",setup(C){const s=M(p.core),l=R(!1),b=Ie("balloon"),c=Pe([]),r=f=>{const{type:I,title:g,message:S,code:V}=f;c.unshift({type:I,title:g,message:S,code:V,timestampReceived:new Date}),c.splice(Qe),b.value.classList.remove("alert"),b.value.offsetWidth,b.value.classList.add("alert")};re(()=>{s.addMailSubscription("notification",r)});const u=()=>{c.length!=0&&(l.value=!l.value)},m=()=>{c.splice(0),l.value=!1};return(f,I)=>ne((k(),W("div",{class:"RendererNotifications colorTransformer",onClick:u},[_("div",{ref_key:"balloon",ref:b,class:"balloon",title:"Toggle notifications"},[O(X,{name:"bell"}),_("div",Ke,A(c.length),1)],512),I[1]||(I[1]=_("div",{class:"balloonFlash"},null,-1)),ne(_("div",Ne,[_("div",Ue,[O(Te,{onClick:m},{default:Ee(()=>[O(X,{name:"trash-2"}),I[0]||(I[0]=Me(" Clear all "))]),_:1})]),(k(!0),W(we,null,$e(c,(g,S)=>(k(),W("div",{key:S,class:"notification"},[_("div",{class:ie(["icon",g.type])},[O(X,{name:"triangle-alert"})],2),_("div",Ye,[_("header",null,[_("strong",Ge,A(g.title),1),_("span",Xe,A(g.timestampReceived.toLocaleTimeString()),1)]),_("div",Je,A(g.message),1)])]))),128))],512),[[se,l.value]])],512)),[[se,c.length>0]])}}),et=Z(Ze,[["__scopeId","data-v-758218e7"]]),tt={class:"rootComponentArea"},nt=K({__name:"ComponentRenderer",setup(C){const s=M(p.core),l=M(p.builderManager),b=M(p.secretsManager),c=ae(s,b),r={},u=R({}),m=v(()=>(l==null?void 0:l.activeRootId.value)??"root");z(m,(e,n)=>{var d;u.value[n]=s.activePageId;const o=(d=u.value)==null?void 0:d[e];o&&s.setActivePageId(o)});const f=c.getEvaluatedFields([{componentId:"root",instanceNumber:0}]),I=v(()=>{var e,n,o,d,$,F;return{...ke,"--accentColor":(e=f.accentColor)==null?void 0:e.value,"--emptinessColor":(n=f.emptinessColor)==null?void 0:n.value,"--containerBackgroundColor":(o=f.parentIdBackgroundColor)==null?void 0:o.value,"--primaryTextColor":(d=f.primaryTextColor)==null?void 0:d.value,"--secondaryTextColor":($=f.secondaryTextColor)==null?void 0:$.value,"--separatorColor":(F=f.separatorColor)==null?void 0:F.value}}),g=v(()=>s.frontendMessageMap.value.size>0);z(()=>{var e;return(e=f.appName)==null?void 0:e.value},e=>{e!=""&&S(e)},{immediate:!0});function S(e){const n=s.mode.value;let o;e&&n=="edit"?o=`${e} | Writer | Builder`:!e&&n=="edit"?o="Writer | Builder":e&&n=="run"?o=`${e}`:!e&&n=="run"&&(o="Writer"),document.title=o}async function V(e,n){const o=document.querySelector(`[data-writer-stylesheet-key="${e}"]`);o==null||o.remove();const d=document.createElement("link");d.dataset.writerStylesheetKey=e,d.setAttribute("href",J(n)),d.setAttribute("rel","stylesheet"),document.head.appendChild(d)}async function x(e,n){const o=document.querySelector(`[data-writer-script-key="${e}"]`);o==null||o.remove();const d=document.createElement("script");d.dataset.writerScriptKey=e,d.src=J(n),d.setAttribute("rel","modulepreload"),document.head.appendChild(d)}async function w(e,n){const o=J(n);r[e]=o,await oe(()=>import(o),[],import.meta.url)}async function N(e,n,o){const d=r[e],$=await oe(()=>import(d),[],import.meta.url);if(!$){console.warn(`The module with key "${e}" cannot be found. Please check that it has been imported.`);return}$[n](...o)}function q(){s.addMailSubscription("fileDownload",e=>{const n=document.createElement("a");n.href=e.data,n.download=e.fileName,n.click()}),s.addMailSubscription("openUrl",e=>{const n=document.createElement("a");n.href=e,n.target="_blank",n.rel="noopener noreferrer",n.click()}),s.addMailSubscription("pageChange",async e=>{(l==null?void 0:l.getMode())==="blueprints"&&l.setMode("ui"),await Re(),Ve(e),s.setActivePageFromKey(e)}),s.addMailSubscription("routeVarsChange",e=>{xe(e)}),s.addMailSubscription("importStylesheet",({stylesheetKey:e,path:n})=>{V(e,n)}),s.addMailSubscription("importScript",({scriptKey:e,path:n})=>{x(e,n)}),s.addMailSubscription("importModule",({moduleKey:e,specifier:n})=>{w(e,n)}),s.addMailSubscription("functionCall",({moduleKey:e,functionName:n,args:o})=>{N(e,n,o)})}function L(){const e=Le(),n=new CustomEvent("wf-app-open",{detail:{payload:e}}),o={componentId:"root",instanceNumber:0};s.forwardEvent(n,[o],!0)}return Be(()=>{q()}),re(()=>{L()}),(e,n)=>(k(),W("main",{class:ie(["ComponentRenderer",{loadingActive:g.value}]),tabindex:"-1",style:Ae(I.value)},[O(et,{class:"notifications"}),n[0]||(n[0]=_("div",{class:"loadingBar"},null,-1)),_("div",tt,[(k(),Q(le,{key:m.value,"component-id":m.value,"instance-path":[{componentId:m.value,instanceNumber:0}],"instance-data":[R(null)]},null,8,["component-id","instance-path","instance-data"])),De(e.$slots,"default",{},void 0,!0)])],6))}}),ot=Z(nt,[["__scopeId","data-v-2e3a99be"]]);export{ot as default};
@@ -1 +1 @@
1
- import{d as x,a4 as k,c as p,r as B,m as f,aR as w,aZ as z,w as M,L as N,o as s,f as m,x as y,z as q,y as F,R as o,D as W,A as D,t as I,S as v,G as R,W as T,b as V,K as A,_ as O}from"./index-Bz7k91zI.js";import{a as _}from"./WdsDropdownMenu-1kTugbx4.js";import"./WdsCheckbox-DyaMkyjM.js";const E=x({__name:"SharedCopyClipboardButton",props:{label:{type:String,required:!1,default:""},value:{type:String,required:!1,default:""},text:{type:String,required:!1,default:""},variant:{type:String,default:"tertiary"},size:{type:String,default:"smallIcon"},iconName:{type:String,default:"clipboard"},options:{type:Array,required:!1,default:()=>[]}},setup(e){const l=e,{copy:r,copied:n,isSupported:g}=k(),a=p(()=>l.options.length===0),b=p(()=>{if(a.value)return n.value?"Copied to clipboard":l.label}),t=B(!1),i=f("trigger"),u=f("menu"),{floatingStyles:S}=w(i,u,{placement:"bottom-end"}),c=z(i);M(c,()=>{c.value||N().then(()=>{t.value=!1})},{immediate:!0});async function C(){if(a.value){r(l.value);return}t.value=!t.value}function h(d){r(d),t.value=!1}return(d,G)=>(s(),m("div",{ref_key:"trigger",ref:i,class:"SharedCopyClipboardButton"},[y(T,{variant:e.variant,size:e.size,class:R(["button",{copied:o(n)}]),disabled:!o(g),"aria-label":a.value?e.label||"Copy to clipboard":"Open options","aria-haspopup":a.value?void 0:"menu","aria-expanded":a.value?void 0:String(t.value),"data-writer-tooltip":b.value,"data-writer-tooltip-placement":"top","data-writer-unselectable":"true",onClick:C},{default:q(()=>[y(F,{name:o(n)?"check":e.iconName},null,8,["name"]),e.text?(s(),m(W,{key:0},[D(I(o(n)?"Copied":e.text),1)],64)):v("",!0)]),_:1},8,["variant","size","class","disabled","aria-label","aria-haspopup","aria-expanded","data-writer-tooltip"]),!a.value&&t.value?(s(),V(_,{key:0,ref_key:"menu",ref:u,class:"menu",options:e.options,style:A(o(S)),onSelect:h},null,8,["options","style"])):v("",!0)],512))}}),$=O(E,[["__scopeId","data-v-92570a7f"]]);export{$ as default};
1
+ import{d as x,a4 as k,c as p,r as B,m as f,aR as w,b0 as z,w as M,L as N,o as s,f as m,x as y,z as q,y as F,R as o,D as W,A as D,t as I,S as v,G as R,W as T,b as V,K as A,_ as O}from"./index-Tfvjt7wd.js";import{a as _}from"./WdsDropdownMenu-C1nXnj7Y.js";import"./WdsCheckbox-BYGFbKQr.js";const E=x({__name:"SharedCopyClipboardButton",props:{label:{type:String,required:!1,default:""},value:{type:String,required:!1,default:""},text:{type:String,required:!1,default:""},variant:{type:String,default:"tertiary"},size:{type:String,default:"smallIcon"},iconName:{type:String,default:"clipboard"},options:{type:Array,required:!1,default:()=>[]}},setup(e){const l=e,{copy:r,copied:n,isSupported:g}=k(),a=p(()=>l.options.length===0),b=p(()=>{if(a.value)return n.value?"Copied to clipboard":l.label}),t=B(!1),i=f("trigger"),u=f("menu"),{floatingStyles:S}=w(i,u,{placement:"bottom-end"}),c=z(i);M(c,()=>{c.value||N().then(()=>{t.value=!1})},{immediate:!0});async function C(){if(a.value){r(l.value);return}t.value=!t.value}function h(d){r(d),t.value=!1}return(d,G)=>(s(),m("div",{ref_key:"trigger",ref:i,class:"SharedCopyClipboardButton"},[y(T,{variant:e.variant,size:e.size,class:R(["button",{copied:o(n)}]),disabled:!o(g),"aria-label":a.value?e.label||"Copy to clipboard":"Open options","aria-haspopup":a.value?void 0:"menu","aria-expanded":a.value?void 0:String(t.value),"data-writer-tooltip":b.value,"data-writer-tooltip-placement":"top","data-writer-unselectable":"true",onClick:C},{default:q(()=>[y(F,{name:o(n)?"check":e.iconName},null,8,["name"]),e.text?(s(),m(W,{key:0},[D(I(o(n)?"Copied":e.text),1)],64)):v("",!0)]),_:1},8,["variant","size","class","disabled","aria-label","aria-haspopup","aria-expanded","data-writer-tooltip"]),!a.value&&t.value?(s(),V(_,{key:0,ref_key:"menu",ref:u,class:"menu",options:e.options,style:A(o(S)),onSelect:h},null,8,["options","style"])):v("",!0)],512))}}),j=O(E,[["__scopeId","data-v-92570a7f"]]);export{j as default};
@@ -1 +1 @@
1
- import{d as b,an as f,aU as k,ap as m,o as s,f as d,g as i,x,y as C,t as c,S as n,R as r,aq as u,G as _,_ as v}from"./index-Bz7k91zI.js";const y=["for"],p={class:"WdsCheckbox__checkbox"},W={key:0,class:"WdsCheckbox__label"},g={key:1,class:"WdsCheckbox__detail"},B=["id","checked","disabled","aria-invalid"],V=b({__name:"WdsCheckbox",props:f({label:{type:String,required:!1,default:void 0},detail:{type:String,required:!1,default:void 0},disabled:{type:Boolean,required:!1},invalid:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=k(),a=m(e,"modelValue");function h(o){a.value=o.target.checked}return(o,t)=>(s(),d("label",{for:r(l),class:_(["WdsCheckbox",{"WdsCheckbox--disabled":e.disabled,"WdsCheckbox--checked":a.value}]),onMousedown:t[0]||(t[0]=u(()=>{},["prevent"]))},[i("div",p,[x(C,{name:"check"})]),e.label?(s(),d("span",W,c(e.label),1)):n("",!0),e.detail?(s(),d("span",g,c(e.detail),1)):n("",!0),i("input",{id:r(l),type:"checkbox",checked:a.value,disabled:e.disabled,"aria-invalid":e.invalid,onChange:u(h,["stop"])},null,40,B)],42,y))}}),q=v(V,[["__scopeId","data-v-56650334"]]);export{q as W};
1
+ import{d as b,an as f,aW as k,ap as m,o as s,f as d,g as i,x,y as C,t as c,S as n,R as r,aq as u,G as _,_ as v}from"./index-Tfvjt7wd.js";const y=["for"],W={class:"WdsCheckbox__checkbox"},p={key:0,class:"WdsCheckbox__label"},g={key:1,class:"WdsCheckbox__detail"},B=["id","checked","disabled","aria-invalid"],V=b({__name:"WdsCheckbox",props:f({label:{type:String,required:!1,default:void 0},detail:{type:String,required:!1,default:void 0},disabled:{type:Boolean,required:!1},invalid:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=k(),a=m(e,"modelValue");function h(o){a.value=o.target.checked}return(o,t)=>(s(),d("label",{for:r(l),class:_(["WdsCheckbox",{"WdsCheckbox--disabled":e.disabled,"WdsCheckbox--checked":a.value}]),onMousedown:t[0]||(t[0]=u(()=>{},["prevent"]))},[i("div",W,[x(C,{name:"check"})]),e.label?(s(),d("span",p,c(e.label),1)):n("",!0),e.detail?(s(),d("span",g,c(e.detail),1)):n("",!0),i("input",{id:r(l),type:"checkbox",checked:a.value,disabled:e.disabled,"aria-invalid":e.invalid,onChange:u(h,["stop"])},null,40,B)],42,y))}}),q=v(V,[["__scopeId","data-v-56650334"]]);export{q as W};
@@ -1 +1 @@
1
- import{d as I,c as y,o as a,f as d,D as M,x as _,bi as V,G as W,K as $,y as D,S as u,g as m,t as p,b,J as S,_ as B,m as z,r as g,w as L,a8 as O,s as j,a6 as N,E as A,a1 as k,z as x,aq as T}from"./index-Bz7k91zI.js";import{W as U}from"./WdsCheckbox-DyaMkyjM.js";const F=["data-automation-key","disabled"],E={key:0,class:"WdsDropdownMenuItem__icon WdsDropdownMenuItem__icon--img"},R=["data-writer-tooltip"],G={key:0,class:"WdsDropdownMenuItem__label__shortcut"},J=["data-writer-tooltip"],K={key:2,class:"WdsDropdownMenuItem__action"},P=I({__name:"WdsDropdownMenuItem",props:{showCustomAction:{type:Boolean},selected:{type:Boolean,required:!1},option:{type:Object,required:!0},hideIcons:{type:Boolean,required:!1}},setup(e){const s=e,o=y(()=>{const n=[];return!s.hideIcons&&s.option.icon&&n.push("auto"),n.push("minmax(0, 1fr)"),(s.selected||s.showCustomAction)&&n.push("auto"),{"grid-template-columns":n.join(" ")}}),c=y(()=>{const n={};return s.option.iconColor&&(n.color=s.option.iconColor),s.option.iconBgColor&&(n["background-color"]=s.option.iconBgColor),Object.values(n).length>0?n:void 0});return(n,r)=>(a(),d("button",{class:W(["WdsDropdownMenuItem",{"WdsDropdownMenuItem--selected":e.selected,"WdsDropdownMenuItem--hideIcon":e.hideIcons,"WdsDropdownMenuItem--danger":e.option.variant==="danger"}]),style:$(o.value),"data-automation-key":e.option.value,disabled:e.option.disabled},[e.hideIcons?u("",!0):(a(),d(M,{key:0},[Array.isArray(e.option.icon)?(a(),d("div",E,[_(V,{urls:e.option.icon,"loader-max-width-px":18,"loader-max-height-px":18},null,8,["urls"])])):e.option.icon?(a(),d("div",{key:1,class:W(["WdsDropdownMenuItem__icon",{"WdsDropdownMenuItem__icon--iconColor":c.value}]),style:$(c.value)},[_(D,{name:e.option.icon},null,8,["name"])],6)):u("",!0)],64)),m("div",{class:"WdsDropdownMenuItem__label","data-writer-tooltip":e.option.label,"data-writer-tooltip-strategy":"overflow"},[m("span",null,p(e.option.label),1),e.option.shortcut?(a(),d("span",G,p(e.option.shortcut),1)):u("",!0)],8,R),e.option.detail?(a(),d("div",{key:1,class:"WdsDropdownMenuItem__detail","data-writer-tooltip":e.option.detail,"data-writer-tooltip-strategy":"overflow"},p(e.option.detail),9,J)):u("",!0),e.selected||e.showCustomAction?(a(),d("div",K,[e.selected?(a(),b(D,{key:0,name:"check"})):e.showCustomAction?S(n.$slots,"action",{key:1},void 0,!0):u("",!0)])):u("",!0)],14,F))}}),H=B(P,[["__scopeId","data-v-8fc4c139"]]),Q=I({__name:"SharedLazyLoader",setup(e){const s=z("container"),o=g(!1),c=g();function n(r){var v;(v=c.value)==null||v.disconnect();const h=new IntersectionObserver(w=>{w.some(f=>f.isIntersecting)&&(h.unobserve(r),o.value=!0)});h.observe(r),c.value=h}return L(s,()=>{if(!window.IntersectionObserver)return o.value=!0;s.value&&n(s.value)},{immediate:!0}),O(()=>{var r;return(r=c.value)==null?void 0:r.disconnect()}),(r,h)=>(a(),d("div",{ref_key:"container",ref:s,class:"SharedLazyLoader"},[o.value?S(r.$slots,"content",{key:0}):S(r.$slots,"spinner",{key:1})],512))}}),X={class:"WdsDropdownMenu"},Y={key:0,class:"WdsDropdownMenu__header"},Z={key:0,class:"WdsDropdownMenu__header__multiSelect"},ee={class:"WdsDropdownMenu__header__multiSelect__count"},te=["disabled"],oe={class:"WdsDropdownMenu__item__label"},ne={key:2,class:"WdsDropdownMenu__no-results"},ae={class:"WdsDropdownMenu__itemLazyLoader"},se=I({__name:"WdsDropdownMenu",props:{options:{type:Array,default:()=>[]},hideIcons:{type:Boolean,required:!1},enableSearch:{type:Boolean,required:!1},enableMultiSelection:{type:Boolean,required:!1},selected:{type:[Array,String],required:!1,default:()=>{}},loading:{type:Boolean,required:!1}},emits:{select:e=>typeof e=="string"||Array.isArray(e),search:e=>typeof e=="string"},setup(e,{emit:s}){const o=e,c=s,n=g(""),r=y(()=>`${(Array.isArray(o.selected)?o.selected:[o.selected]).filter(Boolean).length}/${o.options.length} selected`),h=y(()=>{if(!o.enableSearch)return o.options;const l=n.value.toLowerCase();return o.options.filter(i=>{var t;return i.label.toLowerCase().includes(l)||((t=i.detail)==null?void 0:t.toLowerCase().includes(l))})}),v=y(()=>o.enableSearch&&n.value.trim()!==""&&h.value.length===0&&!o.loading);function w(l){return Array.isArray(o.selected)?o.selected.includes(l):o.selected===l}const C=y(()=>new Set(o.options.map(l=>l.value)));function f(l){if(!o.enableMultiSelection)return c("select",l);const i=new Set(o.selected);i.has(l)?i.delete(l):i.add(l),c("select",[...i].filter(t=>C.value.has(t)))}return L(n,()=>c("search",n.value)),(l,i)=>(a(),d("div",X,[(e.enableSearch||e.enableMultiSelection)&&!e.loading?(a(),d("div",Y,[e.enableMultiSelection?(a(),d("div",Z,[m("div",ee,p(r.value),1),m("button",{class:"WdsDropdownMenu__header__multiSelect__clear",type:"button",onClick:i[0]||(i[0]=t=>l.$emit("select",[]))}," Clear all ")])):u("",!0),e.enableSearch?(a(),d("div",{key:1,class:W(["WdsDropdownMenu__header__search",{"WdsDropdownMenu__header__search--no-results":v.value}])},[_(D,{name:"search"}),j(m("input",{ref:"searchInput","onUpdate:modelValue":i[1]||(i[1]=t=>n.value=t),class:"WdsDropdownMenu__header__search__input",type:"text",placeholder:"Search",autocomplete:"off",disabled:e.loading},null,8,te),[[N,n.value]])],2)):u("",!0)])):u("",!0),e.loading?(a(),d(M,{key:1},A(6,t=>m("button",{key:t,class:"WdsDropdownMenu__item"},[e.enableMultiSelection||!e.hideIcons?(a(),b(k,{key:0,style:{width:"20px"}})):u("",!0),m("div",oe,[_(k)])])),64)):v.value?(a(),d("div",ne," No results ")):(a(!0),d(M,{key:3},A(h.value,t=>(a(),b(Q,{key:t.value},{spinner:x(()=>[m("div",ae,[_(k)])]),content:x(()=>[e.enableMultiSelection?(a(),b(U,{key:0,class:"WdsDropdownMenu__checkbox",checked:w(t.value),label:t.label,detail:t.detail,"data-automation-key":t.value,disabled:t.disabled,"model-value":w(t.value),"onUpdate:modelValue":q=>f(t.value)},null,8,["checked","label","detail","data-automation-key","disabled","model-value","onUpdate:modelValue"])):(a(),b(H,{key:1,option:t,"data-automation-key":t.value,selected:w(t.value),onClick:T(q=>f(t.value),["stop"])},null,8,["option","data-automation-key","selected","onClick"]))]),_:2},1024))),128))]))}}),le=B(se,[["__scopeId","data-v-9826426e"]]),re=Object.freeze(Object.defineProperty({__proto__:null,default:le},Symbol.toStringTag,{value:"Module"}));export{H as W,le as a,re as b};
1
+ import{d as I,c as y,o as a,f as d,D as M,x as _,bn as V,G as W,K as $,y as D,S as u,g as m,t as p,b,J as S,_ as B,m as z,r as g,w as L,a8 as O,s as j,a6 as N,E as A,a1 as k,z as x,aq as T}from"./index-Tfvjt7wd.js";import{W as U}from"./WdsCheckbox-BYGFbKQr.js";const F=["data-automation-key","disabled"],E={key:0,class:"WdsDropdownMenuItem__icon WdsDropdownMenuItem__icon--img"},R=["data-writer-tooltip"],G={key:0,class:"WdsDropdownMenuItem__label__shortcut"},J=["data-writer-tooltip"],K={key:2,class:"WdsDropdownMenuItem__action"},P=I({__name:"WdsDropdownMenuItem",props:{showCustomAction:{type:Boolean},selected:{type:Boolean,required:!1},option:{type:Object,required:!0},hideIcons:{type:Boolean,required:!1}},setup(e){const s=e,o=y(()=>{const n=[];return!s.hideIcons&&s.option.icon&&n.push("auto"),n.push("minmax(0, 1fr)"),(s.selected||s.showCustomAction)&&n.push("auto"),{"grid-template-columns":n.join(" ")}}),c=y(()=>{const n={};return s.option.iconColor&&(n.color=s.option.iconColor),s.option.iconBgColor&&(n["background-color"]=s.option.iconBgColor),Object.values(n).length>0?n:void 0});return(n,i)=>(a(),d("button",{class:W(["WdsDropdownMenuItem",{"WdsDropdownMenuItem--selected":e.selected,"WdsDropdownMenuItem--hideIcon":e.hideIcons,"WdsDropdownMenuItem--danger":e.option.variant==="danger"}]),style:$(o.value),"data-automation-key":e.option.value,disabled:e.option.disabled},[e.hideIcons?u("",!0):(a(),d(M,{key:0},[Array.isArray(e.option.icon)?(a(),d("div",E,[_(V,{urls:e.option.icon,"loader-max-width-px":18,"loader-max-height-px":18},null,8,["urls"])])):e.option.icon?(a(),d("div",{key:1,class:W(["WdsDropdownMenuItem__icon",{"WdsDropdownMenuItem__icon--iconColor":c.value}]),style:$(c.value)},[_(D,{name:e.option.icon},null,8,["name"])],6)):u("",!0)],64)),m("div",{class:"WdsDropdownMenuItem__label","data-writer-tooltip":e.option.label,"data-writer-tooltip-strategy":"overflow"},[m("span",null,p(e.option.label),1),e.option.shortcut?(a(),d("span",G,p(e.option.shortcut),1)):u("",!0)],8,R),e.option.detail?(a(),d("div",{key:1,class:"WdsDropdownMenuItem__detail","data-writer-tooltip":e.option.detail,"data-writer-tooltip-strategy":"overflow"},p(e.option.detail),9,J)):u("",!0),e.selected||e.showCustomAction?(a(),d("div",K,[e.selected?(a(),b(D,{key:0,name:"check"})):e.showCustomAction?S(n.$slots,"action",{key:1},void 0,!0):u("",!0)])):u("",!0)],14,F))}}),H=B(P,[["__scopeId","data-v-8fc4c139"]]),Q=I({__name:"SharedLazyLoader",setup(e){const s=z("container"),o=g(!1),c=g();function n(i){var v;(v=c.value)==null||v.disconnect();const h=new IntersectionObserver(w=>{w.some(f=>f.isIntersecting)&&(h.unobserve(i),o.value=!0)});h.observe(i),c.value=h}return L(s,()=>{if(!window.IntersectionObserver)return o.value=!0;s.value&&n(s.value)},{immediate:!0}),O(()=>{var i;return(i=c.value)==null?void 0:i.disconnect()}),(i,h)=>(a(),d("div",{ref_key:"container",ref:s,class:"SharedLazyLoader"},[o.value?S(i.$slots,"content",{key:0}):S(i.$slots,"spinner",{key:1})],512))}}),X={class:"WdsDropdownMenu"},Y={key:0,class:"WdsDropdownMenu__header"},Z={key:0,class:"WdsDropdownMenu__header__multiSelect"},ee={class:"WdsDropdownMenu__header__multiSelect__count"},te=["disabled"],oe={class:"WdsDropdownMenu__item__label"},ne={key:2,class:"WdsDropdownMenu__no-results"},ae={class:"WdsDropdownMenu__itemLazyLoader"},se=I({__name:"WdsDropdownMenu",props:{options:{type:Array,default:()=>[]},hideIcons:{type:Boolean,required:!1},enableSearch:{type:Boolean,required:!1},enableMultiSelection:{type:Boolean,required:!1},selected:{type:[Array,String],required:!1,default:()=>{}},loading:{type:Boolean,required:!1}},emits:{select:e=>typeof e=="string"||Array.isArray(e),search:e=>typeof e=="string"},setup(e,{emit:s}){const o=e,c=s,n=g(""),i=y(()=>`${(Array.isArray(o.selected)?o.selected:[o.selected]).filter(Boolean).length}/${o.options.length} selected`),h=y(()=>{if(!o.enableSearch)return o.options;const l=n.value.toLowerCase();return o.options.filter(r=>{var t;return r.label.toLowerCase().includes(l)||((t=r.detail)==null?void 0:t.toLowerCase().includes(l))})}),v=y(()=>o.enableSearch&&n.value.trim()!==""&&h.value.length===0&&!o.loading);function w(l){return Array.isArray(o.selected)?o.selected.includes(l):o.selected===l}const C=y(()=>new Set(o.options.map(l=>l.value)));function f(l){if(!o.enableMultiSelection)return c("select",l);const r=new Set(o.selected);r.has(l)?r.delete(l):r.add(l),c("select",[...r].filter(t=>C.value.has(t)))}return L(n,()=>c("search",n.value)),(l,r)=>(a(),d("div",X,[(e.enableSearch||e.enableMultiSelection)&&!e.loading?(a(),d("div",Y,[e.enableMultiSelection?(a(),d("div",Z,[m("div",ee,p(i.value),1),m("button",{class:"WdsDropdownMenu__header__multiSelect__clear",type:"button",onClick:r[0]||(r[0]=t=>l.$emit("select",[]))}," Clear all ")])):u("",!0),e.enableSearch?(a(),d("div",{key:1,class:W(["WdsDropdownMenu__header__search",{"WdsDropdownMenu__header__search--no-results":v.value}])},[_(D,{name:"search"}),j(m("input",{ref:"searchInput","onUpdate:modelValue":r[1]||(r[1]=t=>n.value=t),class:"WdsDropdownMenu__header__search__input",type:"text",placeholder:"Search",autocomplete:"off",disabled:e.loading},null,8,te),[[N,n.value]])],2)):u("",!0)])):u("",!0),e.loading?(a(),d(M,{key:1},A(6,t=>m("button",{key:t,class:"WdsDropdownMenu__item"},[e.enableMultiSelection||!e.hideIcons?(a(),b(k,{key:0,style:{width:"20px"}})):u("",!0),m("div",oe,[_(k)])])),64)):v.value?(a(),d("div",ne," No results ")):(a(!0),d(M,{key:3},A(h.value,t=>(a(),b(Q,{key:t.value},{spinner:x(()=>[m("div",ae,[_(k)])]),content:x(()=>[e.enableMultiSelection?(a(),b(U,{key:0,class:"WdsDropdownMenu__checkbox",checked:w(t.value),label:t.label,detail:t.detail,"data-automation-key":t.value,disabled:t.disabled,"model-value":w(t.value),"onUpdate:modelValue":q=>f(t.value)},null,8,["checked","label","detail","data-automation-key","disabled","model-value","onUpdate:modelValue"])):(a(),b(H,{key:1,option:t,"data-automation-key":t.value,selected:w(t.value),onClick:T(q=>f(t.value),["stop"])},null,8,["option","data-automation-key","selected","onClick"]))]),_:2},1024))),128))]))}}),le=B(se,[["__scopeId","data-v-9826426e"]]),ie=Object.freeze(Object.defineProperty({__proto__:null,default:le},Symbol.toStringTag,{value:"Module"}));export{H as W,le as a,ie as b};
@@ -0,0 +1 @@
1
+ import{d as x,an as k,ap as E,r as F,o as t,f as i,D as y,x as r,z as o,J as W,a3 as S,g as f,A as c,t as n,S as l,b as p,y as v,W as m,_ as q}from"./index-Tfvjt7wd.js";const C={class:"WdsFieldWrapper colorTransformer"},$={class:"temporaryMissingBar"},M={key:0,class:"WdsFieldWrapper__title"},z={key:0,class:"WdsFieldWrapper__title__label"},I={key:0,class:"WdsFieldWrapper__title__label__unit"},N={class:"WdsFieldWrapper__slot"},V={key:1,class:"WdsFieldWrapper__error"},_={key:2,class:"WdsFieldWrapper__hint"},A=x({__name:"WdsFieldWrapper",props:k({label:{type:String,required:!1,default:void 0},unit:{type:String,required:!1,default:void 0},hint:{type:String,required:!1,default:void 0},error:{type:String,required:!1,default:void 0},isExpansible:{type:Boolean,required:!1,default:!1},isBindingButtonShown:{type:Boolean,required:!1,default:!1},helpButton:{type:[String,Boolean],required:!1,default:void 0}},{isBindingEnabled:{type:Boolean,required:!1,default:!1},isBindingEnabledModifiers:{}}),emits:k({helpClick:()=>!0,expand:()=>!0,shrink:()=>!0},["update:isBindingEnabled"]),setup(e,{emit:g}){const s=E(e,"isBindingEnabled"),B=g,d=F(!1);function b(){B("expand"),d.value=!0}const h={desc:"OK",fn:()=>{d.value=!1,B("shrink")}};return(u,a)=>(t(),i("div",C,[d.value?(t(),i(y,{key:0},[r(S,{actions:[h],description:e.hint,title:e.label},{default:o(()=>[W(u.$slots,"default",{},void 0,!0)]),_:3},8,["actions","description","title"]),f("div",$,[a[2]||(a[2]=c(" Field ")),f("strong",null,n(e.label),1),a[3]||(a[3]=c(" is open in a new window. "))])],64)):(t(),i(y,{key:1},[!d.value&&(e.label||e.helpButton)?(t(),i("div",M,[e.label?(t(),i("label",z,[c(n(e.label),1),e.unit?(t(),i("span",I," : "+n(e.unit),1)):l("",!0)])):l("",!0),e.isExpansible?(t(),p(m,{key:1,variant:"neutral",size:"smallIcon","data-writer-tooltip":"Expand",onClick:b},{default:o(()=>[r(v,{name:"expand"})]),_:1})):l("",!0),e.helpButton?(t(),p(m,{key:2,variant:"neutral",size:"smallIcon","data-writer-tooltip":typeof e.helpButton=="string"?e.helpButton:void 0,onClick:a[0]||(a[0]=w=>u.$emit("helpClick"))},{default:o(()=>[r(v,{name:"circle-question-mark"})]),_:1},8,["data-writer-tooltip"])):l("",!0),e.isBindingButtonShown?(t(),p(m,{key:3,variant:"neutral",size:"smallIcon","data-writer-tooltip-placement":"left","data-writer-tooltip":s.value?"Unbind from variable":"Bind to a variable",onClick:a[1]||(a[1]=w=>s.value=!s.value)},{default:o(()=>[r(v,{name:s.value?"wds-at-sign-slash":"at-sign"},null,8,["name"])]),_:1},8,["data-writer-tooltip"])):l("",!0)])):l("",!0),f("div",N,[W(u.$slots,"default",{},void 0,!0)]),e.error?(t(),i("p",V,n(e.error),1)):l("",!0),e.hint?(t(),i("p",_,n(e.hint),1)):l("",!0)],64))]))}}),O=q(A,[["__scopeId","data-v-15f0885c"]]);export{O as W};
@@ -1 +1 @@
1
- import{d as n,c as u,o as s,f as d,J as v,S as b,G as r,_ as o,an as m,ap as p,D as T,E as W,b as f,z as y,A as k,t as g}from"./index-Bz7k91zI.js";const h=["disabled","data-writer-tooltip"],C={key:0,class:"WdsTab__indicator"},S=n({__name:"WdsTab",props:{disabled:{type:[Boolean,String],default:void 0},selected:{type:Boolean},variant:{type:String,required:!0}},emits:{click:()=>!0},setup(e){const t=e,l=u(()=>typeof t.disabled=="string"?t.disabled:void 0);return(i,a)=>(s(),d("button",{class:r(["WdsTab",{"WdsTab--disabled":e.disabled,"WdsTab--selected":e.selected,"WdsTab--variant-bar":e.variant==="bar","WdsTab--variant-chip":e.variant==="chip"}]),type:"button",disabled:!!e.disabled,"data-writer-tooltip":l.value,onClick:a[0]||(a[0]=c=>i.$emit("click"))},[v(i.$slots,"default",{},void 0,!0),e.variant==="bar"?(s(),d("div",C)):b("",!0)],10,h))}}),B=o(S,[["__scopeId","data-v-db73c62c"]]),V=n({__name:"WdsTabs",props:m({tabs:{type:Array,required:!0},variant:{type:String,default:"chip"}},{modelValue:{type:String},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=p(e,"modelValue");return(l,i)=>(s(),d("div",{class:r(["WdsTabs",{"WdsTabs--variant-bar":e.variant==="bar","WdsTabs--variant-chip":e.variant==="chip"}])},[(s(!0),d(T,null,W(e.tabs,a=>(s(),f(B,{key:a.value,value:a.value,variant:e.variant,disabled:a.disabled,selected:a.value===t.value,onClick:c=>t.value=a.value},{default:y(()=>[k(g(a.label),1)]),_:2},1032,["value","variant","disabled","selected","onClick"]))),128))],2))}}),x=o(V,[["__scopeId","data-v-6e6e5572"]]);export{x as W};
1
+ import{d as n,c as u,o as s,f as d,J as v,S as b,G as r,_ as o,an as m,ap as p,D as T,E as W,b as f,z as y,A as k,t as g}from"./index-Tfvjt7wd.js";const h=["disabled","data-writer-tooltip"],C={key:0,class:"WdsTab__indicator"},S=n({__name:"WdsTab",props:{disabled:{type:[Boolean,String],default:void 0},selected:{type:Boolean},variant:{type:String,required:!0}},emits:{click:()=>!0},setup(e){const t=e,l=u(()=>typeof t.disabled=="string"?t.disabled:void 0);return(i,a)=>(s(),d("button",{class:r(["WdsTab",{"WdsTab--disabled":e.disabled,"WdsTab--selected":e.selected,"WdsTab--variant-bar":e.variant==="bar","WdsTab--variant-chip":e.variant==="chip"}]),type:"button",disabled:!!e.disabled,"data-writer-tooltip":l.value,onClick:a[0]||(a[0]=c=>i.$emit("click"))},[v(i.$slots,"default",{},void 0,!0),e.variant==="bar"?(s(),d("div",C)):b("",!0)],10,h))}}),B=o(S,[["__scopeId","data-v-db73c62c"]]),V=n({__name:"WdsTabs",props:m({tabs:{type:Array,required:!0},variant:{type:String,default:"chip"}},{modelValue:{type:String},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=p(e,"modelValue");return(l,i)=>(s(),d("div",{class:r(["WdsTabs",{"WdsTabs--variant-bar":e.variant==="bar","WdsTabs--variant-chip":e.variant==="chip"}])},[(s(!0),d(T,null,W(e.tabs,a=>(s(),f(B,{key:a.value,value:a.value,variant:e.variant,disabled:a.disabled,selected:a.value===t.value,onClick:c=>t.value=a.value},{default:y(()=>[k(g(a.label),1)]),_:2},1032,["value","variant","disabled","selected","onClick"]))),128))],2))}}),x=o(V,[["__scopeId","data-v-6e6e5572"]]);export{x as W};
@@ -1,4 +1,4 @@
1
- import{m as je}from"./BuilderEmbeddedCodeEditor-DG2PsuIn.js";import"./index-Bz7k91zI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as je}from"./BuilderEmbeddedCodeEditor-Bp4akO9H.js";import"./index-Tfvjt7wd.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as F}from"./BuilderEmbeddedCodeEditor-DG2PsuIn.js";import"./index-Bz7k91zI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as F}from"./BuilderEmbeddedCodeEditor-Bp4akO9H.js";import"./index-Tfvjt7wd.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as i}from"./BuilderEmbeddedCodeEditor-DG2PsuIn.js";import"./index-Bz7k91zI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as i}from"./BuilderEmbeddedCodeEditor-Bp4akO9H.js";import"./index-Tfvjt7wd.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as p}from"./BuilderEmbeddedCodeEditor-DG2PsuIn.js";import"./index-Bz7k91zI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as p}from"./BuilderEmbeddedCodeEditor-Bp4akO9H.js";import"./index-Tfvjt7wd.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as qe}from"./BuilderEmbeddedCodeEditor-DG2PsuIn.js";import"./index-Bz7k91zI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as qe}from"./BuilderEmbeddedCodeEditor-Bp4akO9H.js";import"./index-Tfvjt7wd.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
4
4
  * Released under the MIT license