From 99f88b62c574deb836b7b53a25c8e383fccfa8f8 Mon Sep 17 00:00:00 2001 From: Nick Strayer Date: Thu, 26 Oct 2023 10:48:40 -0400 Subject: [PATCH 1/7] Fix hard-to-read attempt at merging drop target styling and text description --- inst/editor/src/AppTour/index.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/inst/editor/src/AppTour/index.tsx b/inst/editor/src/AppTour/index.tsx index 492f03566..1fdc309ff 100644 --- a/inst/editor/src/AppTour/index.tsx +++ b/inst/editor/src/AppTour/index.tsx @@ -7,6 +7,7 @@ import PngIcon from "../components/Icons"; import Button from "../components/Inputs/Button/Button"; import styles from "../DragAndDropHelpers/DropWatcherPanel.module.css"; import { useMetaData } from "../state/metaData"; +import { mergeClasses } from "../utils/mergeClasses"; export function AppTour() { const [stepIndex, setStepIndex] = React.useState(0); @@ -82,13 +83,19 @@ export function AppTour() {

In the app view, the areas available for the element to be dropped - in will pulse with an{" "} + in will pulse orange:{" "} + .

), From b55adf7f7b9c6d542302a721d7c0986826cb70ed Mon Sep 17 00:00:00 2001 From: nstrayer Date: Thu, 26 Oct 2023 14:53:03 +0000 Subject: [PATCH 2/7] Commit build assets --- .../{index-11db4393.js => index-cdb60eed.js} | 4 ++-- inst/editor/build/index.html | 2 +- .../vscode-extension/shinyuieditor-0.5.1.vsix | Bin 7212220 -> 7212220 bytes 3 files changed, 3 insertions(+), 3 deletions(-) rename inst/editor/build/assets/{index-11db4393.js => index-cdb60eed.js} (98%) diff --git a/inst/editor/build/assets/index-11db4393.js b/inst/editor/build/assets/index-cdb60eed.js similarity index 98% rename from inst/editor/build/assets/index-11db4393.js rename to inst/editor/build/assets/index-cdb60eed.js index abb873d99..a2bbf01a9 100644 --- a/inst/editor/build/assets/index-11db4393.js +++ b/inst/editor/build/assets/index-cdb60eed.js @@ -161,7 +161,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho Plugins prop is no longer supported. Instead, mount it with "Sortable.mount(new MultiDrag())" Please read the updated README.md at https://github.com/SortableJS/react-sortablejs. - `)}componentDidMount(){if(this.ref.current===null)return;const vA=this.makeOptions();nA(rA).create(this.ref.current,vA)}componentDidUpdate(vA){vA.disabled!==this.props.disabled&&this.sortable&&this.sortable.option("disabled",this.props.disabled)}render(){const{tag:vA,style:CA,className:xA,id:IA}=this.props,OA={style:CA,className:xA,id:IA},PA=!vA||vA===null?"div":vA;return(0,AA.createElement)(PA,{ref:this.ref,...OA},this.getChildren())}getChildren(){const{children:vA,dataIdAttr:CA,selectedClass:xA="sortable-selected",chosenClass:IA="sortable-chosen",dragClass:OA="sortable-drag",fallbackClass:PA="sortable-falback",ghostClass:$A="sortable-ghost",swapClass:jA="sortable-swap-highlight",filter:MA="sortable-filter",list:RA}=this.props;if(!vA||vA==null)return null;const HA=CA||"data-id";return AA.Children.map(vA,(DA,kA)=>{if(DA===void 0)return;const _A=RA[kA]||{},{className:mA}=DA.props,bA=typeof MA=="string"&&{[MA.replace(".","")]:!!_A.filtered},FA=nA(tA)(mA,{[xA]:_A.selected,[IA]:_A.chosen,...bA});return(0,AA.cloneElement)(DA,{[HA]:DA.key,className:FA})})}get sortable(){const vA=this.ref.current;if(vA===null)return null;const CA=Object.keys(vA).find(xA=>xA.includes("Sortable"));return CA?vA[CA]:null}makeOptions(){const vA=["onAdd","onChoose","onDeselect","onEnd","onRemove","onSelect","onSpill","onStart","onUnchoose","onUpdate"],CA=["onChange","onClone","onFilter","onSort"],xA=EA(this.props);return vA.forEach(OA=>xA[OA]=this.prepareOnHandlerPropAndDOM(OA)),CA.forEach(OA=>xA[OA]=this.prepareOnHandlerProp(OA)),{...xA,onMove:(OA,PA)=>{const{onMove:$A}=this.props,jA=OA.willInsertAfter||-1;if(!$A)return jA;const MA=$A(OA,PA,this.sortable,QA);return typeof MA>"u"?!1:MA}}}prepareOnHandlerPropAndDOM(vA){return CA=>{this.callOnHandlerProp(CA,vA),this[vA](CA)}}prepareOnHandlerProp(vA){return CA=>{this.callOnHandlerProp(CA,vA)}}callOnHandlerProp(vA,CA){const xA=this.props[CA];xA&&xA(vA,this.sortable,QA)}onAdd(vA){const{list:CA,setList:xA,clone:IA}=this.props,OA=[...QA.dragging.props.list],PA=pA(vA,OA);sA(PA);const $A=fA(PA,CA,vA,IA).map(jA=>Object.assign(jA,{selected:!1}));xA($A,this.sortable,QA)}onRemove(vA){const{list:CA,setList:xA}=this.props,IA=wA(vA),OA=pA(vA,CA);cA(OA);let PA=[...CA];if(vA.pullMode!=="clone")PA=gA(OA,PA);else{let $A=OA;switch(IA){case"multidrag":$A=OA.map((jA,MA)=>({...jA,element:vA.clones[MA]}));break;case"normal":$A=OA.map(jA=>({...jA,element:vA.clone}));break;case"swap":default:nA(eA)(!0,`mode "${IA}" cannot clone. Please remove "props.clone" from when using the "${IA}" plugin`)}sA($A),OA.forEach(jA=>{const MA=jA.oldIndex,RA=this.props.clone(jA.item,vA);PA.splice(MA,1,RA)})}PA=PA.map($A=>Object.assign($A,{selected:!1})),xA(PA,this.sortable,QA)}onUpdate(vA){const{list:CA,setList:xA}=this.props,IA=pA(vA,CA);sA(IA),cA(IA);const OA=uA(IA,CA);return xA(OA,this.sortable,QA)}onStart(){QA.dragging=this}onEnd(){QA.dragging=null}onChoose(vA){const{list:CA,setList:xA}=this.props,IA=CA.map((OA,PA)=>{let $A=OA;return PA===vA.oldIndex&&($A=Object.assign(OA,{chosen:!0})),$A});xA(IA,this.sortable,QA)}onUnchoose(vA){const{list:CA,setList:xA}=this.props,IA=CA.map((OA,PA)=>{let $A=OA;return PA===vA.oldIndex&&($A=Object.assign($A,{chosen:!1})),$A});xA(IA,this.sortable,QA)}onSpill(vA){const{removeOnSpill:CA,revertOnSpill:xA}=this.props;CA&&!xA&&lA(vA.item)}onSelect(vA){const{list:CA,setList:xA}=this.props,IA=CA.map(OA=>Object.assign(OA,{selected:!1}));vA.newIndicies.forEach(OA=>{const PA=OA.index;if(PA===-1){console.log(`"${vA.type}" had indice of "${OA.index}", which is probably -1 and doesn't usually happen here.`),console.log(vA);return}IA[PA].selected=!0}),xA(IA,this.sortable,QA)}onDeselect(vA){const{list:CA,setList:xA}=this.props,IA=CA.map(OA=>Object.assign(OA,{selected:!1}));vA.newIndicies.forEach(OA=>{const PA=OA.index;PA!==-1&&(IA[PA].selected=!0)}),xA(IA,this.sortable,QA)}}gt(dA,"defaultProps",{clone:vA=>vA});var yA={};iA($.exports,yA)})(dist);var distExports=dist.exports;const accentBarStyles={warning:"bg-warning",error:"bg-danger",success:"bg-success",info:"bg-rstudio-blue"};function ControlledPopup({isOpen:$,onClose:rA,children:tA,content:AA,accent:eA,description:nA,...oA}){return jsxs(Tooltip,{open:$,onOpenChange:()=>rA(),...oA,children:[jsx(TooltipTrigger,{asChild:!0,noToggle:!0,children:tA}),jsx(TooltipContent,{children:jsxs("div",{className:mergeClasses("p-2 rounded-standard bg-rstudio-white w-64 relative"),"aria-label":nA,children:[eA&&jsx("div",{className:mergeClasses("absolute -left-2 -top-2 -bottom-2 w-[6px]",accentBarStyles[eA])}),AA]})})]})}function swapKeysForObject($,rA,tA){const AA=Object.entries($),eA=AA.findIndex(([nA])=>nA===rA);return AA[eA][0]=tA,AA.reduce((nA,[oA,iA])=>(nA[oA]=iA,nA),{})}function namedListToItemTypeArray($){return Array.isArray($)?$.map((rA,tA)=>({id:tA,key:rA,value:rA})):Object.keys($).map((rA,tA)=>({id:tA,key:rA,value:$[rA]}))}function getKeyValueMismatches($){const rA=Object.entries($).filter(([tA,AA])=>typeof AA=="string"&&tA!==AA).map(([tA,AA],eA)=>({key:tA,value:AA,id:eA}));return rA.length===0?null:rA}function isValueOnlyMode($){return Array.isArray($)}function useListState({value:$,onChange:rA,newItemValue:tA}){const[AA,eA]=React.useState(null),nA=isValueOnlyMode($)?"value-only":"key-value",oA=React.useCallback(gA=>{if(isValueOnlyMode($)){const wA=[...$];wA.splice(gA,1),rA(wA);return}const fA={...$};delete fA[Object.keys(fA)[gA]],rA(fA)},[rA,$]),iA=React.useCallback(()=>{const gA=isValueOnlyMode($)?$.length:Object.keys($).length,fA=typeof tA=="function"?tA(gA+1):tA;isValueOnlyMode($)?rA([...$,fA.value]):rA({...$,[fA.key]:fA.value})},[tA,rA,$]),lA=React.useCallback(gA=>{gA.length!==0&&rA(itemTypeArrayToNamedList(gA,nA))},[nA,rA]),aA=React.useCallback(({index:gA,newKey:fA})=>{if(isValueOnlyMode($))throw new Error("Cannot update key in value-only mode");const wA=Object.keys($)[gA];if(fA!==wA&&fA in $)throw new Error(`Key ${fA} already exists`);const BA=swapKeysForObject($,wA,fA);rA(BA)},[rA,$]),sA=React.useCallback(({index:gA,newValue:fA})=>{if(isValueOnlyMode($)){const EA=[...$];EA[gA]=fA,rA(EA);return}const wA={...$},BA=Object.keys($)[gA];wA[BA]=fA,rA(wA)},[rA,$]),cA=gA=>{if(gA){if(isValueOnlyMode($))throw new Error("Trying to simplify a value-only list");const fA=getKeyValueMismatches($);if(fA!==null){eA(fA);return}}pA(gA?"value-only":"key-value")},pA=React.useCallback(gA=>{const fA=isValueOnlyMode($);if(gA===(fA?"value-only":"key-value"))throw new Error("Trying to update to the same list mode");const wA=fA?$.reduce((BA,EA)=>(BA[EA]=EA,BA),{}):Object.values($);rA(wA),eA(null)},[rA,$]),uA=()=>{eA(null)};return{flatList:namedListToItemTypeArray($),reorderItems:lA,deleteItem:oA,addItem:iA,updateKey:aA,updateValue:sA,swapKeyValueMode:pA,listMode:nA,onValueModeToggle:cA,keyValueMismatches:AA,onCancelSimplify:uA}}function itemTypeArrayToNamedList($,rA){return rA==="value-only"?$.map(tA=>tA.value):$.reduce((tA,{key:AA,value:eA})=>(tA[AA]=eA,tA),{})}function NamedListInput({id:$,label:rA,value:tA,onChange:AA,newItemValue:eA=nA=>({key:"Value"+nA,value:"value"+nA})}){const{flatList:nA,addItem:oA,deleteItem:iA,reorderItems:lA,updateKey:aA,updateValue:sA,swapKeyValueMode:cA,listMode:pA,onValueModeToggle:uA,keyValueMismatches:gA,onCancelSimplify:fA}=useListState({value:tA,onChange:AA,newItemValue:eA}),[wA,BA]=React.useState(!1),EA=nA.length===0,QA=jsxs("div",{className:"w-fit flex flex-col items-center my-2","aria-labelledby":makeLabelId($),"aria-label":rA,children:[jsx(ListItem,{valueOnlyMode:pA==="value-only",className:"text-center -my-1","aria-label":"Columns field labels",children:pA==="value-only"?jsx("span",{className:"col-start-2",children:"Value"}):jsxs(Fragment,{children:[jsx("span",{className:"col-start-2",children:"Key"}),jsx("span",{className:"col-start-4",children:"Value"})]})}),jsx(distExports.ReactSortable,{list:nA,setList:lA,handle:".NamedListDragHandle",children:nA.map((yA,hA)=>jsxs(ListItem,{valueOnlyMode:pA==="value-only",className:mergeClasses("my-1",gA&&gA.find(vA=>vA.key===yA.key)?"bg-danger/30":null),"aria-label":"List item",children:[jsx("div",{className:"NamedListDragHandle grid place-items-center cursor-ns-resize",title:"Reorder list",children:jsx(MdDragHandle,{})}),pA==="value-only"?jsx("input",{title:"Value Field",className:"min-w-0",type:"text","aria-label":"List item value",value:yA.value,onChange:vA=>{sA({index:hA,newValue:vA.target.value})}}):jsxs(Fragment,{children:[jsx(KeyInput,{allElements:nA,index:hA,keyValue:yA.key,onUpdate:vA=>{aA({index:hA,newKey:vA})}}),jsx("span",{className:"mb-[1px]",children:":"}),jsx("input",{title:"Value Field",className:"min-w-0",type:"text","aria-label":"List item value",value:yA.value,onChange:vA=>{sA({index:hA,newValue:vA.target.value})}})]}),jsx(Button,{className:"grid place-content-center p-0 area[delete] hover:scale-110 mb-[2px]",onClick:()=>iA(yA.id),variant:["icon","transparent"],title:`Delete ${yA.value}`,children:jsx(SvgTrash,{})})]},hA))})]}),dA=gA!==null;return jsx(ControlledPopup,{isOpen:wA,onClose:()=>{BA(!1),fA()},description:`Settings panel for ${rA} argument`,placement:"right-start",accent:dA?"warning":"info",offset:{mainAxis:9,crossAxis:-23},content:jsxs(Fragment,{children:[jsxs("h2",{className:"bold text-base mb-3",children:["Settings for ",rA," argument"]}),jsxs("div",{className:"flex gap-2 justify-between items-center ",children:[jsx("label",{htmlFor:"keyAndValueModeCheckbox",children:"Keys and Value Mode"}),jsx("input",{className:"transform[translateY(1px)] border mt-[2px]",id:"keyAndValueModeCheckbox",type:"checkbox",checked:pA==="key-value",disabled:dA,onChange:yA=>{uA(!yA.target.checked)}})]}),jsx("span",{className:"text-xs text-gray-700 italic",children:"Should the list be displayed as just values or as key-value pairs? Key value pairs will allow you to choose a different display name for each value."}),dA&&jsxs(Fragment,{children:[jsx("hr",{}),jsxs("p",{children:["There are some"," ",jsx("span",{className:"bg-danger/30 px-1 py-[2px] rounded",children:"mismatches"})," ","between keys and values preventing simplification to value-only mode. Merge to just the values?"]}),jsxs("div",{className:"flex justify-around mt-2",children:[jsxs(Button,{onClick:()=>{cA("value-only"),fA()},children:[jsx(ArrowsCollapse$1,{className:"text-lg"})," Merge"]}),jsxs(Button,{onClick:fA,variant:"secondary",children:[" ",jsx(X$1,{className:"text-lg"}),"Cancel"]})]})]})]}),children:jsxs("div",{className:"relative",children:[jsx(Button,{className:"absolute right-0 bottom-100",variant:["icon","transparent"],onClick:()=>{BA(yA=>!yA),fA()},"aria-label":`Open settings for ${rA} argument`,children:jsx(Gear$1,{})}),EA?jsx("div",{className:"text-gray-500 text-xs bg-rstudio-white rounded italic w-full h-[23px] my-1 grid place-content-center ",children:"Empty list"}):QA,jsx(Button,{className:"text-icon -mt-1 p-1 bg-red-400 w-full",onClick:()=>oA(),variant:"transparent",title:"Add new item","aria-label":"Add new item to list",children:jsx(FaPlus,{})})]})})}function ListItem({valueOnlyMode:$,className:rA,...tA}){return jsx("div",{className:mergeClasses(rA,$?"grid-cols-[15px_1fr_15px]":"grid-cols-[15px_1fr_auto_1fr_15px]","w-100 grid ","gap-1 p-1 items-center rounded [&.sortable-chosen]:outline","[&.sortable-chosen]:outline-offset-[-2px] [&.sortable-chosen]:outline-rstudio-grey/30 [&.sortable-chosen]:shadow-lg"),...tA})}function KeyInput({keyValue:$,onUpdate:rA,allElements:tA,index:AA}){const[eA,nA]=React.useState($);React.useEffect(()=>{nA($)},[$]);const oA=tA.filter((sA,cA)=>cA!==AA).map(sA=>sA.key),iA=eA==="",lA=oA.includes(eA),aA=iA||lA;return jsx("span",{className:mergeClasses("block relative",lA&&'after:absolute after:content-["Duplicate_key"] after:block after:text-rstudio-white after:rounded after:min-w-fit after:p-1 after:border after:z-20 after:bg-danger/90'),children:jsx("input",{title:"Key Field",className:mergeClasses("min-w-0 w-full placeholder:text-rstudio-white placeholder:text-xs",aA&&"bg-danger/30 transition-colors duration-500 delay-300"),"aria-invalid":aA,"aria-label":"List item key",type:"text",value:eA,placeholder:lA?"Duplicate":"Required",onChange:sA=>{sA.stopPropagation();const cA=sA.target.value;nA(cA),!(cA===""||oA.some(uA=>uA.toLowerCase()===cA.toLowerCase()))&&rA(sA.target.value)}})})}const styles$d="",DEFAULT_DROPDOWN_CHOICE="__DEFAULT-DROPDOWN-CHOICE__";function DropdownSelect({id:$,label:rA,choices:tA,onChange:AA,value:eA}){React.useEffect(()=>{eA===DEFAULT_DROPDOWN_CHOICE&&AA(tA[0]),tA.length>0&&!tA.includes(eA)&&AA(tA[0])},[AA,tA,eA]);const nA=iA=>{const lA=iA.target.selectedIndex;AA(tA[lA])},oA=removeDuplicates(tA);return oA.length===0?jsx("select",{title:`${rA} selector`,"aria-labelledby":makeLabelId($),"aria-label":rA,className:"OptionsDropdown SUE-Input",placeholder:"No available options"}):jsx("select",{title:`${rA} selector`,"aria-labelledby":makeLabelId($),className:"OptionsDropdown SUE-Input",onChange:nA,value:eA,children:oA.map(iA=>jsx("option",{value:iA,children:iA},iA))})}function walkUiNode($,rA){function tA(AA){var oA;if(rA(AA)===!1)return;const nA=AA.namedArgs;for(const iA in nA){const lA=nA[iA];isShinyUiNode(lA)&&tA(lA)}isParentNode(AA)&&((oA=AA.children)==null||oA.forEach(tA))}tA($)}function getAllInputOutputIdsInApp($){const rA=[];return walkUiNode($,tA=>{const AA=tA.namedArgs,eA=AA.id||AA.outputId||AA.inputId;typeof eA=="string"&&rA.push(eA)}),rA}function useUpdateServerCode(){const $=useDispatch(),rA=useCurrentAppInfo(),tA=rA.mode==="MAIN"?rA.app.code:null;return React.useCallback(eA=>{if(tA===null)throw new Error("Tried to update server code when no app template");$(SET_APP_CODE_TEMPLATE(eA(tA)))},[tA,$])}function generateFullAppScript($){const{ui_tree:rA}=$;return generateUiScript({ui_tree:rA,language:$.language,...$.app})}function useCurrentServerNodes(){const $=useCurrentAppInfo(),rA=useTsParser(),[tA,AA]=React.useState(null);return React.useEffect(()=>{if($.mode!=="MAIN")return;const eA=generateFullAppScript($);rA(eA).then(nA=>{const oA=$.language==="R"?getRServerLocations(nA.server_node):getPythonServerLocations(nA.server_node);if(!oA)throw new Error("Could not parse app scripts");AA(oA)})},[$,rA]),tA}function updateServerWithNewId({oldId:$,newId:rA,positions:tA,appScript:AA,language:eA}){const nA=new RegExp(eA==="R"?`(input|output)(\\$)(${$})(\\W)`:`(input|output)(\\[)(${$})(\\])`,"g"),oA=AA.match(nA);if(oA===null)throw new Error(`No matches found for ${$} in app script`);if(tA&&oA.length!==tA.length)throw new Error(`Expected ${tA.length} matches for ${$} in app script but got ${oA==null?void 0:oA.length}`);return AA.replace(nA,`$1$2${rA}$4`)}function IdInput({id:$,label:rA,value:tA,onChange:AA,inputOrOutput:eA}){const nA=useCurrentAppInfo(),oA=useUpdateServerCode(),iA=useCurrentServerNodes(),[lA,aA]=React.useState(null),[sA,cA]=React.useState(tA),[pA,uA]=React.useState(null),gA=getLocationsInServerOfId(tA,iA),fA=gA!==null;if(React.useEffect(()=>{aA(fA?"synced":"unsynced")},[fA]),nA.mode!=="MAIN")return null;const{ui_tree:wA,language:BA}=nA,EA=getAllInputOutputIdsInApp(wA),QA=hA=>{const vA=EA.includes(hA)&&hA!==tA;if(hA=hA.replace(/ /g,"_"),cA(hA),vA){uA(`The id ${hA} is already taken`);return}if(hA===""){uA("ID cannot be empty");return}AA(hA),uA(null),lA==="synced"&&gA!==null&&oA(CA=>updateServerWithNewId({oldId:tA,newId:hA,positions:gA,appScript:CA,language:BA}))},dA=pA!==null,yA={className:"SUE-Input","aria-label":rA,"aria-labelledby":makeLabelId($),"aria-invalid":dA,autoComplete:"off",id:$,value:sA,onChange:hA=>{QA(hA.target.value)}};return jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx("input",{...yA,type:"text"}),fA&&jsxs(Tooltip,{placement:"right-start",children:[jsx(TooltipTrigger,{asChild:!0,children:jsxs("div",{className:"relative",children:[jsx(Link45deg$1,{className:mergeClasses("text-xl relative ",lA==="synced"?["text-rstudio-blue"]:["text-danger after:block after:absolute after:w-px after:bg-danger"]),onClick:()=>{aA(hA=>hA==="unsynced"?"synced":"unsynced")}}),lA==="unsynced"&&jsx("div",{className:"bg-danger/50 w-[2px] absolute left-[50%] top-1 bottom-1 pointer-events-none",style:{transform:"rotate(320deg)"}})]})}),jsxs(TooltipContent,{className:"max-w-xs",children:[jsx("p",{className:"my-1",children:lA==="synced"?"Changing ID will cause uses of this ID in server code to update.":"ID syncing is disabled. Changes to this ID will not be reflected in server code."}),jsxs("p",{className:"my-1",children:["Click to ",lA==="synced"?"disable":"enable"," ","syncing."]})]})]})]}),pA&&jsx("div",{className:"text-danger",children:jsx("small",{children:pA})})]})}function getLocationsInServerOfId($,rA){if(rA===null)return null;const{inputNodes:tA,outputNodes:AA}=rA;return tA.has($)?tA.get($).map(getNodePosition):AA.has($)?AA.get($).map(getNodePosition):null}const existingValuesContext=React.createContext({existingValues:new Set,warningMsg:$=>`The value ${$} is already taken`});function StringInput({id:$,label:rA,value:tA,onChange:AA,longform:eA}){const nA=React.useContext(existingValuesContext),oA=nA==null?void 0:nA.existingValues.has(tA),iA={className:"SUE-Input","aria-label":rA,"aria-labelledby":makeLabelId($),"aria-invalid":oA,id:$,value:tA,onChange:lA=>{const aA=lA.target.value;AA(aA)}};return jsxs(Fragment,{children:[eA?jsx("textarea",{...iA,className:"h-24 w-100 flex-grow"}):jsx("input",{...iA,type:"text"}),oA&&jsx("div",{className:"text-danger",children:jsx("small",{children:nA.warningMsg(tA)})})]})}function SettingsInputElement($){switch($.inputType){case"string":return jsx(StringInput,{...$});case"number":return jsx(NumberInput,{...$});case"cssMeasure":return jsx(CSSUnitInput,{...$});case"boolean":return jsx(BooleanInput,{...$});case"list":return jsx(NamedListInput,{...$});case"dropdown":return jsx(DropdownSelect,{...$});case"radio":return jsx(RadioInputs,{...$});case"id":return jsx(IdInput,{...$});default:return jsxs("div",{children:["I don't know how to render the input of type ",$.inputType," yet! Sorry."]})}}function valueIsType($,rA){if($===void 0)return!0;if(rA==="number")return typeof $=="number"||typeof $=="string"&&!isNaN(Number($));if(rA==="string"||rA==="id")return typeof $=="string";if(rA==="cssMeasure")return isCSSMeasure($);if(rA==="boolean")return typeof $=="boolean";if(rA==="list")return isNamedList($);if(rA==="dropdown"||rA==="radio")return typeof $=="string";if(rA==="string-array")return Array.isArray($)&&typeof $[0]=="string";if(rA==="ui-node")return isShinyUiNode($);if(rA==="omitted")return!0;throw new Error("Unimplemented argument type check",rA)}const SettingsInput$1="";function SettingsInput({onUpdate:$,...rA}){const tA=rA.value===void 0,AA=rA.optional,eA=makeLabelId(rA.name),nA=rA.label??rA.name,oA=()=>$({type:"UPDATE",value:rA.defaultValue}),iA=sA=>$({type:"UPDATE",value:sA}),lA=()=>$({type:"REMOVE"});let aA;return rA.value===void 0?rA.optional?aA=jsx(UnsetArgumentMessage,{labelledBy:eA}):aA=jsx(MissingRequiredArgumentMessage,{name:rA.name,onReset:oA}):valueIsType(rA.value,rA.inputType)?aA=jsx(SettingsInputElement,{label:nA,id:rA.name,onChange:iA,...rA}):aA=jsx(MismatchedTypeMessage,{name:rA.name,onReset:oA}),jsx(InputLabelWrapper,{argumentIsUnset:tA,className:rA.fill_space?"flex flex-col flex-grow":"",optionalField:AA?jsx("input",{type:"checkbox",checked:!tA,title:`Use ${rA.name} argument`,"aria-label":`Use ${rA.name} argument`,onChange:tA?oA:lA}):null,label:nA,labelId:eA,mainInput:aA})}function InputLabelWrapper({argumentIsUnset:$=!1,className:rA,optionalField:tA,label:AA,labelId:eA,mainInput:nA}){return jsxs("div",{className:mergeClasses("SUE-SettingsInput",rA),children:[jsxs("div",{className:"info","data-unset":$,children:[tA,jsx("label",{id:eA,children:AA})]}),nA]})}function MismatchedTypeMessage({name:$,onReset:rA}){return jsxs("div",{className:"mismatched-argument-types",children:["Argument for ",$," of unsupported type.",jsx(Button,{style:{padding:"0.25rem 0.5rem",marginInline:"0.25rem"},onClick:rA,children:"Reset"})]})}function MissingRequiredArgumentMessage({name:$,onReset:rA}){return jsxs("div",{className:"missing-required-argument-message",children:['Required argument "',$,'" not provided.',jsx(Button,{style:{padding:"0.25rem 0.5rem",marginInline:"0.25rem"},onClick:rA,children:"Reset"})]})}function UnsetArgumentMessage({labelledBy:$}){return jsx("input",{className:"unset-argument SUE-Input","aria-labelledby":$,placeholder:"Default",disabled:!0})}function cleanIconName($){let AA=$.split("-").map(eA=>eA.charAt(0).toUpperCase()+eA.slice(1)).join("");return/[0-9]/.test(AA.charAt(0))&&(AA="Icon"+AA),AA}const BsIcon=({icon_name:$,...rA})=>{let tA="icon_name";try{tA=cleanIconName($)}catch{return jsxs("span",{children:["Failed to find ",jsx("strong",{children:$})]})}if(!(tA in icons$1))return jsxs("span",{children:["Failed to find ",jsx("strong",{children:$})]});const AA=icons$1[tA];return jsx(AA,{...rA})},allBsIconNames=["0-circle-fill","0-circle","0-square-fill","0-square","1-circle-fill","1-circle","1-square-fill","1-square","123","2-circle-fill","2-circle","2-square-fill","2-square","3-circle-fill","3-circle","3-square-fill","3-square","4-circle-fill","4-circle","4-square-fill","4-square","5-circle-fill","5-circle","5-square-fill","5-square","6-circle-fill","6-circle","6-square-fill","6-square","7-circle-fill","7-circle","7-square-fill","7-square","8-circle-fill","8-circle","8-square-fill","8-square","9-circle-fill","9-circle","9-square-fill","9-square","activity","airplane-engines-fill","airplane-engines","airplane-fill","airplane","alarm-fill","alarm","alexa","align-bottom","align-center","align-end","align-middle","align-start","align-top","alipay","alt","amd","android","android2","app-indicator","app","apple","archive-fill","archive","arrow-90deg-down","arrow-90deg-left","arrow-90deg-right","arrow-90deg-up","arrow-bar-down","arrow-bar-left","arrow-bar-right","arrow-bar-up","arrow-clockwise","arrow-counterclockwise","arrow-down-circle-fill","arrow-down-circle","arrow-down-left-circle-fill","arrow-down-left-circle","arrow-down-left-square-fill","arrow-down-left-square","arrow-down-left","arrow-down-right-circle-fill","arrow-down-right-circle","arrow-down-right-square-fill","arrow-down-right-square","arrow-down-right","arrow-down-short","arrow-down-square-fill","arrow-down-square","arrow-down-up","arrow-down","arrow-left-circle-fill","arrow-left-circle","arrow-left-right","arrow-left-short","arrow-left-square-fill","arrow-left-square","arrow-left","arrow-repeat","arrow-return-left","arrow-return-right","arrow-right-circle-fill","arrow-right-circle","arrow-right-short","arrow-right-square-fill","arrow-right-square","arrow-right","arrow-through-heart-fill","arrow-through-heart","arrow-up-circle-fill","arrow-up-circle","arrow-up-left-circle-fill","arrow-up-left-circle","arrow-up-left-square-fill","arrow-up-left-square","arrow-up-left","arrow-up-right-circle-fill","arrow-up-right-circle","arrow-up-right-square-fill","arrow-up-right-square","arrow-up-right","arrow-up-short","arrow-up-square-fill","arrow-up-square","arrow-up","arrows-angle-contract","arrows-angle-expand","arrows-collapse","arrows-expand","arrows-fullscreen","arrows-move","aspect-ratio-fill","aspect-ratio","asterisk","at","award-fill","award","back","backspace-fill","backspace-reverse-fill","backspace-reverse","backspace","badge-3d-fill","badge-3d","badge-4k-fill","badge-4k","badge-8k-fill","badge-8k","badge-ad-fill","badge-ad","badge-ar-fill","badge-ar","badge-cc-fill","badge-cc","badge-hd-fill","badge-hd","badge-sd-fill","badge-sd","badge-tm-fill","badge-tm","badge-vo-fill","badge-vo","badge-vr-fill","badge-vr","badge-wc-fill","badge-wc","bag-check-fill","bag-check","bag-dash-fill","bag-dash","bag-fill","bag-heart-fill","bag-heart","bag-plus-fill","bag-plus","bag-x-fill","bag-x","bag","balloon-fill","balloon-heart-fill","balloon-heart","balloon","bandaid-fill","bandaid","bank","bank2","bar-chart-fill","bar-chart-line-fill","bar-chart-line","bar-chart-steps","bar-chart","basket-fill","basket","basket2-fill","basket2","basket3-fill","basket3","battery-charging","battery-full","battery-half","battery","behance","bell-fill","bell-slash-fill","bell-slash","bell","bezier","bezier2","bicycle","binoculars-fill","binoculars","blockquote-left","blockquote-right","bluetooth","body-text","book-fill","book-half","book","bookmark-check-fill","bookmark-check","bookmark-dash-fill","bookmark-dash","bookmark-fill","bookmark-heart-fill","bookmark-heart","bookmark-plus-fill","bookmark-plus","bookmark-star-fill","bookmark-star","bookmark-x-fill","bookmark-x","bookmark","bookmarks-fill","bookmarks","bookshelf","boombox-fill","boombox","bootstrap-fill","bootstrap-reboot","bootstrap","border-all","border-bottom","border-center","border-inner","border-left","border-middle","border-outer","border-right","border-style","border-top","border-width","border","bounding-box-circles","bounding-box","box-arrow-down-left","box-arrow-down-right","box-arrow-down","box-arrow-in-down-left","box-arrow-in-down-right","box-arrow-in-down","box-arrow-in-left","box-arrow-in-right","box-arrow-in-up-left","box-arrow-in-up-right","box-arrow-in-up","box-arrow-left","box-arrow-right","box-arrow-up-left","box-arrow-up-right","box-arrow-up","box-fill","box-seam-fill","box-seam","box","box2-fill","box2-heart-fill","box2-heart","box2","boxes","braces-asterisk","braces","bricks","briefcase-fill","briefcase","brightness-alt-high-fill","brightness-alt-high","brightness-alt-low-fill","brightness-alt-low","brightness-high-fill","brightness-high","brightness-low-fill","brightness-low","broadcast-pin","broadcast","browser-chrome","browser-edge","browser-firefox","browser-safari","brush-fill","brush","bucket-fill","bucket","bug-fill","bug","building-add","building-check","building-dash","building-down","building-exclamation","building-fill-add","building-fill-check","building-fill-dash","building-fill-down","building-fill-exclamation","building-fill-gear","building-fill-lock","building-fill-slash","building-fill-up","building-fill-x","building-fill","building-gear","building-lock","building-slash","building-up","building-x","building","buildings-fill","buildings","bullseye","bus-front-fill","bus-front","c-circle-fill","c-circle","c-square-fill","c-square","calculator-fill","calculator","calendar-check-fill","calendar-check","calendar-date-fill","calendar-date","calendar-day-fill","calendar-day","calendar-event-fill","calendar-event","calendar-fill","calendar-heart-fill","calendar-heart","calendar-minus-fill","calendar-minus","calendar-month-fill","calendar-month","calendar-plus-fill","calendar-plus","calendar-range-fill","calendar-range","calendar-week-fill","calendar-week","calendar-x-fill","calendar-x","calendar","calendar2-check-fill","calendar2-check","calendar2-date-fill","calendar2-date","calendar2-day-fill","calendar2-day","calendar2-event-fill","calendar2-event","calendar2-fill","calendar2-heart-fill","calendar2-heart","calendar2-minus-fill","calendar2-minus","calendar2-month-fill","calendar2-month","calendar2-plus-fill","calendar2-plus","calendar2-range-fill","calendar2-range","calendar2-week-fill","calendar2-week","calendar2-x-fill","calendar2-x","calendar2","calendar3-event-fill","calendar3-event","calendar3-fill","calendar3-range-fill","calendar3-range","calendar3-week-fill","calendar3-week","calendar3","calendar4-event","calendar4-range","calendar4-week","calendar4","camera-fill","camera-reels-fill","camera-reels","camera-video-fill","camera-video-off-fill","camera-video-off","camera-video","camera","camera2","capslock-fill","capslock","capsule-pill","capsule","car-front-fill","car-front","card-checklist","card-heading","card-image","card-list","card-text","caret-down-fill","caret-down-square-fill","caret-down-square","caret-down","caret-left-fill","caret-left-square-fill","caret-left-square","caret-left","caret-right-fill","caret-right-square-fill","caret-right-square","caret-right","caret-up-fill","caret-up-square-fill","caret-up-square","caret-up","cart-check-fill","cart-check","cart-dash-fill","cart-dash","cart-fill","cart-plus-fill","cart-plus","cart-x-fill","cart-x","cart","cart2","cart3","cart4","cash-coin","cash-stack","cash","cassette-fill","cassette","cast","cc-circle-fill","cc-circle","cc-square-fill","cc-square","chat-dots-fill","chat-dots","chat-fill","chat-heart-fill","chat-heart","chat-left-dots-fill","chat-left-dots","chat-left-fill","chat-left-heart-fill","chat-left-heart","chat-left-quote-fill","chat-left-quote","chat-left-text-fill","chat-left-text","chat-left","chat-quote-fill","chat-quote","chat-right-dots-fill","chat-right-dots","chat-right-fill","chat-right-heart-fill","chat-right-heart","chat-right-quote-fill","chat-right-quote","chat-right-text-fill","chat-right-text","chat-right","chat-square-dots-fill","chat-square-dots","chat-square-fill","chat-square-heart-fill","chat-square-heart","chat-square-quote-fill","chat-square-quote","chat-square-text-fill","chat-square-text","chat-square","chat-text-fill","chat-text","chat","check-all","check-circle-fill","check-circle","check-lg","check-square-fill","check-square","check","check2-all","check2-circle","check2-square","check2","chevron-bar-contract","chevron-bar-down","chevron-bar-expand","chevron-bar-left","chevron-bar-right","chevron-bar-up","chevron-compact-down","chevron-compact-left","chevron-compact-right","chevron-compact-up","chevron-contract","chevron-double-down","chevron-double-left","chevron-double-right","chevron-double-up","chevron-down","chevron-expand","chevron-left","chevron-right","chevron-up","circle-fill","circle-half","circle-square","circle","clipboard-check-fill","clipboard-check","clipboard-data-fill","clipboard-data","clipboard-fill","clipboard-heart-fill","clipboard-heart","clipboard-minus-fill","clipboard-minus","clipboard-plus-fill","clipboard-plus","clipboard-pulse","clipboard-x-fill","clipboard-x","clipboard","clipboard2-check-fill","clipboard2-check","clipboard2-data-fill","clipboard2-data","clipboard2-fill","clipboard2-heart-fill","clipboard2-heart","clipboard2-minus-fill","clipboard2-minus","clipboard2-plus-fill","clipboard2-plus","clipboard2-pulse-fill","clipboard2-pulse","clipboard2-x-fill","clipboard2-x","clipboard2","clock-fill","clock-history","clock","cloud-arrow-down-fill","cloud-arrow-down","cloud-arrow-up-fill","cloud-arrow-up","cloud-check-fill","cloud-check","cloud-download-fill","cloud-download","cloud-drizzle-fill","cloud-drizzle","cloud-fill","cloud-fog-fill","cloud-fog","cloud-fog2-fill","cloud-fog2","cloud-hail-fill","cloud-hail","cloud-haze-fill","cloud-haze","cloud-haze2-fill","cloud-haze2","cloud-lightning-fill","cloud-lightning-rain-fill","cloud-lightning-rain","cloud-lightning","cloud-minus-fill","cloud-minus","cloud-moon-fill","cloud-moon","cloud-plus-fill","cloud-plus","cloud-rain-fill","cloud-rain-heavy-fill","cloud-rain-heavy","cloud-rain","cloud-slash-fill","cloud-slash","cloud-sleet-fill","cloud-sleet","cloud-snow-fill","cloud-snow","cloud-sun-fill","cloud-sun","cloud-upload-fill","cloud-upload","cloud","clouds-fill","clouds","cloudy-fill","cloudy","code-slash","code-square","code","coin","collection-fill","collection-play-fill","collection-play","collection","columns-gap","columns","command","compass-fill","compass","cone-striped","cone","controller","cpu-fill","cpu","credit-card-2-back-fill","credit-card-2-back","credit-card-2-front-fill","credit-card-2-front","credit-card-fill","credit-card","crop","cup-fill","cup-hot-fill","cup-hot","cup-straw","cup","currency-bitcoin","currency-dollar","currency-euro","currency-exchange","currency-pound","currency-rupee","currency-yen","cursor-fill","cursor-text","cursor","dash-circle-dotted","dash-circle-fill","dash-circle","dash-lg","dash-square-dotted","dash-square-fill","dash-square","dash","database-add","database-check","database-dash","database-down","database-exclamation","database-fill-add","database-fill-check","database-fill-dash","database-fill-down","database-fill-exclamation","database-fill-gear","database-fill-lock","database-fill-slash","database-fill-up","database-fill-x","database-fill","database-gear","database-lock","database-slash","database-up","database-x","database","device-hdd-fill","device-hdd","device-ssd-fill","device-ssd","diagram-2-fill","diagram-2","diagram-3-fill","diagram-3","diamond-fill","diamond-half","diamond","dice-1-fill","dice-1","dice-2-fill","dice-2","dice-3-fill","dice-3","dice-4-fill","dice-4","dice-5-fill","dice-5","dice-6-fill","dice-6","disc-fill","disc","discord","display-fill","display","displayport-fill","displayport","distribute-horizontal","distribute-vertical","door-closed-fill","door-closed","door-open-fill","door-open","dot","download","dpad-fill","dpad","dribbble","dropbox","droplet-fill","droplet-half","droplet","ear-fill","ear","earbuds","easel-fill","easel","easel2-fill","easel2","easel3-fill","easel3","egg-fill","egg-fried","egg","eject-fill","eject","emoji-angry-fill","emoji-angry","emoji-dizzy-fill","emoji-dizzy","emoji-expressionless-fill","emoji-expressionless","emoji-frown-fill","emoji-frown","emoji-heart-eyes-fill","emoji-heart-eyes","emoji-kiss-fill","emoji-kiss","emoji-laughing-fill","emoji-laughing","emoji-neutral-fill","emoji-neutral","emoji-smile-fill","emoji-smile-upside-down-fill","emoji-smile-upside-down","emoji-smile","emoji-sunglasses-fill","emoji-sunglasses","emoji-wink-fill","emoji-wink","envelope-at-fill","envelope-at","envelope-check-fill","envelope-check","envelope-dash-fill","envelope-dash","envelope-exclamation-fill","envelope-exclamation","envelope-fill","envelope-heart-fill","envelope-heart","envelope-open-fill","envelope-open-heart-fill","envelope-open-heart","envelope-open","envelope-paper-fill","envelope-paper-heart-fill","envelope-paper-heart","envelope-paper","envelope-plus-fill","envelope-plus","envelope-slash-fill","envelope-slash","envelope-x-fill","envelope-x","envelope","eraser-fill","eraser","escape","ethernet","ev-front-fill","ev-front","ev-station-fill","ev-station","exclamation-circle-fill","exclamation-circle","exclamation-diamond-fill","exclamation-diamond","exclamation-lg","exclamation-octagon-fill","exclamation-octagon","exclamation-square-fill","exclamation-square","exclamation-triangle-fill","exclamation-triangle","exclamation","exclude","explicit-fill","explicit","eye-fill","eye-slash-fill","eye-slash","eye","eyedropper","eyeglasses","facebook","fan","fast-forward-btn-fill","fast-forward-btn","fast-forward-circle-fill","fast-forward-circle","fast-forward-fill","fast-forward","file-arrow-down-fill","file-arrow-down","file-arrow-up-fill","file-arrow-up","file-bar-graph-fill","file-bar-graph","file-binary-fill","file-binary","file-break-fill","file-break","file-check-fill","file-check","file-code-fill","file-code","file-diff-fill","file-diff","file-earmark-arrow-down-fill","file-earmark-arrow-down","file-earmark-arrow-up-fill","file-earmark-arrow-up","file-earmark-bar-graph-fill","file-earmark-bar-graph","file-earmark-binary-fill","file-earmark-binary","file-earmark-break-fill","file-earmark-break","file-earmark-check-fill","file-earmark-check","file-earmark-code-fill","file-earmark-code","file-earmark-diff-fill","file-earmark-diff","file-earmark-easel-fill","file-earmark-easel","file-earmark-excel-fill","file-earmark-excel","file-earmark-fill","file-earmark-font-fill","file-earmark-font","file-earmark-image-fill","file-earmark-image","file-earmark-lock-fill","file-earmark-lock","file-earmark-lock2-fill","file-earmark-lock2","file-earmark-medical-fill","file-earmark-medical","file-earmark-minus-fill","file-earmark-minus","file-earmark-music-fill","file-earmark-music","file-earmark-pdf-fill","file-earmark-pdf","file-earmark-person-fill","file-earmark-person","file-earmark-play-fill","file-earmark-play","file-earmark-plus-fill","file-earmark-plus","file-earmark-post-fill","file-earmark-post","file-earmark-ppt-fill","file-earmark-ppt","file-earmark-richtext-fill","file-earmark-richtext","file-earmark-ruled-fill","file-earmark-ruled","file-earmark-slides-fill","file-earmark-slides","file-earmark-spreadsheet-fill","file-earmark-spreadsheet","file-earmark-text-fill","file-earmark-text","file-earmark-word-fill","file-earmark-word","file-earmark-x-fill","file-earmark-x","file-earmark-zip-fill","file-earmark-zip","file-earmark","file-easel-fill","file-easel","file-excel-fill","file-excel","file-fill","file-font-fill","file-font","file-image-fill","file-image","file-lock-fill","file-lock","file-lock2-fill","file-lock2","file-medical-fill","file-medical","file-minus-fill","file-minus","file-music-fill","file-music","file-pdf-fill","file-pdf","file-person-fill","file-person","file-play-fill","file-play","file-plus-fill","file-plus","file-post-fill","file-post","file-ppt-fill","file-ppt","file-richtext-fill","file-richtext","file-ruled-fill","file-ruled","file-slides-fill","file-slides","file-spreadsheet-fill","file-spreadsheet","file-text-fill","file-text","file-word-fill","file-word","file-x-fill","file-x","file-zip-fill","file-zip","file","files-alt","files","filetype-aac","filetype-ai","filetype-bmp","filetype-cs","filetype-css","filetype-csv","filetype-doc","filetype-docx","filetype-exe","filetype-gif","filetype-heic","filetype-html","filetype-java","filetype-jpg","filetype-js","filetype-json","filetype-jsx","filetype-key","filetype-m4p","filetype-md","filetype-mdx","filetype-mov","filetype-mp3","filetype-mp4","filetype-otf","filetype-pdf","filetype-php","filetype-png","filetype-ppt","filetype-pptx","filetype-psd","filetype-py","filetype-raw","filetype-rb","filetype-sass","filetype-scss","filetype-sh","filetype-sql","filetype-svg","filetype-tiff","filetype-tsx","filetype-ttf","filetype-txt","filetype-wav","filetype-woff","filetype-xls","filetype-xlsx","filetype-xml","filetype-yml","film","filter-circle-fill","filter-circle","filter-left","filter-right","filter-square-fill","filter-square","filter","fingerprint","fire","flag-fill","flag","flower1","flower2","flower3","folder-check","folder-fill","folder-minus","folder-plus","folder-symlink-fill","folder-symlink","folder-x","folder","folder2-open","folder2","fonts","forward-fill","forward","front","fuel-pump-diesel-fill","fuel-pump-diesel","fuel-pump-fill","fuel-pump","fullscreen-exit","fullscreen","funnel-fill","funnel","gear-fill","gear-wide-connected","gear-wide","gear","gem","gender-ambiguous","gender-female","gender-male","gender-trans","geo-alt-fill","geo-alt","geo-fill","geo","gift-fill","gift","git","github","globe-americas","globe-asia-australia","globe-central-south-asia","globe-europe-africa","globe","globe2","google-play","google","gpu-card","graph-down-arrow","graph-down","graph-up-arrow","graph-up","grid-1x2-fill","grid-1x2","grid-3x2-gap-fill","grid-3x2-gap","grid-3x2","grid-3x3-gap-fill","grid-3x3-gap","grid-3x3","grid-fill","grid","grip-horizontal","grip-vertical","h-circle-fill","h-circle","h-square-fill","h-square","hammer","hand-index-fill","hand-index-thumb-fill","hand-index-thumb","hand-index","hand-thumbs-down-fill","hand-thumbs-down","hand-thumbs-up-fill","hand-thumbs-up","handbag-fill","handbag","hash","hdd-fill","hdd-network-fill","hdd-network","hdd-rack-fill","hdd-rack","hdd-stack-fill","hdd-stack","hdd","hdmi-fill","hdmi","headphones","headset-vr","headset","heart-arrow","heart-fill","heart-half","heart-pulse-fill","heart-pulse","heart","heartbreak-fill","heartbreak","hearts","heptagon-fill","heptagon-half","heptagon","hexagon-fill","hexagon-half","hexagon","hospital-fill","hospital","hourglass-bottom","hourglass-split","hourglass-top","hourglass","house-add-fill","house-add","house-check-fill","house-check","house-dash-fill","house-dash","house-door-fill","house-door","house-down-fill","house-down","house-exclamation-fill","house-exclamation","house-fill","house-gear-fill","house-gear","house-heart-fill","house-heart","house-lock-fill","house-lock","house-slash-fill","house-slash","house-up-fill","house-up","house-x-fill","house-x","house","houses-fill","houses","hr","hurricane","hypnotize","image-alt","image-fill","image","images","inbox-fill","inbox","inboxes-fill","inboxes","incognito","indent","infinity","info-circle-fill","info-circle","info-lg","info-square-fill","info-square","info","input-cursor-text","input-cursor","instagram","intersect","journal-album","journal-arrow-down","journal-arrow-up","journal-bookmark-fill","journal-bookmark","journal-check","journal-code","journal-medical","journal-minus","journal-plus","journal-richtext","journal-text","journal-x","journal","journals","joystick","justify-left","justify-right","justify","kanban-fill","kanban","key-fill","key","keyboard-fill","keyboard","ladder","lamp-fill","lamp","laptop-fill","laptop","layer-backward","layer-forward","layers-fill","layers-half","layers","layout-sidebar-inset-reverse","layout-sidebar-inset","layout-sidebar-reverse","layout-sidebar","layout-split","layout-text-sidebar-reverse","layout-text-sidebar","layout-text-window-reverse","layout-text-window","layout-three-columns","layout-wtf","life-preserver","lightbulb-fill","lightbulb-off-fill","lightbulb-off","lightbulb","lightning-charge-fill","lightning-charge","lightning-fill","lightning","line","link-45deg","link","linkedin","list-check","list-columns-reverse","list-columns","list-nested","list-ol","list-stars","list-task","list-ul","list","lock-fill","lock","lungs-fill","lungs","magic","magnet-fill","magnet","mailbox","mailbox2","map-fill","map","markdown-fill","markdown","mask","mastodon","medium","megaphone-fill","megaphone","memory","menu-app-fill","menu-app","menu-button-fill","menu-button-wide-fill","menu-button-wide","menu-button","menu-down","menu-up","messenger","meta","mic-fill","mic-mute-fill","mic-mute","mic","microsoft-teams","microsoft","minecart-loaded","minecart","modem-fill","modem","moisture","moon-fill","moon-stars-fill","moon-stars","moon","mortarboard-fill","mortarboard","motherboard-fill","motherboard","mouse-fill","mouse","mouse2-fill","mouse2","mouse3-fill","mouse3","music-note-beamed","music-note-list","music-note","music-player-fill","music-player","newspaper","nintendo-switch","node-minus-fill","node-minus","node-plus-fill","node-plus","nut-fill","nut","nvidia","octagon-fill","octagon-half","octagon","optical-audio-fill","optical-audio","option","outlet","p-circle-fill","p-circle","p-square-fill","p-square","paint-bucket","palette-fill","palette","palette2","paperclip","paragraph","pass-fill","pass","patch-check-fill","patch-check","patch-exclamation-fill","patch-exclamation","patch-minus-fill","patch-minus","patch-plus-fill","patch-plus","patch-question-fill","patch-question","pause-btn-fill","pause-btn","pause-circle-fill","pause-circle","pause-fill","pause","paypal","pc-display-horizontal","pc-display","pc-horizontal","pc","pci-card","peace-fill","peace","pen-fill","pen","pencil-fill","pencil-square","pencil","pentagon-fill","pentagon-half","pentagon","people-fill","people","percent","person-add","person-badge-fill","person-badge","person-bounding-box","person-check-fill","person-check","person-circle","person-dash-fill","person-dash","person-down","person-exclamation","person-fill-add","person-fill-check","person-fill-dash","person-fill-down","person-fill-exclamation","person-fill-gear","person-fill-lock","person-fill-slash","person-fill-up","person-fill-x","person-fill","person-gear","person-heart","person-hearts","person-lines-fill","person-lock","person-plus-fill","person-plus","person-rolodex","person-slash","person-square","person-up","person-vcard-fill","person-vcard","person-video","person-video2","person-video3","person-workspace","person-x-fill","person-x","person","phone-fill","phone-flip","phone-landscape-fill","phone-landscape","phone-vibrate-fill","phone-vibrate","phone","pie-chart-fill","pie-chart","piggy-bank-fill","piggy-bank","pin-angle-fill","pin-angle","pin-fill","pin-map-fill","pin-map","pin","pinterest","pip-fill","pip","play-btn-fill","play-btn","play-circle-fill","play-circle","play-fill","play","playstation","plug-fill","plug","plugin","plus-circle-dotted","plus-circle-fill","plus-circle","plus-lg","plus-slash-minus","plus-square-dotted","plus-square-fill","plus-square","plus","postage-fill","postage-heart-fill","postage-heart","postage","postcard-fill","postcard-heart-fill","postcard-heart","postcard","power","prescription","prescription2","printer-fill","printer","projector-fill","projector","puzzle-fill","puzzle","qr-code-scan","qr-code","question-circle-fill","question-circle","question-diamond-fill","question-diamond","question-lg","question-octagon-fill","question-octagon","question-square-fill","question-square","question","quora","quote","r-circle-fill","r-circle","r-square-fill","r-square","radioactive","rainbow","receipt-cutoff","receipt","reception-0","reception-1","reception-2","reception-3","reception-4","record-btn-fill","record-btn","record-circle-fill","record-circle","record-fill","record","record2-fill","record2","recycle","reddit","regex","repeat-1","repeat","reply-all-fill","reply-all","reply-fill","reply","rewind-btn-fill","rewind-btn","rewind-circle-fill","rewind-circle","rewind-fill","rewind","robot","rocket-fill","rocket-takeoff-fill","rocket-takeoff","rocket","router-fill","router","rss-fill","rss","rulers","safe-fill","safe","safe2-fill","safe2","save-fill","save","save2-fill","save2","scissors","scooter","screwdriver","sd-card-fill","sd-card","search-heart-fill","search-heart","search","segmented-nav","send-check-fill","send-check","send-dash-fill","send-dash","send-exclamation-fill","send-exclamation","send-fill","send-plus-fill","send-plus","send-slash-fill","send-slash","send-x-fill","send-x","send","server","share-fill","share","shield-check","shield-exclamation","shield-fill-check","shield-fill-exclamation","shield-fill-minus","shield-fill-plus","shield-fill-x","shield-fill","shield-lock-fill","shield-lock","shield-minus","shield-plus","shield-shaded","shield-slash-fill","shield-slash","shield-x","shield","shift-fill","shift","shop-window","shop","shuffle","sign-dead-end-fill","sign-dead-end","sign-do-not-enter-fill","sign-do-not-enter","sign-intersection-fill","sign-intersection-side-fill","sign-intersection-side","sign-intersection-t-fill","sign-intersection-t","sign-intersection-y-fill","sign-intersection-y","sign-intersection","sign-merge-left-fill","sign-merge-left","sign-merge-right-fill","sign-merge-right","sign-no-left-turn-fill","sign-no-left-turn","sign-no-parking-fill","sign-no-parking","sign-no-right-turn-fill","sign-no-right-turn","sign-railroad-fill","sign-railroad","sign-stop-fill","sign-stop-lights-fill","sign-stop-lights","sign-stop","sign-turn-left-fill","sign-turn-left","sign-turn-right-fill","sign-turn-right","sign-turn-slight-left-fill","sign-turn-slight-left","sign-turn-slight-right-fill","sign-turn-slight-right","sign-yield-fill","sign-yield","signal","signpost-2-fill","signpost-2","signpost-fill","signpost-split-fill","signpost-split","signpost","sim-fill","sim","sina-weibo","skip-backward-btn-fill","skip-backward-btn","skip-backward-circle-fill","skip-backward-circle","skip-backward-fill","skip-backward","skip-end-btn-fill","skip-end-btn","skip-end-circle-fill","skip-end-circle","skip-end-fill","skip-end","skip-forward-btn-fill","skip-forward-btn","skip-forward-circle-fill","skip-forward-circle","skip-forward-fill","skip-forward","skip-start-btn-fill","skip-start-btn","skip-start-circle-fill","skip-start-circle","skip-start-fill","skip-start","skype","slack","slash-circle-fill","slash-circle","slash-lg","slash-square-fill","slash-square","slash","sliders","sliders2-vertical","sliders2","smartwatch","snapchat","snow","snow2","snow3","sort-alpha-down-alt","sort-alpha-down","sort-alpha-up-alt","sort-alpha-up","sort-down-alt","sort-down","sort-numeric-down-alt","sort-numeric-down","sort-numeric-up-alt","sort-numeric-up","sort-up-alt","sort-up","soundwave","speaker-fill","speaker","speedometer","speedometer2","spellcheck","spotify","square-fill","square-half","square","stack-overflow","stack","star-fill","star-half","star","stars","steam","stickies-fill","stickies","sticky-fill","sticky","stop-btn-fill","stop-btn","stop-circle-fill","stop-circle","stop-fill","stop","stoplights-fill","stoplights","stopwatch-fill","stopwatch","strava","stripe","subscript","subtract","suit-club-fill","suit-club","suit-diamond-fill","suit-diamond","suit-heart-fill","suit-heart","suit-spade-fill","suit-spade","sun-fill","sun","sunglasses","sunrise-fill","sunrise","sunset-fill","sunset","superscript","symmetry-horizontal","symmetry-vertical","table","tablet-fill","tablet-landscape-fill","tablet-landscape","tablet","tag-fill","tag","tags-fill","tags","taxi-front-fill","taxi-front","telegram","telephone-fill","telephone-forward-fill","telephone-forward","telephone-inbound-fill","telephone-inbound","telephone-minus-fill","telephone-minus","telephone-outbound-fill","telephone-outbound","telephone-plus-fill","telephone-plus","telephone-x-fill","telephone-x","telephone","tencent-qq","terminal-dash","terminal-fill","terminal-plus","terminal-split","terminal-x","terminal","text-center","text-indent-left","text-indent-right","text-left","text-paragraph","text-right","text-wrap","textarea-resize","textarea-t","textarea","thermometer-half","thermometer-high","thermometer-low","thermometer-snow","thermometer-sun","thermometer","three-dots-vertical","three-dots","thunderbolt-fill","thunderbolt","ticket-detailed-fill","ticket-detailed","ticket-fill","ticket-perforated-fill","ticket-perforated","ticket","tiktok","toggle-off","toggle-on","toggle2-off","toggle2-on","toggles","toggles2","tools","tornado","train-freight-front-fill","train-freight-front","train-front-fill","train-front","train-lightrail-front-fill","train-lightrail-front","translate","trash-fill","trash","trash2-fill","trash2","trash3-fill","trash3","tree-fill","tree","trello","triangle-fill","triangle-half","triangle","trophy-fill","trophy","tropical-storm","truck-flatbed","truck-front-fill","truck-front","truck","tsunami","tv-fill","tv","twitch","twitter","type-bold","type-h1","type-h2","type-h3","type-italic","type-strikethrough","type-underline","type","ubuntu","ui-checks-grid","ui-checks","ui-radios-grid","ui-radios","umbrella-fill","umbrella","unindent","union","unity","universal-access-circle","universal-access","unlock-fill","unlock","upc-scan","upc","upload","usb-c-fill","usb-c","usb-drive-fill","usb-drive","usb-fill","usb-micro-fill","usb-micro","usb-mini-fill","usb-mini","usb-plug-fill","usb-plug","usb-symbol","usb","valentine","valentine2","vector-pen","view-list","view-stacked","vimeo","vinyl-fill","vinyl","virus","virus2","voicemail","volume-down-fill","volume-down","volume-mute-fill","volume-mute","volume-off-fill","volume-off","volume-up-fill","volume-up","vr","wallet-fill","wallet","wallet2","watch","water","webcam-fill","webcam","wechat","whatsapp","wifi-1","wifi-2","wifi-off","wifi","wikipedia","wind","window-dash","window-desktop","window-dock","window-fullscreen","window-plus","window-sidebar","window-split","window-stack","window-x","window","windows","wordpress","wrench-adjustable-circle-fill","wrench-adjustable-circle","wrench-adjustable","wrench","x-circle-fill","x-circle","x-diamond-fill","x-diamond","x-lg","x-octagon-fill","x-octagon","x-square-fill","x-square","x","xbox","yelp","yin-yang","youtube","zoom-in","zoom-out"];function IconSelector({initialValue:$,onIconSelect:rA}){const[tA,AA]=reactExports.useState(!1),[eA,nA]=reactExports.useState($),[oA,iA]=reactExports.useState(null),lA=reactExports.useRef([]),{x:aA,y:sA,strategy:cA,refs:pA,context:uA}=useFloating({whileElementsMounted:P$1,open:tA,onOpenChange:AA,placement:"bottom-start",middleware:[b$3({padding:10}),B$1({apply({availableHeight:CA,elements:xA}){Object.assign(xA.floating.style,{maxHeight:`${CA}px`})},padding:10})]}),gA=useRole(uA,{role:"listbox"}),fA=useDismiss(uA),wA=useListNavigation(uA,{listRef:lA,activeIndex:oA,onNavigate:iA,virtual:!0,loop:!0}),{getReferenceProps:BA,getFloatingProps:EA,getItemProps:QA}=useInteractions([gA,fA,wA]);function dA(CA){let xA=CA.target.value;xA=xA.replace(/\s+/g,"-"),AlphaNumericRegex.test(xA)&&nA(xA),xA?(AA(!0),iA(0)):AA(!1)}const yA=CA=>{nA(CA),AA(!1),rA(CA),iA(null)},hA=FilterIconsList(eA),vA=hA===null?null:hA[oA??0];return jsxs("div",{className:mergeClasses("flex items-center gap-2 pl-2"),children:[jsx(BsIcon,{icon_name:vA??"bootstrap",className:"w-4"}),jsx("input",{...BA({ref:pA.setReference,onChange:dA,value:eA,placeholder:"Search for icon...","aria-autocomplete":"list",className:"w-40",onKeyDown(CA){CA.key==="Enter"&&oA!=null&&hA&&hA[oA]&&yA(hA[oA])}})}),jsx(FloatingPortal,{children:tA&&jsx(FloatingFocusManager,{context:uA,initialFocus:-1,visuallyHiddenDismiss:!0,children:jsx("div",{...EA({ref:pA.setFloating,className:"z-10 flex flex-col w-40 max-h-96 overflow-auto rounded bg-white shadow-md",style:{position:cA,left:aA??0,top:sA??0}}),role:"listbox",children:hA?hA.map((CA,xA)=>jsx(IconResult,{...QA({ref(IA){lA.current[xA]=IA},onClick(){yA(CA)}}),active:oA===xA,icon:CA,divider:xA!==hA.length-1},CA)):jsx(IconResult,{icon:"EmojiFrown",active:!1,label:"No results"})})})})]})}const IconResult=reactExports.forwardRef(({icon:$,label:rA,active:tA,divider:AA,...eA},nA)=>{const oA=reactExports.useId();return jsxs(Fragment,{children:[jsxs("div",{ref:nA,role:"option",id:oA,className:mergeClasses("grid grid-cols-[20px_1fr] gap-1 cursor-pointer px-3 py-2 items-center","[&[aria-selected='true']]:bg-rstudio-blue [&[aria-selected='true']]:text-white"),"aria-selected":tA,"aria-label":$,...eA,children:[jsx(BsIcon,{icon_name:$}),jsx("span",{children:rA??$})]}),AA&&jsx(ListDivider,{})]})});function ListDivider(){return jsx("div",{className:"bg-light-grey h-[1px] text-transparent select-none",children:"divider"})}const AlphaNumericRegex=/^[A-Za-z0-9-]*$/;function FilterIconsList($){const rA=allBsIconNames.filter(tA=>tA.toLowerCase().startsWith($.toLowerCase()));return rA.length>0?rA:null}const ValueBox=({namedArgs:$,children:rA,path:tA,wrapperProps:AA})=>{const eA=$.showcase_layout==="right";return jsx("div",{className:"flex-1 relative",style:{"--font-color":"var(--rstudio-white","--selected-outline-color":"black"},...AA,children:jsxs("div",{className:mergeClasses("bg-primary text-white h-100 grid gap-md p-md overflow-auto",eA?"grid-cols-[7fr_3fr]":"grid-cols-[3fr_7fr]"),children:[jsx("div",{className:mergeClasses("p-sm col-start-1 row-start-1 min-w-0",eA?"col-start-2":"col-start-1"),children:jsx(BsIcon,{className:"w-100 h-100",icon_name:$.showcase_icon??"question-circle"})}),jsxs("div",{className:mergeClasses("flex flex-col justify-center row-start-1 min-w-0",eA?"col-start-1":"col-start-2"),children:[jsx("h5",{className:"",children:$.title}),jsx("div",{children:jsx(DropWatcherPanel,{className:$.value.id==="textNode"?"text-[1.5rem]":"",existing_node:$.value,child_loc:"value",parentPath:tA,messageOnHover:$.value?"Replace value":"Drop a value node here",parentNodeType:"value_box"})}),jsx(ChildrenWithDropNodes,{children:rA,parentPath:tA,parentid:"value_box",messageOnHover:"Add node to value box"})]})]})})},bslibValueBoxInfo=addEditorInfoToUiNode(value_box,{iconSrc:icon$a,UiComponent:ValueBox,settingsFormRender:({settings:$,onSettingsChange:rA,inputs:tA})=>jsxs("div",{children:[jsx(InputLabelWrapper,{label:`Showcase ${$.showcase_icon?"Icon":"Value"}`,labelId:"showcase-icon",mainInput:$.showcase_icon?jsx(IconSelector,{initialValue:$.showcase_icon,onIconSelect:AA=>{rA==null||rA("showcase_icon",{type:"UPDATE",value:AA})}}):jsx(PopoverButton,{className:"w-100 h-[25px]",use_markdown:!0,popoverContent:`Replace current showcase value with an icon from the + `)}componentDidMount(){if(this.ref.current===null)return;const vA=this.makeOptions();nA(rA).create(this.ref.current,vA)}componentDidUpdate(vA){vA.disabled!==this.props.disabled&&this.sortable&&this.sortable.option("disabled",this.props.disabled)}render(){const{tag:vA,style:CA,className:xA,id:IA}=this.props,OA={style:CA,className:xA,id:IA},PA=!vA||vA===null?"div":vA;return(0,AA.createElement)(PA,{ref:this.ref,...OA},this.getChildren())}getChildren(){const{children:vA,dataIdAttr:CA,selectedClass:xA="sortable-selected",chosenClass:IA="sortable-chosen",dragClass:OA="sortable-drag",fallbackClass:PA="sortable-falback",ghostClass:$A="sortable-ghost",swapClass:jA="sortable-swap-highlight",filter:MA="sortable-filter",list:RA}=this.props;if(!vA||vA==null)return null;const HA=CA||"data-id";return AA.Children.map(vA,(DA,kA)=>{if(DA===void 0)return;const _A=RA[kA]||{},{className:mA}=DA.props,bA=typeof MA=="string"&&{[MA.replace(".","")]:!!_A.filtered},FA=nA(tA)(mA,{[xA]:_A.selected,[IA]:_A.chosen,...bA});return(0,AA.cloneElement)(DA,{[HA]:DA.key,className:FA})})}get sortable(){const vA=this.ref.current;if(vA===null)return null;const CA=Object.keys(vA).find(xA=>xA.includes("Sortable"));return CA?vA[CA]:null}makeOptions(){const vA=["onAdd","onChoose","onDeselect","onEnd","onRemove","onSelect","onSpill","onStart","onUnchoose","onUpdate"],CA=["onChange","onClone","onFilter","onSort"],xA=EA(this.props);return vA.forEach(OA=>xA[OA]=this.prepareOnHandlerPropAndDOM(OA)),CA.forEach(OA=>xA[OA]=this.prepareOnHandlerProp(OA)),{...xA,onMove:(OA,PA)=>{const{onMove:$A}=this.props,jA=OA.willInsertAfter||-1;if(!$A)return jA;const MA=$A(OA,PA,this.sortable,QA);return typeof MA>"u"?!1:MA}}}prepareOnHandlerPropAndDOM(vA){return CA=>{this.callOnHandlerProp(CA,vA),this[vA](CA)}}prepareOnHandlerProp(vA){return CA=>{this.callOnHandlerProp(CA,vA)}}callOnHandlerProp(vA,CA){const xA=this.props[CA];xA&&xA(vA,this.sortable,QA)}onAdd(vA){const{list:CA,setList:xA,clone:IA}=this.props,OA=[...QA.dragging.props.list],PA=pA(vA,OA);sA(PA);const $A=fA(PA,CA,vA,IA).map(jA=>Object.assign(jA,{selected:!1}));xA($A,this.sortable,QA)}onRemove(vA){const{list:CA,setList:xA}=this.props,IA=wA(vA),OA=pA(vA,CA);cA(OA);let PA=[...CA];if(vA.pullMode!=="clone")PA=gA(OA,PA);else{let $A=OA;switch(IA){case"multidrag":$A=OA.map((jA,MA)=>({...jA,element:vA.clones[MA]}));break;case"normal":$A=OA.map(jA=>({...jA,element:vA.clone}));break;case"swap":default:nA(eA)(!0,`mode "${IA}" cannot clone. Please remove "props.clone" from when using the "${IA}" plugin`)}sA($A),OA.forEach(jA=>{const MA=jA.oldIndex,RA=this.props.clone(jA.item,vA);PA.splice(MA,1,RA)})}PA=PA.map($A=>Object.assign($A,{selected:!1})),xA(PA,this.sortable,QA)}onUpdate(vA){const{list:CA,setList:xA}=this.props,IA=pA(vA,CA);sA(IA),cA(IA);const OA=uA(IA,CA);return xA(OA,this.sortable,QA)}onStart(){QA.dragging=this}onEnd(){QA.dragging=null}onChoose(vA){const{list:CA,setList:xA}=this.props,IA=CA.map((OA,PA)=>{let $A=OA;return PA===vA.oldIndex&&($A=Object.assign(OA,{chosen:!0})),$A});xA(IA,this.sortable,QA)}onUnchoose(vA){const{list:CA,setList:xA}=this.props,IA=CA.map((OA,PA)=>{let $A=OA;return PA===vA.oldIndex&&($A=Object.assign($A,{chosen:!1})),$A});xA(IA,this.sortable,QA)}onSpill(vA){const{removeOnSpill:CA,revertOnSpill:xA}=this.props;CA&&!xA&&lA(vA.item)}onSelect(vA){const{list:CA,setList:xA}=this.props,IA=CA.map(OA=>Object.assign(OA,{selected:!1}));vA.newIndicies.forEach(OA=>{const PA=OA.index;if(PA===-1){console.log(`"${vA.type}" had indice of "${OA.index}", which is probably -1 and doesn't usually happen here.`),console.log(vA);return}IA[PA].selected=!0}),xA(IA,this.sortable,QA)}onDeselect(vA){const{list:CA,setList:xA}=this.props,IA=CA.map(OA=>Object.assign(OA,{selected:!1}));vA.newIndicies.forEach(OA=>{const PA=OA.index;PA!==-1&&(IA[PA].selected=!0)}),xA(IA,this.sortable,QA)}}gt(dA,"defaultProps",{clone:vA=>vA});var yA={};iA($.exports,yA)})(dist);var distExports=dist.exports;const accentBarStyles={warning:"bg-warning",error:"bg-danger",success:"bg-success",info:"bg-rstudio-blue"};function ControlledPopup({isOpen:$,onClose:rA,children:tA,content:AA,accent:eA,description:nA,...oA}){return jsxs(Tooltip,{open:$,onOpenChange:()=>rA(),...oA,children:[jsx(TooltipTrigger,{asChild:!0,noToggle:!0,children:tA}),jsx(TooltipContent,{children:jsxs("div",{className:mergeClasses("p-2 rounded-standard bg-rstudio-white w-64 relative"),"aria-label":nA,children:[eA&&jsx("div",{className:mergeClasses("absolute -left-2 -top-2 -bottom-2 w-[6px]",accentBarStyles[eA])}),AA]})})]})}function KeyInput($){const{displayedValue:rA,isInvalid:tA,onNewValue:AA,isSameAsOtherKey:eA}=useKeyInput($);return jsx("span",{className:mergeClasses("block relative",eA&&'after:absolute after:content-["Duplicate_key"] after:block after:text-rstudio-white after:rounded after:min-w-fit after:p-1 after:border after:z-20 after:bg-danger/90'),children:jsx("input",{title:"Key Field",className:mergeClasses("min-w-0 w-full placeholder:text-rstudio-white placeholder:text-xs",tA&&"bg-danger/30 transition-colors duration-500 delay-300"),"aria-invalid":tA,"aria-label":"List item key",type:"text",value:rA,placeholder:eA?"Duplicate":"Required",onChange:nA=>{nA.stopPropagation(),AA(nA.target.value)}})})}function useKeyInput({keyValue:$,onUpdate:rA,allElements:tA,index:AA}){const[eA,nA]=React.useState($),[oA,iA]=React.useState($);oA!==$&&(iA($),nA($));const lA=tA.filter((uA,gA)=>gA!==AA).map(uA=>uA.key),aA=eA==="",sA=lA.includes(eA),cA=aA||sA;function pA(uA){nA(uA),!(uA===""||lA.some(fA=>fA.toLowerCase()===uA.toLowerCase()))&&rA(uA)}return{displayedValue:eA,isInvalid:cA,isSameAsOtherKey:sA,onNewValue:pA}}function swapKeysForObject($,rA,tA){const AA=Object.entries($),eA=AA.findIndex(([nA])=>nA===rA);return AA[eA][0]=tA,AA.reduce((nA,[oA,iA])=>(nA[oA]=iA,nA),{})}function namedListToItemTypeArray($){return Array.isArray($)?$.map((rA,tA)=>({id:tA,key:rA,value:rA})):Object.keys($).map((rA,tA)=>({id:tA,key:rA,value:$[rA]}))}function getKeyValueMismatches($){const rA=Object.entries($).filter(([tA,AA])=>typeof AA=="string"&&tA!==AA).map(([tA,AA],eA)=>({key:tA,value:AA,id:eA}));return rA.length===0?null:rA}function isValueOnlyMode($){return Array.isArray($)}function useListState({value:$,onChange:rA,newItemValue:tA}){const[AA,eA]=React.useState(null),nA=isValueOnlyMode($)?"value-only":"key-value",oA=React.useCallback(gA=>{if(isValueOnlyMode($)){const wA=[...$];wA.splice(gA,1),rA(wA);return}const fA={...$};delete fA[Object.keys(fA)[gA]],rA(fA)},[rA,$]),iA=React.useCallback(()=>{const gA=isValueOnlyMode($)?$.length:Object.keys($).length,fA=typeof tA=="function"?tA(gA+1):tA;isValueOnlyMode($)?rA([...$,fA.value]):rA({...$,[fA.key]:fA.value})},[tA,rA,$]),lA=React.useCallback(gA=>{gA.length!==0&&rA(itemTypeArrayToNamedList(gA,nA))},[nA,rA]),aA=React.useCallback(({index:gA,newKey:fA})=>{if(isValueOnlyMode($))throw new Error("Cannot update key in value-only mode");const wA=Object.keys($)[gA];if(fA!==wA&&fA in $)throw new Error(`Key ${fA} already exists`);const BA=swapKeysForObject($,wA,fA);rA(BA)},[rA,$]),sA=React.useCallback(({index:gA,newValue:fA})=>{if(isValueOnlyMode($)){const EA=[...$];EA[gA]=fA,rA(EA);return}const wA={...$},BA=Object.keys($)[gA];wA[BA]=fA,rA(wA)},[rA,$]),cA=gA=>{if(gA){if(isValueOnlyMode($))throw new Error("Trying to simplify a value-only list");const fA=getKeyValueMismatches($);if(fA!==null){eA(fA);return}}pA(gA?"value-only":"key-value")},pA=React.useCallback(gA=>{const fA=isValueOnlyMode($);if(gA===(fA?"value-only":"key-value"))throw new Error("Trying to update to the same list mode");const wA=fA?$.reduce((BA,EA)=>(BA[EA]=EA,BA),{}):Object.values($);rA(wA),eA(null)},[rA,$]),uA=()=>{eA(null)};return{flatList:namedListToItemTypeArray($),reorderItems:lA,deleteItem:oA,addItem:iA,updateKey:aA,updateValue:sA,swapKeyValueMode:pA,listMode:nA,onValueModeToggle:cA,keyValueMismatches:AA,onCancelSimplify:uA}}function itemTypeArrayToNamedList($,rA){return rA==="value-only"?$.map(tA=>tA.value):$.reduce((tA,{key:AA,value:eA})=>(tA[AA]=eA,tA),{})}function NamedListInput({id:$,label:rA,value:tA,onChange:AA,newItemValue:eA=nA=>({key:"Value"+nA,value:"value"+nA})}){const{flatList:nA,addItem:oA,deleteItem:iA,reorderItems:lA,updateKey:aA,updateValue:sA,swapKeyValueMode:cA,listMode:pA,onValueModeToggle:uA,keyValueMismatches:gA,onCancelSimplify:fA}=useListState({value:tA,onChange:AA,newItemValue:eA}),[wA,BA]=React.useState(!1),EA=nA.length===0,QA=jsxs("div",{className:"w-fit flex flex-col items-center my-2","aria-labelledby":makeLabelId($),"aria-label":rA,children:[jsx(ListItem,{valueOnlyMode:pA==="value-only",className:"text-center -my-1","aria-label":"Columns field labels",children:pA==="value-only"?jsx("span",{className:"col-start-2",children:"Value"}):jsxs(Fragment,{children:[jsx("span",{className:"col-start-2",children:"Key"}),jsx("span",{className:"col-start-4",children:"Value"})]})}),jsx(distExports.ReactSortable,{list:nA,setList:lA,handle:".NamedListDragHandle",children:nA.map((yA,hA)=>jsxs(ListItem,{valueOnlyMode:pA==="value-only",className:mergeClasses("my-1",gA&&gA.find(vA=>vA.key===yA.key)?"bg-danger/30":null),"aria-label":"List item",children:[jsx("div",{className:"NamedListDragHandle grid place-items-center cursor-ns-resize",title:"Reorder list",children:jsx(MdDragHandle,{})}),pA==="value-only"?jsx("input",{title:"Value Field",className:"min-w-0",type:"text","aria-label":"List item value",value:yA.value,onChange:vA=>{sA({index:hA,newValue:vA.target.value})}}):jsxs(Fragment,{children:[jsx(KeyInput,{allElements:nA,index:hA,keyValue:yA.key,onUpdate:vA=>{aA({index:hA,newKey:vA})}}),jsx("span",{className:"mb-[1px]",children:":"}),jsx("input",{title:"Value Field",className:"min-w-0",type:"text","aria-label":"List item value",value:yA.value,onChange:vA=>{sA({index:hA,newValue:vA.target.value})}})]}),jsx(Button,{className:"grid place-content-center p-0 area[delete] hover:scale-110 mb-[2px]",onClick:()=>iA(yA.id),variant:["icon","transparent"],title:`Delete ${yA.value}`,children:jsx(SvgTrash,{})})]},hA))})]}),dA=gA!==null;return jsx(ControlledPopup,{isOpen:wA,onClose:()=>{BA(!1),fA()},description:`Settings panel for ${rA} argument`,placement:"right-start",accent:dA?"warning":"info",offset:{mainAxis:9,crossAxis:-23},content:jsxs(Fragment,{children:[jsxs("h2",{className:"bold text-base mb-3",children:["Settings for ",rA," argument"]}),jsxs("div",{className:"flex gap-2 justify-between items-center ",children:[jsx("label",{htmlFor:"keyAndValueModeCheckbox",children:"Keys and Value Mode"}),jsx("input",{className:"transform[translateY(1px)] border mt-[2px]",id:"keyAndValueModeCheckbox",type:"checkbox",checked:pA==="key-value",disabled:dA,onChange:yA=>{uA(!yA.target.checked)}})]}),jsx("span",{className:"text-xs text-gray-700 italic",children:"Should the list be displayed as just values or as key-value pairs? Key value pairs will allow you to choose a different display name for each value."}),dA&&jsxs(Fragment,{children:[jsx("hr",{}),jsxs("p",{children:["There are some"," ",jsx("span",{className:"bg-danger/30 px-1 py-[2px] rounded",children:"mismatches"})," ","between keys and values preventing simplification to value-only mode. Merge to just the values?"]}),jsxs("div",{className:"flex justify-around mt-2",children:[jsxs(Button,{onClick:()=>{cA("value-only"),fA()},children:[jsx(ArrowsCollapse$1,{className:"text-lg"})," Merge"]}),jsxs(Button,{onClick:fA,variant:"secondary",children:[" ",jsx(X$1,{className:"text-lg"}),"Cancel"]})]})]})]}),children:jsxs("div",{className:"relative",children:[jsx(Button,{className:"absolute right-0 bottom-100",variant:["icon","transparent"],onClick:()=>{BA(yA=>!yA),fA()},"aria-label":`Open settings for ${rA} argument`,children:jsx(Gear$1,{})}),EA?jsx("div",{className:"text-gray-500 text-xs bg-rstudio-white rounded italic w-full h-[23px] my-1 grid place-content-center ",children:"Empty list"}):QA,jsx(Button,{className:"text-icon -mt-1 p-1 bg-red-400 w-full",onClick:()=>oA(),variant:"transparent",title:"Add new item","aria-label":"Add new item to list",children:jsx(FaPlus,{})})]})})}function ListItem({valueOnlyMode:$,className:rA,...tA}){return jsx("div",{className:mergeClasses(rA,$?"grid-cols-[15px_1fr_15px]":"grid-cols-[15px_1fr_auto_1fr_15px]","w-100 grid ","gap-1 p-1 items-center rounded [&.sortable-chosen]:outline","[&.sortable-chosen]:outline-offset-[-2px] [&.sortable-chosen]:outline-rstudio-grey/30 [&.sortable-chosen]:shadow-lg"),...tA})}const styles$d="",DEFAULT_DROPDOWN_CHOICE="__DEFAULT-DROPDOWN-CHOICE__";function DropdownSelect({id:$,label:rA,choices:tA,onChange:AA,value:eA}){React.useEffect(()=>{eA===DEFAULT_DROPDOWN_CHOICE&&AA(tA[0]),tA.length>0&&!tA.includes(eA)&&AA(tA[0])},[AA,tA,eA]);const nA=iA=>{const lA=iA.target.selectedIndex;AA(tA[lA])},oA=removeDuplicates(tA);return oA.length===0?jsx("select",{title:`${rA} selector`,"aria-labelledby":makeLabelId($),"aria-label":rA,className:"OptionsDropdown SUE-Input",placeholder:"No available options"}):jsx("select",{title:`${rA} selector`,"aria-labelledby":makeLabelId($),className:"OptionsDropdown SUE-Input",onChange:nA,value:eA,children:oA.map(iA=>jsx("option",{value:iA,children:iA},iA))})}function walkUiNode($,rA){function tA(AA){var oA;if(rA(AA)===!1)return;const nA=AA.namedArgs;for(const iA in nA){const lA=nA[iA];isShinyUiNode(lA)&&tA(lA)}isParentNode(AA)&&((oA=AA.children)==null||oA.forEach(tA))}tA($)}function getAllInputOutputIdsInApp($){const rA=[];return walkUiNode($,tA=>{const AA=tA.namedArgs,eA=AA.id||AA.outputId||AA.inputId;typeof eA=="string"&&rA.push(eA)}),rA}function useUpdateServerCode(){const $=useDispatch(),rA=useCurrentAppInfo(),tA=rA.mode==="MAIN"?rA.app.code:null;return React.useCallback(eA=>{if(tA===null)throw new Error("Tried to update server code when no app template");$(SET_APP_CODE_TEMPLATE(eA(tA)))},[tA,$])}function generateFullAppScript($){const{ui_tree:rA}=$;return generateUiScript({ui_tree:rA,language:$.language,...$.app})}function useCurrentServerNodes(){const $=useCurrentAppInfo(),rA=useTsParser(),[tA,AA]=React.useState(null);return React.useEffect(()=>{if($.mode!=="MAIN")return;const eA=generateFullAppScript($);rA(eA).then(nA=>{const oA=$.language==="R"?getRServerLocations(nA.server_node):getPythonServerLocations(nA.server_node);if(!oA)throw new Error("Could not parse app scripts");AA(oA)})},[$,rA]),tA}function updateServerWithNewId({oldId:$,newId:rA,positions:tA,appScript:AA,language:eA}){const nA=new RegExp(eA==="R"?`(input|output)(\\$)(${$})(\\W)`:`(input|output)(\\[)(${$})(\\])`,"g"),oA=AA.match(nA);if(oA===null)throw new Error(`No matches found for ${$} in app script`);if(tA&&oA.length!==tA.length)throw new Error(`Expected ${tA.length} matches for ${$} in app script but got ${oA==null?void 0:oA.length}`);return AA.replace(nA,`$1$2${rA}$4`)}function IdInput({id:$,label:rA,value:tA,onChange:AA,inputOrOutput:eA}){const nA=useCurrentAppInfo(),oA=useUpdateServerCode(),iA=useCurrentServerNodes(),[lA,aA]=React.useState(null),[sA,cA]=React.useState(tA),[pA,uA]=React.useState(null),gA=getLocationsInServerOfId(tA,iA),fA=gA!==null;if(React.useEffect(()=>{aA(fA?"synced":"unsynced")},[fA]),nA.mode!=="MAIN")return null;const{ui_tree:wA,language:BA}=nA,EA=getAllInputOutputIdsInApp(wA),QA=hA=>{const vA=EA.includes(hA)&&hA!==tA;if(hA=hA.replace(/ /g,"_"),cA(hA),vA){uA(`The id ${hA} is already taken`);return}if(hA===""){uA("ID cannot be empty");return}AA(hA),uA(null),lA==="synced"&&gA!==null&&oA(CA=>updateServerWithNewId({oldId:tA,newId:hA,positions:gA,appScript:CA,language:BA}))},dA=pA!==null,yA={className:"SUE-Input","aria-label":rA,"aria-labelledby":makeLabelId($),"aria-invalid":dA,autoComplete:"off",id:$,value:sA,onChange:hA=>{QA(hA.target.value)}};return jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx("input",{...yA,type:"text"}),fA&&jsxs(Tooltip,{placement:"right-start",children:[jsx(TooltipTrigger,{asChild:!0,children:jsxs("div",{className:"relative",children:[jsx(Link45deg$1,{className:mergeClasses("text-xl relative ",lA==="synced"?["text-rstudio-blue"]:["text-danger after:block after:absolute after:w-px after:bg-danger"]),onClick:()=>{aA(hA=>hA==="unsynced"?"synced":"unsynced")}}),lA==="unsynced"&&jsx("div",{className:"bg-danger/50 w-[2px] absolute left-[50%] top-1 bottom-1 pointer-events-none",style:{transform:"rotate(320deg)"}})]})}),jsxs(TooltipContent,{className:"max-w-xs",children:[jsx("p",{className:"my-1",children:lA==="synced"?"Changing ID will cause uses of this ID in server code to update.":"ID syncing is disabled. Changes to this ID will not be reflected in server code."}),jsxs("p",{className:"my-1",children:["Click to ",lA==="synced"?"disable":"enable"," ","syncing."]})]})]})]}),pA&&jsx("div",{className:"text-danger",children:jsx("small",{children:pA})})]})}function getLocationsInServerOfId($,rA){if(rA===null)return null;const{inputNodes:tA,outputNodes:AA}=rA;return tA.has($)?tA.get($).map(getNodePosition):AA.has($)?AA.get($).map(getNodePosition):null}const existingValuesContext=React.createContext({existingValues:new Set,warningMsg:$=>`The value ${$} is already taken`});function StringInput({id:$,label:rA,value:tA,onChange:AA,longform:eA}){const nA=React.useContext(existingValuesContext),oA=nA==null?void 0:nA.existingValues.has(tA),iA={className:"SUE-Input","aria-label":rA,"aria-labelledby":makeLabelId($),"aria-invalid":oA,id:$,value:tA,onChange:lA=>{const aA=lA.target.value;AA(aA)}};return jsxs(Fragment,{children:[eA?jsx("textarea",{...iA,className:"h-24 w-100 flex-grow"}):jsx("input",{...iA,type:"text"}),oA&&jsx("div",{className:"text-danger",children:jsx("small",{children:nA.warningMsg(tA)})})]})}function SettingsInputElement($){switch($.inputType){case"string":return jsx(StringInput,{...$});case"number":return jsx(NumberInput,{...$});case"cssMeasure":return jsx(CSSUnitInput,{...$});case"boolean":return jsx(BooleanInput,{...$});case"list":return jsx(NamedListInput,{...$});case"dropdown":return jsx(DropdownSelect,{...$});case"radio":return jsx(RadioInputs,{...$});case"id":return jsx(IdInput,{...$});default:return jsxs("div",{children:["I don't know how to render the input of type ",$.inputType," yet! Sorry."]})}}function valueIsType($,rA){if($===void 0)return!0;if(rA==="number")return typeof $=="number"||typeof $=="string"&&!isNaN(Number($));if(rA==="string"||rA==="id")return typeof $=="string";if(rA==="cssMeasure")return isCSSMeasure($);if(rA==="boolean")return typeof $=="boolean";if(rA==="list")return isNamedList($);if(rA==="dropdown"||rA==="radio")return typeof $=="string";if(rA==="string-array")return Array.isArray($)&&typeof $[0]=="string";if(rA==="ui-node")return isShinyUiNode($);if(rA==="omitted")return!0;throw new Error("Unimplemented argument type check",rA)}const SettingsInput$1="";function SettingsInput({onUpdate:$,...rA}){const tA=rA.value===void 0,AA=rA.optional,eA=makeLabelId(rA.name),nA=rA.label??rA.name,oA=()=>$({type:"UPDATE",value:rA.defaultValue}),iA=sA=>$({type:"UPDATE",value:sA}),lA=()=>$({type:"REMOVE"});let aA;return rA.value===void 0?rA.optional?aA=jsx(UnsetArgumentMessage,{labelledBy:eA}):aA=jsx(MissingRequiredArgumentMessage,{name:rA.name,onReset:oA}):valueIsType(rA.value,rA.inputType)?aA=jsx(SettingsInputElement,{label:nA,id:rA.name,onChange:iA,...rA}):aA=jsx(MismatchedTypeMessage,{name:rA.name,onReset:oA}),jsx(InputLabelWrapper,{argumentIsUnset:tA,className:rA.fill_space?"flex flex-col flex-grow":"",optionalField:AA?jsx("input",{type:"checkbox",checked:!tA,title:`Use ${rA.name} argument`,"aria-label":`Use ${rA.name} argument`,onChange:tA?oA:lA}):null,label:nA,labelId:eA,mainInput:aA})}function InputLabelWrapper({argumentIsUnset:$=!1,className:rA,optionalField:tA,label:AA,labelId:eA,mainInput:nA}){return jsxs("div",{className:mergeClasses("SUE-SettingsInput",rA),children:[jsxs("div",{className:"info","data-unset":$,children:[tA,jsx("label",{id:eA,children:AA})]}),nA]})}function MismatchedTypeMessage({name:$,onReset:rA}){return jsxs("div",{className:"mismatched-argument-types",children:["Argument for ",$," of unsupported type.",jsx(Button,{style:{padding:"0.25rem 0.5rem",marginInline:"0.25rem"},onClick:rA,children:"Reset"})]})}function MissingRequiredArgumentMessage({name:$,onReset:rA}){return jsxs("div",{className:"missing-required-argument-message",children:['Required argument "',$,'" not provided.',jsx(Button,{style:{padding:"0.25rem 0.5rem",marginInline:"0.25rem"},onClick:rA,children:"Reset"})]})}function UnsetArgumentMessage({labelledBy:$}){return jsx("input",{className:"unset-argument SUE-Input","aria-labelledby":$,placeholder:"Default",disabled:!0})}function cleanIconName($){let AA=$.split("-").map(eA=>eA.charAt(0).toUpperCase()+eA.slice(1)).join("");return/[0-9]/.test(AA.charAt(0))&&(AA="Icon"+AA),AA}const BsIcon=({icon_name:$,...rA})=>{let tA="icon_name";try{tA=cleanIconName($)}catch{return jsxs("span",{children:["Failed to find ",jsx("strong",{children:$})]})}if(!(tA in icons$1))return jsxs("span",{children:["Failed to find ",jsx("strong",{children:$})]});const AA=icons$1[tA];return jsx(AA,{...rA})},allBsIconNames=["0-circle-fill","0-circle","0-square-fill","0-square","1-circle-fill","1-circle","1-square-fill","1-square","123","2-circle-fill","2-circle","2-square-fill","2-square","3-circle-fill","3-circle","3-square-fill","3-square","4-circle-fill","4-circle","4-square-fill","4-square","5-circle-fill","5-circle","5-square-fill","5-square","6-circle-fill","6-circle","6-square-fill","6-square","7-circle-fill","7-circle","7-square-fill","7-square","8-circle-fill","8-circle","8-square-fill","8-square","9-circle-fill","9-circle","9-square-fill","9-square","activity","airplane-engines-fill","airplane-engines","airplane-fill","airplane","alarm-fill","alarm","alexa","align-bottom","align-center","align-end","align-middle","align-start","align-top","alipay","alt","amd","android","android2","app-indicator","app","apple","archive-fill","archive","arrow-90deg-down","arrow-90deg-left","arrow-90deg-right","arrow-90deg-up","arrow-bar-down","arrow-bar-left","arrow-bar-right","arrow-bar-up","arrow-clockwise","arrow-counterclockwise","arrow-down-circle-fill","arrow-down-circle","arrow-down-left-circle-fill","arrow-down-left-circle","arrow-down-left-square-fill","arrow-down-left-square","arrow-down-left","arrow-down-right-circle-fill","arrow-down-right-circle","arrow-down-right-square-fill","arrow-down-right-square","arrow-down-right","arrow-down-short","arrow-down-square-fill","arrow-down-square","arrow-down-up","arrow-down","arrow-left-circle-fill","arrow-left-circle","arrow-left-right","arrow-left-short","arrow-left-square-fill","arrow-left-square","arrow-left","arrow-repeat","arrow-return-left","arrow-return-right","arrow-right-circle-fill","arrow-right-circle","arrow-right-short","arrow-right-square-fill","arrow-right-square","arrow-right","arrow-through-heart-fill","arrow-through-heart","arrow-up-circle-fill","arrow-up-circle","arrow-up-left-circle-fill","arrow-up-left-circle","arrow-up-left-square-fill","arrow-up-left-square","arrow-up-left","arrow-up-right-circle-fill","arrow-up-right-circle","arrow-up-right-square-fill","arrow-up-right-square","arrow-up-right","arrow-up-short","arrow-up-square-fill","arrow-up-square","arrow-up","arrows-angle-contract","arrows-angle-expand","arrows-collapse","arrows-expand","arrows-fullscreen","arrows-move","aspect-ratio-fill","aspect-ratio","asterisk","at","award-fill","award","back","backspace-fill","backspace-reverse-fill","backspace-reverse","backspace","badge-3d-fill","badge-3d","badge-4k-fill","badge-4k","badge-8k-fill","badge-8k","badge-ad-fill","badge-ad","badge-ar-fill","badge-ar","badge-cc-fill","badge-cc","badge-hd-fill","badge-hd","badge-sd-fill","badge-sd","badge-tm-fill","badge-tm","badge-vo-fill","badge-vo","badge-vr-fill","badge-vr","badge-wc-fill","badge-wc","bag-check-fill","bag-check","bag-dash-fill","bag-dash","bag-fill","bag-heart-fill","bag-heart","bag-plus-fill","bag-plus","bag-x-fill","bag-x","bag","balloon-fill","balloon-heart-fill","balloon-heart","balloon","bandaid-fill","bandaid","bank","bank2","bar-chart-fill","bar-chart-line-fill","bar-chart-line","bar-chart-steps","bar-chart","basket-fill","basket","basket2-fill","basket2","basket3-fill","basket3","battery-charging","battery-full","battery-half","battery","behance","bell-fill","bell-slash-fill","bell-slash","bell","bezier","bezier2","bicycle","binoculars-fill","binoculars","blockquote-left","blockquote-right","bluetooth","body-text","book-fill","book-half","book","bookmark-check-fill","bookmark-check","bookmark-dash-fill","bookmark-dash","bookmark-fill","bookmark-heart-fill","bookmark-heart","bookmark-plus-fill","bookmark-plus","bookmark-star-fill","bookmark-star","bookmark-x-fill","bookmark-x","bookmark","bookmarks-fill","bookmarks","bookshelf","boombox-fill","boombox","bootstrap-fill","bootstrap-reboot","bootstrap","border-all","border-bottom","border-center","border-inner","border-left","border-middle","border-outer","border-right","border-style","border-top","border-width","border","bounding-box-circles","bounding-box","box-arrow-down-left","box-arrow-down-right","box-arrow-down","box-arrow-in-down-left","box-arrow-in-down-right","box-arrow-in-down","box-arrow-in-left","box-arrow-in-right","box-arrow-in-up-left","box-arrow-in-up-right","box-arrow-in-up","box-arrow-left","box-arrow-right","box-arrow-up-left","box-arrow-up-right","box-arrow-up","box-fill","box-seam-fill","box-seam","box","box2-fill","box2-heart-fill","box2-heart","box2","boxes","braces-asterisk","braces","bricks","briefcase-fill","briefcase","brightness-alt-high-fill","brightness-alt-high","brightness-alt-low-fill","brightness-alt-low","brightness-high-fill","brightness-high","brightness-low-fill","brightness-low","broadcast-pin","broadcast","browser-chrome","browser-edge","browser-firefox","browser-safari","brush-fill","brush","bucket-fill","bucket","bug-fill","bug","building-add","building-check","building-dash","building-down","building-exclamation","building-fill-add","building-fill-check","building-fill-dash","building-fill-down","building-fill-exclamation","building-fill-gear","building-fill-lock","building-fill-slash","building-fill-up","building-fill-x","building-fill","building-gear","building-lock","building-slash","building-up","building-x","building","buildings-fill","buildings","bullseye","bus-front-fill","bus-front","c-circle-fill","c-circle","c-square-fill","c-square","calculator-fill","calculator","calendar-check-fill","calendar-check","calendar-date-fill","calendar-date","calendar-day-fill","calendar-day","calendar-event-fill","calendar-event","calendar-fill","calendar-heart-fill","calendar-heart","calendar-minus-fill","calendar-minus","calendar-month-fill","calendar-month","calendar-plus-fill","calendar-plus","calendar-range-fill","calendar-range","calendar-week-fill","calendar-week","calendar-x-fill","calendar-x","calendar","calendar2-check-fill","calendar2-check","calendar2-date-fill","calendar2-date","calendar2-day-fill","calendar2-day","calendar2-event-fill","calendar2-event","calendar2-fill","calendar2-heart-fill","calendar2-heart","calendar2-minus-fill","calendar2-minus","calendar2-month-fill","calendar2-month","calendar2-plus-fill","calendar2-plus","calendar2-range-fill","calendar2-range","calendar2-week-fill","calendar2-week","calendar2-x-fill","calendar2-x","calendar2","calendar3-event-fill","calendar3-event","calendar3-fill","calendar3-range-fill","calendar3-range","calendar3-week-fill","calendar3-week","calendar3","calendar4-event","calendar4-range","calendar4-week","calendar4","camera-fill","camera-reels-fill","camera-reels","camera-video-fill","camera-video-off-fill","camera-video-off","camera-video","camera","camera2","capslock-fill","capslock","capsule-pill","capsule","car-front-fill","car-front","card-checklist","card-heading","card-image","card-list","card-text","caret-down-fill","caret-down-square-fill","caret-down-square","caret-down","caret-left-fill","caret-left-square-fill","caret-left-square","caret-left","caret-right-fill","caret-right-square-fill","caret-right-square","caret-right","caret-up-fill","caret-up-square-fill","caret-up-square","caret-up","cart-check-fill","cart-check","cart-dash-fill","cart-dash","cart-fill","cart-plus-fill","cart-plus","cart-x-fill","cart-x","cart","cart2","cart3","cart4","cash-coin","cash-stack","cash","cassette-fill","cassette","cast","cc-circle-fill","cc-circle","cc-square-fill","cc-square","chat-dots-fill","chat-dots","chat-fill","chat-heart-fill","chat-heart","chat-left-dots-fill","chat-left-dots","chat-left-fill","chat-left-heart-fill","chat-left-heart","chat-left-quote-fill","chat-left-quote","chat-left-text-fill","chat-left-text","chat-left","chat-quote-fill","chat-quote","chat-right-dots-fill","chat-right-dots","chat-right-fill","chat-right-heart-fill","chat-right-heart","chat-right-quote-fill","chat-right-quote","chat-right-text-fill","chat-right-text","chat-right","chat-square-dots-fill","chat-square-dots","chat-square-fill","chat-square-heart-fill","chat-square-heart","chat-square-quote-fill","chat-square-quote","chat-square-text-fill","chat-square-text","chat-square","chat-text-fill","chat-text","chat","check-all","check-circle-fill","check-circle","check-lg","check-square-fill","check-square","check","check2-all","check2-circle","check2-square","check2","chevron-bar-contract","chevron-bar-down","chevron-bar-expand","chevron-bar-left","chevron-bar-right","chevron-bar-up","chevron-compact-down","chevron-compact-left","chevron-compact-right","chevron-compact-up","chevron-contract","chevron-double-down","chevron-double-left","chevron-double-right","chevron-double-up","chevron-down","chevron-expand","chevron-left","chevron-right","chevron-up","circle-fill","circle-half","circle-square","circle","clipboard-check-fill","clipboard-check","clipboard-data-fill","clipboard-data","clipboard-fill","clipboard-heart-fill","clipboard-heart","clipboard-minus-fill","clipboard-minus","clipboard-plus-fill","clipboard-plus","clipboard-pulse","clipboard-x-fill","clipboard-x","clipboard","clipboard2-check-fill","clipboard2-check","clipboard2-data-fill","clipboard2-data","clipboard2-fill","clipboard2-heart-fill","clipboard2-heart","clipboard2-minus-fill","clipboard2-minus","clipboard2-plus-fill","clipboard2-plus","clipboard2-pulse-fill","clipboard2-pulse","clipboard2-x-fill","clipboard2-x","clipboard2","clock-fill","clock-history","clock","cloud-arrow-down-fill","cloud-arrow-down","cloud-arrow-up-fill","cloud-arrow-up","cloud-check-fill","cloud-check","cloud-download-fill","cloud-download","cloud-drizzle-fill","cloud-drizzle","cloud-fill","cloud-fog-fill","cloud-fog","cloud-fog2-fill","cloud-fog2","cloud-hail-fill","cloud-hail","cloud-haze-fill","cloud-haze","cloud-haze2-fill","cloud-haze2","cloud-lightning-fill","cloud-lightning-rain-fill","cloud-lightning-rain","cloud-lightning","cloud-minus-fill","cloud-minus","cloud-moon-fill","cloud-moon","cloud-plus-fill","cloud-plus","cloud-rain-fill","cloud-rain-heavy-fill","cloud-rain-heavy","cloud-rain","cloud-slash-fill","cloud-slash","cloud-sleet-fill","cloud-sleet","cloud-snow-fill","cloud-snow","cloud-sun-fill","cloud-sun","cloud-upload-fill","cloud-upload","cloud","clouds-fill","clouds","cloudy-fill","cloudy","code-slash","code-square","code","coin","collection-fill","collection-play-fill","collection-play","collection","columns-gap","columns","command","compass-fill","compass","cone-striped","cone","controller","cpu-fill","cpu","credit-card-2-back-fill","credit-card-2-back","credit-card-2-front-fill","credit-card-2-front","credit-card-fill","credit-card","crop","cup-fill","cup-hot-fill","cup-hot","cup-straw","cup","currency-bitcoin","currency-dollar","currency-euro","currency-exchange","currency-pound","currency-rupee","currency-yen","cursor-fill","cursor-text","cursor","dash-circle-dotted","dash-circle-fill","dash-circle","dash-lg","dash-square-dotted","dash-square-fill","dash-square","dash","database-add","database-check","database-dash","database-down","database-exclamation","database-fill-add","database-fill-check","database-fill-dash","database-fill-down","database-fill-exclamation","database-fill-gear","database-fill-lock","database-fill-slash","database-fill-up","database-fill-x","database-fill","database-gear","database-lock","database-slash","database-up","database-x","database","device-hdd-fill","device-hdd","device-ssd-fill","device-ssd","diagram-2-fill","diagram-2","diagram-3-fill","diagram-3","diamond-fill","diamond-half","diamond","dice-1-fill","dice-1","dice-2-fill","dice-2","dice-3-fill","dice-3","dice-4-fill","dice-4","dice-5-fill","dice-5","dice-6-fill","dice-6","disc-fill","disc","discord","display-fill","display","displayport-fill","displayport","distribute-horizontal","distribute-vertical","door-closed-fill","door-closed","door-open-fill","door-open","dot","download","dpad-fill","dpad","dribbble","dropbox","droplet-fill","droplet-half","droplet","ear-fill","ear","earbuds","easel-fill","easel","easel2-fill","easel2","easel3-fill","easel3","egg-fill","egg-fried","egg","eject-fill","eject","emoji-angry-fill","emoji-angry","emoji-dizzy-fill","emoji-dizzy","emoji-expressionless-fill","emoji-expressionless","emoji-frown-fill","emoji-frown","emoji-heart-eyes-fill","emoji-heart-eyes","emoji-kiss-fill","emoji-kiss","emoji-laughing-fill","emoji-laughing","emoji-neutral-fill","emoji-neutral","emoji-smile-fill","emoji-smile-upside-down-fill","emoji-smile-upside-down","emoji-smile","emoji-sunglasses-fill","emoji-sunglasses","emoji-wink-fill","emoji-wink","envelope-at-fill","envelope-at","envelope-check-fill","envelope-check","envelope-dash-fill","envelope-dash","envelope-exclamation-fill","envelope-exclamation","envelope-fill","envelope-heart-fill","envelope-heart","envelope-open-fill","envelope-open-heart-fill","envelope-open-heart","envelope-open","envelope-paper-fill","envelope-paper-heart-fill","envelope-paper-heart","envelope-paper","envelope-plus-fill","envelope-plus","envelope-slash-fill","envelope-slash","envelope-x-fill","envelope-x","envelope","eraser-fill","eraser","escape","ethernet","ev-front-fill","ev-front","ev-station-fill","ev-station","exclamation-circle-fill","exclamation-circle","exclamation-diamond-fill","exclamation-diamond","exclamation-lg","exclamation-octagon-fill","exclamation-octagon","exclamation-square-fill","exclamation-square","exclamation-triangle-fill","exclamation-triangle","exclamation","exclude","explicit-fill","explicit","eye-fill","eye-slash-fill","eye-slash","eye","eyedropper","eyeglasses","facebook","fan","fast-forward-btn-fill","fast-forward-btn","fast-forward-circle-fill","fast-forward-circle","fast-forward-fill","fast-forward","file-arrow-down-fill","file-arrow-down","file-arrow-up-fill","file-arrow-up","file-bar-graph-fill","file-bar-graph","file-binary-fill","file-binary","file-break-fill","file-break","file-check-fill","file-check","file-code-fill","file-code","file-diff-fill","file-diff","file-earmark-arrow-down-fill","file-earmark-arrow-down","file-earmark-arrow-up-fill","file-earmark-arrow-up","file-earmark-bar-graph-fill","file-earmark-bar-graph","file-earmark-binary-fill","file-earmark-binary","file-earmark-break-fill","file-earmark-break","file-earmark-check-fill","file-earmark-check","file-earmark-code-fill","file-earmark-code","file-earmark-diff-fill","file-earmark-diff","file-earmark-easel-fill","file-earmark-easel","file-earmark-excel-fill","file-earmark-excel","file-earmark-fill","file-earmark-font-fill","file-earmark-font","file-earmark-image-fill","file-earmark-image","file-earmark-lock-fill","file-earmark-lock","file-earmark-lock2-fill","file-earmark-lock2","file-earmark-medical-fill","file-earmark-medical","file-earmark-minus-fill","file-earmark-minus","file-earmark-music-fill","file-earmark-music","file-earmark-pdf-fill","file-earmark-pdf","file-earmark-person-fill","file-earmark-person","file-earmark-play-fill","file-earmark-play","file-earmark-plus-fill","file-earmark-plus","file-earmark-post-fill","file-earmark-post","file-earmark-ppt-fill","file-earmark-ppt","file-earmark-richtext-fill","file-earmark-richtext","file-earmark-ruled-fill","file-earmark-ruled","file-earmark-slides-fill","file-earmark-slides","file-earmark-spreadsheet-fill","file-earmark-spreadsheet","file-earmark-text-fill","file-earmark-text","file-earmark-word-fill","file-earmark-word","file-earmark-x-fill","file-earmark-x","file-earmark-zip-fill","file-earmark-zip","file-earmark","file-easel-fill","file-easel","file-excel-fill","file-excel","file-fill","file-font-fill","file-font","file-image-fill","file-image","file-lock-fill","file-lock","file-lock2-fill","file-lock2","file-medical-fill","file-medical","file-minus-fill","file-minus","file-music-fill","file-music","file-pdf-fill","file-pdf","file-person-fill","file-person","file-play-fill","file-play","file-plus-fill","file-plus","file-post-fill","file-post","file-ppt-fill","file-ppt","file-richtext-fill","file-richtext","file-ruled-fill","file-ruled","file-slides-fill","file-slides","file-spreadsheet-fill","file-spreadsheet","file-text-fill","file-text","file-word-fill","file-word","file-x-fill","file-x","file-zip-fill","file-zip","file","files-alt","files","filetype-aac","filetype-ai","filetype-bmp","filetype-cs","filetype-css","filetype-csv","filetype-doc","filetype-docx","filetype-exe","filetype-gif","filetype-heic","filetype-html","filetype-java","filetype-jpg","filetype-js","filetype-json","filetype-jsx","filetype-key","filetype-m4p","filetype-md","filetype-mdx","filetype-mov","filetype-mp3","filetype-mp4","filetype-otf","filetype-pdf","filetype-php","filetype-png","filetype-ppt","filetype-pptx","filetype-psd","filetype-py","filetype-raw","filetype-rb","filetype-sass","filetype-scss","filetype-sh","filetype-sql","filetype-svg","filetype-tiff","filetype-tsx","filetype-ttf","filetype-txt","filetype-wav","filetype-woff","filetype-xls","filetype-xlsx","filetype-xml","filetype-yml","film","filter-circle-fill","filter-circle","filter-left","filter-right","filter-square-fill","filter-square","filter","fingerprint","fire","flag-fill","flag","flower1","flower2","flower3","folder-check","folder-fill","folder-minus","folder-plus","folder-symlink-fill","folder-symlink","folder-x","folder","folder2-open","folder2","fonts","forward-fill","forward","front","fuel-pump-diesel-fill","fuel-pump-diesel","fuel-pump-fill","fuel-pump","fullscreen-exit","fullscreen","funnel-fill","funnel","gear-fill","gear-wide-connected","gear-wide","gear","gem","gender-ambiguous","gender-female","gender-male","gender-trans","geo-alt-fill","geo-alt","geo-fill","geo","gift-fill","gift","git","github","globe-americas","globe-asia-australia","globe-central-south-asia","globe-europe-africa","globe","globe2","google-play","google","gpu-card","graph-down-arrow","graph-down","graph-up-arrow","graph-up","grid-1x2-fill","grid-1x2","grid-3x2-gap-fill","grid-3x2-gap","grid-3x2","grid-3x3-gap-fill","grid-3x3-gap","grid-3x3","grid-fill","grid","grip-horizontal","grip-vertical","h-circle-fill","h-circle","h-square-fill","h-square","hammer","hand-index-fill","hand-index-thumb-fill","hand-index-thumb","hand-index","hand-thumbs-down-fill","hand-thumbs-down","hand-thumbs-up-fill","hand-thumbs-up","handbag-fill","handbag","hash","hdd-fill","hdd-network-fill","hdd-network","hdd-rack-fill","hdd-rack","hdd-stack-fill","hdd-stack","hdd","hdmi-fill","hdmi","headphones","headset-vr","headset","heart-arrow","heart-fill","heart-half","heart-pulse-fill","heart-pulse","heart","heartbreak-fill","heartbreak","hearts","heptagon-fill","heptagon-half","heptagon","hexagon-fill","hexagon-half","hexagon","hospital-fill","hospital","hourglass-bottom","hourglass-split","hourglass-top","hourglass","house-add-fill","house-add","house-check-fill","house-check","house-dash-fill","house-dash","house-door-fill","house-door","house-down-fill","house-down","house-exclamation-fill","house-exclamation","house-fill","house-gear-fill","house-gear","house-heart-fill","house-heart","house-lock-fill","house-lock","house-slash-fill","house-slash","house-up-fill","house-up","house-x-fill","house-x","house","houses-fill","houses","hr","hurricane","hypnotize","image-alt","image-fill","image","images","inbox-fill","inbox","inboxes-fill","inboxes","incognito","indent","infinity","info-circle-fill","info-circle","info-lg","info-square-fill","info-square","info","input-cursor-text","input-cursor","instagram","intersect","journal-album","journal-arrow-down","journal-arrow-up","journal-bookmark-fill","journal-bookmark","journal-check","journal-code","journal-medical","journal-minus","journal-plus","journal-richtext","journal-text","journal-x","journal","journals","joystick","justify-left","justify-right","justify","kanban-fill","kanban","key-fill","key","keyboard-fill","keyboard","ladder","lamp-fill","lamp","laptop-fill","laptop","layer-backward","layer-forward","layers-fill","layers-half","layers","layout-sidebar-inset-reverse","layout-sidebar-inset","layout-sidebar-reverse","layout-sidebar","layout-split","layout-text-sidebar-reverse","layout-text-sidebar","layout-text-window-reverse","layout-text-window","layout-three-columns","layout-wtf","life-preserver","lightbulb-fill","lightbulb-off-fill","lightbulb-off","lightbulb","lightning-charge-fill","lightning-charge","lightning-fill","lightning","line","link-45deg","link","linkedin","list-check","list-columns-reverse","list-columns","list-nested","list-ol","list-stars","list-task","list-ul","list","lock-fill","lock","lungs-fill","lungs","magic","magnet-fill","magnet","mailbox","mailbox2","map-fill","map","markdown-fill","markdown","mask","mastodon","medium","megaphone-fill","megaphone","memory","menu-app-fill","menu-app","menu-button-fill","menu-button-wide-fill","menu-button-wide","menu-button","menu-down","menu-up","messenger","meta","mic-fill","mic-mute-fill","mic-mute","mic","microsoft-teams","microsoft","minecart-loaded","minecart","modem-fill","modem","moisture","moon-fill","moon-stars-fill","moon-stars","moon","mortarboard-fill","mortarboard","motherboard-fill","motherboard","mouse-fill","mouse","mouse2-fill","mouse2","mouse3-fill","mouse3","music-note-beamed","music-note-list","music-note","music-player-fill","music-player","newspaper","nintendo-switch","node-minus-fill","node-minus","node-plus-fill","node-plus","nut-fill","nut","nvidia","octagon-fill","octagon-half","octagon","optical-audio-fill","optical-audio","option","outlet","p-circle-fill","p-circle","p-square-fill","p-square","paint-bucket","palette-fill","palette","palette2","paperclip","paragraph","pass-fill","pass","patch-check-fill","patch-check","patch-exclamation-fill","patch-exclamation","patch-minus-fill","patch-minus","patch-plus-fill","patch-plus","patch-question-fill","patch-question","pause-btn-fill","pause-btn","pause-circle-fill","pause-circle","pause-fill","pause","paypal","pc-display-horizontal","pc-display","pc-horizontal","pc","pci-card","peace-fill","peace","pen-fill","pen","pencil-fill","pencil-square","pencil","pentagon-fill","pentagon-half","pentagon","people-fill","people","percent","person-add","person-badge-fill","person-badge","person-bounding-box","person-check-fill","person-check","person-circle","person-dash-fill","person-dash","person-down","person-exclamation","person-fill-add","person-fill-check","person-fill-dash","person-fill-down","person-fill-exclamation","person-fill-gear","person-fill-lock","person-fill-slash","person-fill-up","person-fill-x","person-fill","person-gear","person-heart","person-hearts","person-lines-fill","person-lock","person-plus-fill","person-plus","person-rolodex","person-slash","person-square","person-up","person-vcard-fill","person-vcard","person-video","person-video2","person-video3","person-workspace","person-x-fill","person-x","person","phone-fill","phone-flip","phone-landscape-fill","phone-landscape","phone-vibrate-fill","phone-vibrate","phone","pie-chart-fill","pie-chart","piggy-bank-fill","piggy-bank","pin-angle-fill","pin-angle","pin-fill","pin-map-fill","pin-map","pin","pinterest","pip-fill","pip","play-btn-fill","play-btn","play-circle-fill","play-circle","play-fill","play","playstation","plug-fill","plug","plugin","plus-circle-dotted","plus-circle-fill","plus-circle","plus-lg","plus-slash-minus","plus-square-dotted","plus-square-fill","plus-square","plus","postage-fill","postage-heart-fill","postage-heart","postage","postcard-fill","postcard-heart-fill","postcard-heart","postcard","power","prescription","prescription2","printer-fill","printer","projector-fill","projector","puzzle-fill","puzzle","qr-code-scan","qr-code","question-circle-fill","question-circle","question-diamond-fill","question-diamond","question-lg","question-octagon-fill","question-octagon","question-square-fill","question-square","question","quora","quote","r-circle-fill","r-circle","r-square-fill","r-square","radioactive","rainbow","receipt-cutoff","receipt","reception-0","reception-1","reception-2","reception-3","reception-4","record-btn-fill","record-btn","record-circle-fill","record-circle","record-fill","record","record2-fill","record2","recycle","reddit","regex","repeat-1","repeat","reply-all-fill","reply-all","reply-fill","reply","rewind-btn-fill","rewind-btn","rewind-circle-fill","rewind-circle","rewind-fill","rewind","robot","rocket-fill","rocket-takeoff-fill","rocket-takeoff","rocket","router-fill","router","rss-fill","rss","rulers","safe-fill","safe","safe2-fill","safe2","save-fill","save","save2-fill","save2","scissors","scooter","screwdriver","sd-card-fill","sd-card","search-heart-fill","search-heart","search","segmented-nav","send-check-fill","send-check","send-dash-fill","send-dash","send-exclamation-fill","send-exclamation","send-fill","send-plus-fill","send-plus","send-slash-fill","send-slash","send-x-fill","send-x","send","server","share-fill","share","shield-check","shield-exclamation","shield-fill-check","shield-fill-exclamation","shield-fill-minus","shield-fill-plus","shield-fill-x","shield-fill","shield-lock-fill","shield-lock","shield-minus","shield-plus","shield-shaded","shield-slash-fill","shield-slash","shield-x","shield","shift-fill","shift","shop-window","shop","shuffle","sign-dead-end-fill","sign-dead-end","sign-do-not-enter-fill","sign-do-not-enter","sign-intersection-fill","sign-intersection-side-fill","sign-intersection-side","sign-intersection-t-fill","sign-intersection-t","sign-intersection-y-fill","sign-intersection-y","sign-intersection","sign-merge-left-fill","sign-merge-left","sign-merge-right-fill","sign-merge-right","sign-no-left-turn-fill","sign-no-left-turn","sign-no-parking-fill","sign-no-parking","sign-no-right-turn-fill","sign-no-right-turn","sign-railroad-fill","sign-railroad","sign-stop-fill","sign-stop-lights-fill","sign-stop-lights","sign-stop","sign-turn-left-fill","sign-turn-left","sign-turn-right-fill","sign-turn-right","sign-turn-slight-left-fill","sign-turn-slight-left","sign-turn-slight-right-fill","sign-turn-slight-right","sign-yield-fill","sign-yield","signal","signpost-2-fill","signpost-2","signpost-fill","signpost-split-fill","signpost-split","signpost","sim-fill","sim","sina-weibo","skip-backward-btn-fill","skip-backward-btn","skip-backward-circle-fill","skip-backward-circle","skip-backward-fill","skip-backward","skip-end-btn-fill","skip-end-btn","skip-end-circle-fill","skip-end-circle","skip-end-fill","skip-end","skip-forward-btn-fill","skip-forward-btn","skip-forward-circle-fill","skip-forward-circle","skip-forward-fill","skip-forward","skip-start-btn-fill","skip-start-btn","skip-start-circle-fill","skip-start-circle","skip-start-fill","skip-start","skype","slack","slash-circle-fill","slash-circle","slash-lg","slash-square-fill","slash-square","slash","sliders","sliders2-vertical","sliders2","smartwatch","snapchat","snow","snow2","snow3","sort-alpha-down-alt","sort-alpha-down","sort-alpha-up-alt","sort-alpha-up","sort-down-alt","sort-down","sort-numeric-down-alt","sort-numeric-down","sort-numeric-up-alt","sort-numeric-up","sort-up-alt","sort-up","soundwave","speaker-fill","speaker","speedometer","speedometer2","spellcheck","spotify","square-fill","square-half","square","stack-overflow","stack","star-fill","star-half","star","stars","steam","stickies-fill","stickies","sticky-fill","sticky","stop-btn-fill","stop-btn","stop-circle-fill","stop-circle","stop-fill","stop","stoplights-fill","stoplights","stopwatch-fill","stopwatch","strava","stripe","subscript","subtract","suit-club-fill","suit-club","suit-diamond-fill","suit-diamond","suit-heart-fill","suit-heart","suit-spade-fill","suit-spade","sun-fill","sun","sunglasses","sunrise-fill","sunrise","sunset-fill","sunset","superscript","symmetry-horizontal","symmetry-vertical","table","tablet-fill","tablet-landscape-fill","tablet-landscape","tablet","tag-fill","tag","tags-fill","tags","taxi-front-fill","taxi-front","telegram","telephone-fill","telephone-forward-fill","telephone-forward","telephone-inbound-fill","telephone-inbound","telephone-minus-fill","telephone-minus","telephone-outbound-fill","telephone-outbound","telephone-plus-fill","telephone-plus","telephone-x-fill","telephone-x","telephone","tencent-qq","terminal-dash","terminal-fill","terminal-plus","terminal-split","terminal-x","terminal","text-center","text-indent-left","text-indent-right","text-left","text-paragraph","text-right","text-wrap","textarea-resize","textarea-t","textarea","thermometer-half","thermometer-high","thermometer-low","thermometer-snow","thermometer-sun","thermometer","three-dots-vertical","three-dots","thunderbolt-fill","thunderbolt","ticket-detailed-fill","ticket-detailed","ticket-fill","ticket-perforated-fill","ticket-perforated","ticket","tiktok","toggle-off","toggle-on","toggle2-off","toggle2-on","toggles","toggles2","tools","tornado","train-freight-front-fill","train-freight-front","train-front-fill","train-front","train-lightrail-front-fill","train-lightrail-front","translate","trash-fill","trash","trash2-fill","trash2","trash3-fill","trash3","tree-fill","tree","trello","triangle-fill","triangle-half","triangle","trophy-fill","trophy","tropical-storm","truck-flatbed","truck-front-fill","truck-front","truck","tsunami","tv-fill","tv","twitch","twitter","type-bold","type-h1","type-h2","type-h3","type-italic","type-strikethrough","type-underline","type","ubuntu","ui-checks-grid","ui-checks","ui-radios-grid","ui-radios","umbrella-fill","umbrella","unindent","union","unity","universal-access-circle","universal-access","unlock-fill","unlock","upc-scan","upc","upload","usb-c-fill","usb-c","usb-drive-fill","usb-drive","usb-fill","usb-micro-fill","usb-micro","usb-mini-fill","usb-mini","usb-plug-fill","usb-plug","usb-symbol","usb","valentine","valentine2","vector-pen","view-list","view-stacked","vimeo","vinyl-fill","vinyl","virus","virus2","voicemail","volume-down-fill","volume-down","volume-mute-fill","volume-mute","volume-off-fill","volume-off","volume-up-fill","volume-up","vr","wallet-fill","wallet","wallet2","watch","water","webcam-fill","webcam","wechat","whatsapp","wifi-1","wifi-2","wifi-off","wifi","wikipedia","wind","window-dash","window-desktop","window-dock","window-fullscreen","window-plus","window-sidebar","window-split","window-stack","window-x","window","windows","wordpress","wrench-adjustable-circle-fill","wrench-adjustable-circle","wrench-adjustable","wrench","x-circle-fill","x-circle","x-diamond-fill","x-diamond","x-lg","x-octagon-fill","x-octagon","x-square-fill","x-square","x","xbox","yelp","yin-yang","youtube","zoom-in","zoom-out"];function IconSelector({initialValue:$,onIconSelect:rA}){const[tA,AA]=reactExports.useState(!1),[eA,nA]=reactExports.useState($),[oA,iA]=reactExports.useState(null),lA=reactExports.useRef([]),{x:aA,y:sA,strategy:cA,refs:pA,context:uA}=useFloating({whileElementsMounted:P$1,open:tA,onOpenChange:AA,placement:"bottom-start",middleware:[b$3({padding:10}),B$1({apply({availableHeight:CA,elements:xA}){Object.assign(xA.floating.style,{maxHeight:`${CA}px`})},padding:10})]}),gA=useRole(uA,{role:"listbox"}),fA=useDismiss(uA),wA=useListNavigation(uA,{listRef:lA,activeIndex:oA,onNavigate:iA,virtual:!0,loop:!0}),{getReferenceProps:BA,getFloatingProps:EA,getItemProps:QA}=useInteractions([gA,fA,wA]);function dA(CA){let xA=CA.target.value;xA=xA.replace(/\s+/g,"-"),AlphaNumericRegex.test(xA)&&nA(xA),xA?(AA(!0),iA(0)):AA(!1)}const yA=CA=>{nA(CA),AA(!1),rA(CA),iA(null)},hA=FilterIconsList(eA),vA=hA===null?null:hA[oA??0];return jsxs("div",{className:mergeClasses("flex items-center gap-2 pl-2"),children:[jsx(BsIcon,{icon_name:vA??"bootstrap",className:"w-4"}),jsx("input",{...BA({ref:pA.setReference,onChange:dA,value:eA,placeholder:"Search for icon...","aria-autocomplete":"list",className:"w-40",onKeyDown(CA){CA.key==="Enter"&&oA!=null&&hA&&hA[oA]&&yA(hA[oA])}})}),jsx(FloatingPortal,{children:tA&&jsx(FloatingFocusManager,{context:uA,initialFocus:-1,visuallyHiddenDismiss:!0,children:jsx("div",{...EA({ref:pA.setFloating,className:"z-10 flex flex-col w-40 max-h-96 overflow-auto rounded bg-white shadow-md",style:{position:cA,left:aA??0,top:sA??0}}),role:"listbox",children:hA?hA.map((CA,xA)=>jsx(IconResult,{...QA({ref(IA){lA.current[xA]=IA},onClick(){yA(CA)}}),active:oA===xA,icon:CA,divider:xA!==hA.length-1},CA)):jsx(IconResult,{icon:"EmojiFrown",active:!1,label:"No results"})})})})]})}const IconResult=reactExports.forwardRef(({icon:$,label:rA,active:tA,divider:AA,...eA},nA)=>{const oA=reactExports.useId();return jsxs(Fragment,{children:[jsxs("div",{ref:nA,role:"option",id:oA,className:mergeClasses("grid grid-cols-[20px_1fr] gap-1 cursor-pointer px-3 py-2 items-center","[&[aria-selected='true']]:bg-rstudio-blue [&[aria-selected='true']]:text-white"),"aria-selected":tA,"aria-label":$,...eA,children:[jsx(BsIcon,{icon_name:$}),jsx("span",{children:rA??$})]}),AA&&jsx(ListDivider,{})]})});function ListDivider(){return jsx("div",{className:"bg-light-grey h-[1px] text-transparent select-none",children:"divider"})}const AlphaNumericRegex=/^[A-Za-z0-9-]*$/;function FilterIconsList($){const rA=allBsIconNames.filter(tA=>tA.toLowerCase().startsWith($.toLowerCase()));return rA.length>0?rA:null}const ValueBox=({namedArgs:$,children:rA,path:tA,wrapperProps:AA})=>{const eA=$.showcase_layout==="right";return jsx("div",{className:"flex-1 relative",style:{"--font-color":"var(--rstudio-white","--selected-outline-color":"black"},...AA,children:jsxs("div",{className:mergeClasses("bg-primary text-white h-100 grid gap-md p-md overflow-auto",eA?"grid-cols-[7fr_3fr]":"grid-cols-[3fr_7fr]"),children:[jsx("div",{className:mergeClasses("p-sm col-start-1 row-start-1 min-w-0",eA?"col-start-2":"col-start-1"),children:jsx(BsIcon,{className:"w-100 h-100",icon_name:$.showcase_icon??"question-circle"})}),jsxs("div",{className:mergeClasses("flex flex-col justify-center row-start-1 min-w-0",eA?"col-start-1":"col-start-2"),children:[jsx("h5",{className:"",children:$.title}),jsx("div",{children:jsx(DropWatcherPanel,{className:$.value.id==="textNode"?"text-[1.5rem]":"",existing_node:$.value,child_loc:"value",parentPath:tA,messageOnHover:$.value?"Replace value":"Drop a value node here",parentNodeType:"value_box"})}),jsx(ChildrenWithDropNodes,{children:rA,parentPath:tA,parentid:"value_box",messageOnHover:"Add node to value box"})]})]})})},bslibValueBoxInfo=addEditorInfoToUiNode(value_box,{iconSrc:icon$a,UiComponent:ValueBox,settingsFormRender:({settings:$,onSettingsChange:rA,inputs:tA})=>jsxs("div",{children:[jsx(InputLabelWrapper,{label:`Showcase ${$.showcase_icon?"Icon":"Value"}`,labelId:"showcase-icon",mainInput:$.showcase_icon?jsx(IconSelector,{initialValue:$.showcase_icon,onIconSelect:AA=>{rA==null||rA("showcase_icon",{type:"UPDATE",value:AA})}}):jsx(PopoverButton,{className:"w-100 h-[25px]",use_markdown:!0,popoverContent:`Replace current showcase value with an icon from the bsicons package.`,onClick:()=>{rA==null||rA("showcase_icon",{type:"UPDATE",value:"database"})},children:"Replace with icon"})}),jsx(InputLabelWrapper,{label:"Showcase Direction",labelId:"showcase-direction",mainInput:jsx(RadioInputs,{id:"showcase-direction",label:"Showcase Direction",value:$.showcase_layout??"left",onChange:AA=>{rA==null||rA("showcase_layout",AA==="left"?{type:"REMOVE"}:{type:"UPDATE",value:AA})},optionsPerColumn:2,choices:{left:{label:"Left"},right:{label:"Right"}}})}),Object.values(tA)]})}),styles$c="",icon$7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAACXBIWXMAABYlAAAWJQFJUiTwAAAEA0lEQVR4nO3du24cZRyG8ceIQ0FKuINtEBEHK1IqXwEIylUiKmwp0KO5iK3ScZATGoQ1JQi4ATehiAMSEc223EGIFFMsxcyCZaEVG++7M//V82vGa49X32c9+400I8/sLRYLpE17YegBaDcZliIMSxGGpQjDUoRhKcKwFGFYijAsRRiWIgxLEYalCMNShGEpwrAUYViKMCxFGJYiDEsRhqUIw1KEYSnCsBRhWIowLEUYliIMSxGGpQjDUoRhKcKwFGFYijAsRRiWIgxLEYalCMNShGEpwrAUYViKMCxFGJYiDEsRhqUIw1KEYSnCsBRhWIowLEUYliJeHHoA62ra+eVv7QO3gAPgTeDatse0YU+Ax8ApcAKcXfzhbDoZYkxrq75iHQMPgc+Am9SPCro53KSb00PguEpMF5VbsS74DvgAOAe+oPt0/zabTp78n1/uV77lk9b3AuP7573XCaNp59eA63Sr8CfAYdPOXwc+3PgIg6qGdUwX1R/A+7Pp5Jdhh7M5/QfjAfCgaedfAz/QzfUecDjk2NZR8VD4Lt0f+Jwdi+qyfm7vAc+Aj+nmXkLFsG732y93Oaql2XTyK/BV//L2qn3HpGJYB/3220FHsV3LuR6s3GtEKoa132/PVu61Wx71Ww+FQS8BzKaT86EHsi2z6eRZ/+XLgw5kDRXDUgGGpQjDUkTVE6T/dc1wtCqNdVPKhsW/l0zG9l7bfO/R8lCoiMor1iYuHG/lIvSG368EVyxFGJYiDEsRhqUIw1KEYSnCsBRhWIqofILUSzoj5oqliMorlpd0RswVSxGGpQjDUoRhKcKwFGFYijAsRRiWIiqfIPWSzoi5Yimi8orlJZ0RKxvWVW/4us3/Tt7EzWmr/Te1h0JFGJYiDEsRFcP6C6Bp52XubndV/b3foXtqRQkVw1ree3R/5V675Xq/fTzoKNZQMazTfntr0FFs13Kupyv3GpGKYZ302ztNO3970JFsQdPO3wLu9C9PVu07JhXDOgPuA68APzbt/J1hh5PTf3B+opvrfQrdgrzqCdJD4DW6Z8z83LTzz4FvgN9n08mfg47sipp2/irwBvAR8CndLbi/p9BzdAD2FotSVwoun4E+ptgf/Dncm00nR8t5V3nEXMVD4UVHwA3gLt2z/Z4OOprNeEo3l7vAjdl0cjTscJ5PuRVLNVRfsTRShqUIw1KEYSnCsBRhWIowLEUYliIMSxGGpQjDUoRhKcKwFGFYijAsRRiWIgxLEYalCMNShGEpwrAUYViKMCxFGJYiDEsRhqUIw1KEYSnCsBRhWIowLEUYliIMSxGGpQjDUoRhKcKwFGFYijAsRRiWIgxLEYalCMNShGEpwrAUYViKMCxFGJYi/gbCBJi6eIkmgAAAAABJRU5ErkJggg==",InputOutputTitle=({type:$,name:rA,className:tA})=>jsxs("code",{className:tA,children:[jsxs("span",{style:{opacity:.55},children:[$,"$"]}),jsx("span",{children:rA})]}),dtDTOutputInfo=addEditorInfoToUiNode(output_dt,{iconSrc:icon$7,UiComponent:({namedArgs:$,path:rA,wrapperProps:tA})=>jsx("div",{className:"dtDTOutput",...tA,children:jsxs("div",{className:"faux-table",style:{"--table-w":$.width,"--table-h":$.height},children:[jsxs("div",{className:"faux-header",children:["Table: ",jsx(InputOutputTitle,{type:"output",name:$.outputId})]}),jsx("div",{className:"faux-table-body",children:table_cells})]})})}),NUM_COLS=4,NUM_ROWS=25,table_cells=seqArray(NUM_ROWS).map($=>jsx("div",{className:"faux-row",children:seqArray(NUM_COLS).map(rA=>jsx("div",{className:"faux-cell",children:"i"},rA))},$)),gridAwareNodeNamesTuple=["grid_card","grid_card_plot","grid_card_text"],gridItemNodes=new Set(gridAwareNodeNamesTuple);function isValidGridItem($){return gridItemNodes.has($.id)}const validGridContainerNodeNames=["grid_page","grid_container"];function isValidGridContainer($){return validGridContainerNodeNames.includes($.id)}const hoveringOverSwap="_hoveringOverSwap_l95oj_1",availableToSwap="_availableToSwap_l95oj_2",pulse="_pulse_l95oj_1",emptyGridCard="_emptyGridCard_l95oj_52",emptyMessage="_emptyMessage_l95oj_69",classes$o={hoveringOverSwap,availableToSwap,pulse,emptyGridCard,emptyMessage},LayoutDispatchContext=React.createContext(null);function useSetLayout(){return React.useContext(LayoutDispatchContext)}function useGridItemSwapping({path:$,area:rA}){const tA=useCurrentDraggedNode(),AA=useSetLayout(),eA=React.useCallback(({node:iA,currentPath:lA})=>lA===void 0||!isValidGridItem(iA)?!1:nodesAreSiblings(lA,$),[$]),nA=React.useCallback(iA=>{if(!("area"in iA.node.namedArgs)){console.error("Invalid grid area swap drop",{dropInfo:iA});return}const lA=iA.node.namedArgs.area??"__BAD_DROP__";AA==null||AA({type:"SWAP_ITEMS",item_a:rA,item_b:lA})},[rA,AA]),oA=useFilteredDrop({getCanAcceptDrop:eA,onDrop:nA,canAcceptDropClass:classes$o.availableToSwap,hoveringOverClass:classes$o.hoveringOverSwap});return React.useEffect(()=>{oA.current&&(oA.current.dataset.gridArea=rA)},[rA,oA]),React.useEffect(()=>{oA.current&&(tA!=null&&tA.node)&&"area"in tA.node.namedArgs&&(oA.current.dataset.swapWith=tA.node.namedArgs.area)},[tA==null?void 0:tA.node,oA]),oA}const GridlayoutGridCard=$=>{const{namedArgs:{area:rA,...tA},children:AA=[],path:eA,wrapperProps:nA}=$,oA=useGridItemSwapping({area:rA,path:eA});return jsx(BslibCardContainer,{ref:oA,style:{gridArea:rA},card_args:tA,...nA,children:renderCardElements(AA,eA)})},gridlayoutCardInfo=addEditorInfoToUiNode(grid_card,{UiComponent:GridlayoutGridCard}),plotIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAACXBIWXMAABYlAAAWJQFJUiTwAAACYElEQVR4nO3cMYoUQQBA0RqRPYBn8E5GhqYbLiZeYDNzs428k1dwU8M2UGFZFmYUf/d013vRTEFDBZ+qomj6tCzLgP/t1dYT4JiERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEXi9dYT+Fd3X78tz4ZOm0xkJffv3m49hb9ixSIhrPNuxhifxxjfxxiPv3/fbDqjHdjtVrii+zHG7ZP/t2OMH2OMj9tMZx+sWOe9f2Hsw+qz2BlhnffmwjGeEBYJYZEQFglhkRAWCWF1pr5YdUHamfpi1YrVmfpiVVidqS9WZwpr6jPP2mY6Y0195lnbTCvW1Geetc0U1tRnnrXNFBYrEhYJYZEQFglhkRAWCWGREBYJYZEQFglhkRAWiZnCerxwbOvnDmGmsB5eGPtyhc8dwkwv+t2NXx9n+/Ne1sMY49MVPncIp2V5/mG8ffBFv+s201bIioRF4khnrH3u6Zfb1VZvxSIhLBLCIrHb6waumxWLhLBICIuEsEgIi4SwSAiLhLBICIuEsEgIi4SwSAiLhLBICIuEsEgIi4SwSAiLhLBICIuEsEgIi4SwSAiLhLBICIuEsEgIi4SwSAiLhLBICIuEsEgIi4SwSAiLhLBICIuEsEgIi4SwSAiLhLBICIuEsEgIi4SwSAiLhLBICIuEsEgIi8RPaOk2ptnQzzIAAAAASUVORK5CYII=";function GoGraph($){return GenIcon({tag:"svg",attr:{viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z"}}]})($)}const container$d="_container_1rlbk_1",plotPlaceholder="_plotPlaceholder_1rlbk_5",label$1="_label_1rlbk_19",classes$n={container:container$d,plotPlaceholder,label:label$1};function StaticPlotPlaceholder({outputId:$}){const rA=reactExports.useRef(null),tA=useContainerDimensions(rA),AA=tA===null?100:Math.min(tA.width,tA.height);return jsxs("div",{ref:rA,className:classes$n.plotPlaceholder,"aria-label":"shiny::plotOutput placeholder",children:[jsx(InputOutputTitle,{className:classes$n.label,type:"output",name:$}),jsx(GoGraph,{size:`calc(${AA}px - 80px)`})]})}function useContainerDimensions($){const[rA,tA]=reactExports.useState(null);return reactExports.useEffect(()=>{if(typeof ResizeObserver>"u")return;const AA=new ResizeObserver(eA=>{if(!$.current)return;const{offsetHeight:nA,offsetWidth:oA}=$.current;tA({width:oA,height:nA})});return $.current&&AA.observe($.current),()=>AA.disconnect()},[$]),rA}const BsCard=React.forwardRef(({className:$="",children:rA,...tA},AA)=>{const eA=$+" card";return jsx("div",{ref:AA,className:eA,...tA,children:rA})}),gridCardPlot="_gridCardPlot_1a94v_1",classes$m={gridCardPlot},GridlayoutGridCardPlot=({namedArgs:{outputId:$,area:rA},path:tA,wrapperProps:AA})=>{const eA=useGridItemSwapping({area:rA,path:tA});return jsx(BsCard,{ref:eA,style:{gridArea:rA},className:mergeClasses(classes$m.gridCardPlot,"gridlayout-gridCardPlot"),...AA,children:jsx(StaticPlotPlaceholder,{outputId:$??rA})})},gridlayoutGridCardPlotInfo=addEditorInfoToUiNode(grid_card_plot,{iconSrc:plotIcon,UiComponent:GridlayoutGridCardPlot}),icon$6="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAACXBIWXMAABYlAAAWJQFJUiTwAAAFn0lEQVR4nO3b4VHjRgCG4c+ZNMCV4BtVwJVgSjiiCqACJZRgogqgAuUoAZcAFShHC5RAfnh9rBdJFsaf8TrvM5MZzvZJTvxmtVovk5eXFwG79ttnvwEcJ8KCBWHBgrBgQViwICxYEBYsCAsWhAULwoIFYcGCsGBBWLAgLFgQFiwICxaEBQvCggVhwYKwYEFYsCAsWBAWLAgLFoQFC8KCBWHBgrBgQViwICxYEBYsCAsWhAULwoIFYcGCsGBBWLAgLFgQFiwICxaEBQvCggVhwYKwYEFYsCAsWBAWLAgLFoQFC8KCBWHBgrBgQViwICxYEBYsCAsWhAULwoIFYcHi989+A2NMJpNRr6uadibpPnn4rC6LxXvP2XGsy7osbt97HJeXl5fPfguDjm3E+j7yMZgdTVhV056oO6KL8Bz26GjC0jKqvoAu9vlGcHxhrdxJiudVhLVnRxFW1bRTSbPoobvwz8o0TMaxJ0cRltZHq+e6LFZhPUePM2rt0bGEFUdzJ0l1WTxrfdT6ziR+f7JYxxoSLnHT6KG75Oc4ugtJ1zs4519ajpKn0cMLSYu6LN59/HC8U729q936mJ9tcugLbdLwAmnVtDd6jeepLouvyfM/9Rrem+cHjvtmgVTSk6QbrYecepZ0PmZRtmrai3C8Mc7DJV4SC6RWHWtXdx0vi1fLPzKJP9UytKGopOWSx33VtIMLs+F/iLFRSdKPMLJlIeuwtByp4nlTV1jpY9tO4uO/dyvpW10Wk7osJpK+dZznJtytvlE17bzjfVxL+hod84ukq+Q181zubrO+FFZN+6DXec5jXRbfel53r/XliC9hct+r53vHwctcCCYeVW7rsrjccNxnLb/PfOw55qmkh+ihRV0WZ4f+uWU7YoX/4PHkuWu06ntum1FrFUDv3Kkuiyst52G/ztNxJ5qe+7IvqnDMR63fcMz6RsJDkm1YensHtSmsj65pXQ8FEEl3QPwaKTvmhIt4Qj4gPe9p56sOSM7LDXEci7osnvpeWJfFc9W08dLDtGra7yM/1JXBS2f8XpI/n+o1+nR+NGo7T3ifa/OBv//gUrhz4Y5r06Q9lb7Gsp2mY1Sb9vwsvR2JjkauI1YaxU24fX/XMaqmnQ6NdB/wpNeIhlb7Hec+CNmNWAP7rrax702A/5uvlLILS7v9Mtn1xXRfQGPnadnL8VK4tpNBy0XF0R9Ysqa1zSR+jDisocvddMPz2cpqxOpau3pPVKu/k/x5p6NWeI+xp56fpQyWDbaV24j1nrWrPneS5nodVWY7nsQPLSmkywszjdhtEe6Cf0QPnWu7f/e9yWrE0vro8rzNr3V17NOSxk3iN068w41F/B6f4uWHjnPPNn1ZHaQj28EvU2QTVsfa1Ud+xy8Na8yugfmI3QXplpqu0Sh93zcdl89fwnPxeQcXgw9FNmHp7Vxo60tBGOniD+dk5Mgxr5r2IQ2satpZuCmIj/HY9Quu4dxxcCeSHqqmncffAVZNexK+1H5IDpHFpr8sdjf8+c+/U0k/o4d6dzKMFeKYRw8t6rI4i57v2t0w1pOW22p6byySDYpjXa12kx7655bLiLWLSXsqPcamXQNjz7nQhqgkKWynuRx6TeI8py3KuYS1s8vgSpinpJP/oRFkETbgXfWc/1rLbTVnY5dA6rK43XDMhZaj1MSw1maVxaUQ+cllxEJmCAsWhAULwoIFYcGCsGBBWLAgLFgQFiwICxaEBQvCggVhwYKwYEFYsCAsWBAWLAgLFoQFC8KCBWHBgrBgQViwICxYEBYsCAsWhAULwoIFYcGCsGBBWLAgLFgQFiwICxaEBQvCggVhwYKwYEFYsCAsWBAWLAgLFoQFC8KCBWHBgrBgQViwICxYEBYsCAsWhAULwoIFYcGCsGBBWLAgLFgQFiwICxaEBQvCgsV/EcmMRmtHHXoAAAAASUVORK5CYII=",GridlayoutGridCardText=({namedArgs:{content:$,area:rA,alignment:tA},path:AA,wrapperProps:eA})=>{const nA=useGridItemSwapping({area:rA,path:AA});return jsx(BsCard,{ref:nA,className:"bg-white w-full h-full relative gridlayout-textPanel flex flex-row items-center px-3",style:{gridArea:rA,justifyContent:tA},...eA,children:jsx("h1",{className:"text-3xl",children:$})})},gridlayoutTextPanelInfo=addEditorInfoToUiNode(grid_card_text,{iconSrc:icon$6,UiComponent:GridlayoutGridCardText}),gridIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAACXBIWXMAABYlAAAWJQFJUiTwAAAEVklEQVR4nO3cwYpcRRiG4XeMjouYGzAuXGThyohG1GvQxQQSJVfgRhkUnOANCCYLh6ALvQBBQkxE9BqiKEZ3wixcZO4gm4xIu6geaE+PDMp8VZU67wNncc5ppqqrP7r++Q/0xmKxQDppj7WegMZksBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBRhsBTxeK2Bdr7aO+ryJrC1PF4Dnl5e25i8bvqTON5fv/8AuA/8AtwGvgEOJq/j2lvnppciqgXrCBeBa0Cddzq+p4DnlscVYA+4CnzdYjIttsJTwMeUN2yocs4Btyhrfar24C2+sT4CdhqMO1eHa3215qC1v7EusR6qA+AGpcY6w3r9wPLa6uH99ftnKGt4g/Xaaoey9tXUDNYm8Mnk2j7wCrAN3KUUoPp/HlDWcJuypvuT+7uUz6CKmsG6DDyzcn4AvAHcqziHubgHvA48XLl2Fniz1gRqBmtrcv45hirpV+CLybWtWoPXDNbLk/MvT/BvLyaHiukaX6g1cM3/Cp+dnFfb72fsLkcX+3EtH+msdYU1Dp8VKqLlI52T1OTrXv+uZrCOe5CqjCbr7laoCIOliFFqLLfZztQMlh92G7PrY2lgBksRo9RYbrOdsY81PvtYGofBUsQoNZbbbGfsY43PPpbGYbAUMUqN5TbbGftY47OPpXEYLEWMUmO5zXbGPtb47GNpHAZLEaPUWG6znbGPNT77WBqHwVLEKDVWD7+z3sv9LkoM+1jjs4+lcRgsRYxSYx33dT/3+9XZxxqffSyNw2ApYpQaq6dttqe5NGMfa3z2sTQOg6WIUWqsnrbZnubSjH2s8dnH0jgMliJGqbF62mZ7mksz9rHGZx9L4zBYihilxuppm+1pLs3YxxqffSyNw2ApYpQaq6dttqe5NGMfa3z2sTQOg6WIlsHabDi2wmoG63dKYXt4vHiCf3tjcrTU01xe5Z9r/ketgWsG67fJ+ZWKY8/VdI1/qjVwzWDdmZy/DZyvOP7cPE9Z41V3ag1eM1g3gfsr508C3wEvVJzDXJwHvqes8aF9ymdQRc1gHQDvT66dBX4AdoELwOmK8xnNacoa7gI/UtZ21XvAw1qTqd15vwlcBz5YubYJbC+PQz3/Yt6jcH/qOhW/raBNu+FD4NMG487VZ5Q1r6pFsP4C3gUuAXsNxp+LPeAy8A5lzatq+RD6FvAt5c1fBF6i1AVPNJzTo+xPSoH+M3CbsvUdtJrMxmJx3PYs/Xc+K1SEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVKEwVLE32A0lLomuWLgAAAAAElFTkSuQmCC";var collectionClone=clone;function clone($){let rA=$;var tA={}.toString.call($).slice(8,-1);if(tA=="Set")return new Set([...$].map(eA=>clone(eA)));if(tA=="Map")return new Map([...$].map(eA=>[clone(eA[0]),clone(eA[1])]));if(tA=="Date")return new Date($.getTime());if(tA=="RegExp")return RegExp($.source,getRegExpFlags($));if(tA=="Array"||tA=="Object"){rA=Array.isArray($)?[]:{};for(var AA in $)rA[AA]=clone($[AA])}return rA}function getRegExpFlags($){if(typeof $.source.flags=="string")return $.source.flags;var rA=[];return $.global&&rA.push("g"),$.ignoreCase&&rA.push("i"),$.multiline&&rA.push("m"),$.sticky&&rA.push("y"),$.unicode&&rA.push("u"),rA.join("")}function matrixDimensions($){const rA=$.length,tA=$[0].length;for(let AA of $)if(AA.length!==tA)throw new Error("Inconsistant number of columns in matrix");return{numRows:rA,numCols:tA}}function insertRowOrCol($,{index:rA,arr:tA,dir:AA}){const eA=collectionClone($);switch(AA){case"rows":return addAtIndex(eA,rA,tA);case"cols":return eA.map((nA,oA)=>addAtIndex(nA,rA,tA[oA]))}}function removeRowOrCol($,{index:rA,dir:tA}){const AA=collectionClone($);switch(tA){case"rows":return removeAtIndex(AA,rA);case"cols":return AA.map((eA,nA)=>removeAtIndex(eA,rA))}}const emptyCell=".";function areasToItemLocations($){const rA=new Map;return areasToItemCells($).forEach(({itemRows:tA,itemCols:AA},eA)=>{if(eA===emptyCell)return;const nA=arrayRange(tA),oA=arrayRange(AA);rA.set(eA,{colStart:oA.minVal,rowStart:nA.minVal,colSpan:oA.span+1,rowSpan:nA.span+1,isValid:nA.isSequence&&oA.isSequence})}),rA}function areasToItemCells($){const rA=new Map,{numRows:tA,numCols:AA}=matrixDimensions($);for(let eA=0;eA{cA!==emptyCell&&oA.add(cA)});const sA=aA.length;if(eA===-1&&(eA=sA),eA!==sA)throw new Error("Invalid layout definition. Not consistant number of columns in every row")}if(!tA)tA=fillArr("1fr",eA);else if(tA.length!==eA)throw new Error("Column sizes vector doesn't match layout definition.");if(!rA)rA=fillArr("1fr",nA);else if(rA.length!==nA)throw new Error("Row sizes vector doesn't match layout definition.");return{uniqueAreas:[...oA],areas:iA,col_sizes:tA,row_sizes:rA,gap_size:AA??"12px"}}function convertLayoutTableToMatrix($){const rA=[];for(let tA of $)rA.push(tA.trim().split(/\s+/));return rA}function convertTemplatedLayoutToGridlayoutArgs({areas:$,...rA}){return{layout:makeColumnAlignedTable($),...rA}}function convertGridlayoutArgsToTemplatedLayout({layout:$,...rA}){return{areas:convertLayoutTableToMatrix($),...rA}}function makeColumnAlignedTable($){const{numCols:rA}=matrixDimensions($),tA=[],AA=fillArr(-1,rA);for(let eA of $)for(let nA=0;nAnA+oA.padEnd(AA[iA]," ")+(iA1,sA=AA>1,cA=[];return(rowIsFree({colRange:lA,rowIndex:$-1,layoutAreas:eA})||aA)&&cA.push("up"),(rowIsFree({colRange:lA,rowIndex:nA+1,layoutAreas:eA})||aA)&&cA.push("down"),(colIsFree({rowRange:iA,colIndex:tA-1,layoutAreas:eA})||sA)&&cA.push("left"),(colIsFree({rowRange:iA,colIndex:oA+1,layoutAreas:eA})||sA)&&cA.push("right"),cA}function rowIsFree({colRange:$,rowIndex:rA,layoutAreas:tA}){return rA<1||rA>tA.length?!1:$.every(AA=>tA[rA-1][AA-1]===emptyCell)}function colIsFree({rowRange:$,colIndex:rA,layoutAreas:tA}){return rA<1||rA>tA[0].length?!1:$.every(AA=>tA[AA-1][rA-1]===emptyCell)}const marker="_marker_mumaw_1",dragger="_dragger_mumaw_32",move="_move_mumaw_52",classes$l={marker,dragger,move};function within($,rA,tA){const AA=rA=AA&&$<=eA}function gridLocationToExtent({rowStart:$,rowSpan:rA,colStart:tA,colSpan:AA}){return{rowStart:$,rowEnd:$+rA-1,colStart:tA,colEnd:tA+AA-1}}function sameLocation($,rA){return typeof $>"u"&&typeof rA>"u"?!0:typeof $>"u"||typeof rA>"u"?!1:("colSpan"in $&&($=gridLocationToExtent($)),"colSpan"in rA&&(rA=gridLocationToExtent(rA)),$.colStart===rA.colStart&&$.colEnd===rA.colEnd&&$.rowStart===rA.rowStart&&$.rowEnd===rA.rowEnd)}function findAvailableTracts({dragDirection:$,gridLocation:rA,layoutAreas:tA}){const{rowStart:AA,rowEnd:eA,colStart:nA,colEnd:oA}=gridLocationToExtent(rA),iA=tA.length,lA=tA[0].length;let aA,sA,cA;switch($){case"up":if(AA===1)return{shrinkExtent:eA,growExtent:1};aA=AA-1,sA=1,cA=eA;break;case"left":if(nA===1)return{shrinkExtent:oA,growExtent:1};aA=nA-1,sA=1,cA=oA;break;case"down":if(eA===iA)return{shrinkExtent:AA,growExtent:iA};aA=eA+1,sA=iA,cA=AA;break;case"right":if(oA===lA)return{shrinkExtent:nA,growExtent:lA};aA=oA+1,sA=lA,cA=nA;break}const pA=$==="up"||$==="down",uA=$==="left"||$==="up",[gA,fA]=pA?[nA,oA]:[AA,eA],wA=(QA,dA)=>{const[yA,hA]=pA?[QA,dA]:[dA,QA];return tA[yA-1][hA-1]!==emptyCell},BA=buildRange(gA,fA),EA=buildRange(aA,sA);for(let QA of EA)for(let dA of BA)if(wA(QA,dA))return{shrinkExtent:cA,growExtent:QA+(uA?1:-1)};return{shrinkExtent:cA,growExtent:sA}}function getTractExtents({dir:$,gridContainerStyles:rA,gridContainerBoundingRect:tA}){const AA=pxValToNumber(rA.getPropertyValue("gap")),nA=pxValToNumber(rA.getPropertyValue("padding"))+AA/2,oA=tA[$==="rows"?"y":"x"],iA=getGridTractSizes(rA,$),lA=iA.length,aA=[];for(let sA=0;sAwithin(nA,lA,aA));if(oA===void 0)return;const iA=handleToGridExtent[tA];return eA[iA]=oA.index,eA}const handleToGridExtent={right:"colEnd",left:"colStart",up:"rowStart",down:"rowEnd"};function useResizeOnDrag({overlayRef:$,gridLocation:rA,layoutAreas:tA,onDragEnd:AA}){const eA=gridLocationToExtent(rA),nA=React.useRef(null),oA=React.useCallback(aA=>{const sA=$.current,cA=nA.current;if(!sA||!cA)throw new Error("For some reason we are observing dragging when we shouldn't");const pA=resizeOnDrag({mousePos:aA,dragState:cA});pA&&placeItemOnGrid(sA,pA)},[$]),iA=React.useCallback(()=>{const aA=$.current,sA=nA.current;if(!aA||!sA)return;const cA=sA.gridItemExtent;sameLocation(cA,eA)||AA(cA),aA.classList.remove("dragging"),document.removeEventListener("mousemove",oA),toggleTextSelection("on")},[eA,oA,AA,$]);return React.useCallback(aA=>{const sA=$.current;if(!sA)return;const cA=sA.parentElement;if(!cA)return;const pA=getComputedStyle(sA.parentElement),uA=cA.getBoundingClientRect(),gA=aA==="down"||aA==="up"?"rows":"cols",{shrinkExtent:fA,growExtent:wA}=findAvailableTracts({dragDirection:aA,gridLocation:rA,layoutAreas:tA});nA.current={dragHandle:aA,gridItemExtent:gridLocationToExtent(rA),tractExtents:getTractExtents({dir:gA,gridContainerStyles:pA,gridContainerBoundingRect:uA}).filter(({index:BA})=>within(BA,fA,wA))},placeItemOnGrid($.current,nA.current.gridItemExtent),sA.classList.add("dragging"),document.addEventListener("mousemove",oA),document.addEventListener("mouseup",iA,{once:!0}),toggleTextSelection("off")},[iA,rA,tA,oA,$])}function toggleTextSelection($){var tA;const rA=(tA=document.querySelector("body"))==null?void 0:tA.classList;$==="off"?rA==null||rA.add("disable-text-selection"):rA==null||rA.remove("disable-text-selection")}function placeItemOnGrid($,{rowStart:rA,rowEnd:tA,colStart:AA,colEnd:eA}){$.style.setProperty("--drag-grid-row-start",String(rA)),$.style.setProperty("--drag-grid-row-end",String(tA+1)),$.style.setProperty("--drag-grid-column-start",String(AA)),$.style.setProperty("--drag-grid-column-end",String(eA+1))}function AreaOverlay({area:$,gridLocation:rA,areas:tA,onNewPos:AA}){if(typeof rA>"u")throw new Error(`Item in ${$} is not in the location map`);const eA=React.useRef(null),nA=useResizeOnDrag({overlayRef:eA,gridLocation:rA,layoutAreas:tA,onDragEnd:AA}),oA=React.useMemo(()=>availableMoves({gridLocation:rA,layoutAreas:tA}),[rA,tA]),iA=React.useMemo(()=>{let lA=[];for(let aA of oA)lA.push(jsx("div",{className:mergeClasses(classes$l.dragger,aA),title:`resize ${$} ${aA}`,onMouseDown:sA=>{stopEventPropigation(sA),nA(aA)},children:resizeDirToArrow[aA]},aA));return lA},[$,oA,nA]);return React.useEffect(()=>{var lA;(lA=eA.current)==null||lA.style.setProperty("--grid-area",$)},[$]),jsx("div",{ref:eA,onClick:stopEventPropigation,className:classes$l.marker+" grid-area-overlay",children:iA})}function stopEventPropigation($){$.preventDefault(),$.stopPropagation()}const resizeDirToArrow={up:jsx(FaGripLines,{}),down:jsx(FaGripLines,{}),left:jsx(FaGripLinesVertical,{}),right:jsx(FaGripLinesVertical,{})};function itemBoundsInDir($,rA){switch(rA){case"rows":return{itemStart:$.rowStart,itemEnd:$.rowStart+$.rowSpan-1};case"cols":return{itemStart:$.colStart,itemEnd:$.colStart+$.colSpan-1}}}function getTractSizes({areas:$,row_sizes:rA=["1fr"],col_sizes:tA=["1fr"]}){const{numRows:AA,numCols:eA}=matrixDimensions($);return{rows:buildTractSizes(AA,rA,"row"),cols:buildTractSizes(eA,tA,"column")}}function buildTractSizes($,rA,tA){if(!Array.isArray(rA))return fillArr(rA,$);if($!==rA.length)throw new Error(`Number of ${tA} sizes does not match the number of ${tA}s in the areas template. Either make sure they match or use a single ${tA} size that will be repeated for all ${tA}s.`);return rA}function addTract($,{afterIndex:rA,size:tA,dir:AA}){return fn($,eA=>{const nA=AA==="rows"?"cols":"rows",oA=getTractSizes(eA);if(rA>oA[AA].length)throw new Error(`Can't add a tract after index ${rA}. Not enought tracts.`);if(rA<0)throw new Error("Cant add a tract at a negative index");const iA=areasToItemLocations(eA.areas);let lA=fillArr(emptyCell,oA[nA].length);iA.forEach((aA,sA)=>{const{itemStart:cA,itemEnd:pA}=itemBoundsInDir(aA,AA);if(cA<=rA&&pA>rA){const gA=itemBoundsInDir(aA,nA);for(let fA=gA.itemStart-1;fA1}function itemsContainedInTract($,{index:rA,dir:tA}){let AA=[];return $.forEach((eA,nA)=>{const oA=itemBoundsInDir(eA,tA);if(!oA)return;const{itemStart:iA,itemEnd:lA}=oA;iA===rA&&iA===lA&&AA.push(nA)}),AA}const ResizableGrid="_ResizableGrid_i4cq9_1",classes$k={ResizableGrid,"size-detection-cell":"_size-detection-cell_i4cq9_1"},cleanNumber=$=>Number($.toFixed(4)),minPx=40,minFrRatio=.15,roundTo=$=>rA=>Math.round(rA/$)*$,PX_ROUND_PRECISION=5,roundPixel=roundTo(PX_ROUND_PRECISION),FR_ROUND_PRECISION=.01,roundFr=roundTo(FR_ROUND_PRECISION);function dragBothRelative($,{pixelToFrRatio:rA,beforeInfo:tA,afterInfo:AA}){const eA=roundFr($*rA),nA=tA.count+eA,oA=AA.count-eA;return(eA<0?nA/oA:oA/nA)`"${eA.join(" ")}"`).join(` `),gridTemplateRows:rA.join(" "),gridTemplateColumns:tA.join(" "),"--grid-gap":AA}}function getTractSizesFromStyleDeclaration($){return $.split(" ")}function getAreaMatrixFromStyleDeclaration($){const rA=$.match(/"([.\w\s]+)"/g);if(!rA)throw new Error("Can't parse area definition");return rA.map(tA=>tA.replaceAll('"',"").split(" "))}function getLayoutFromGridElement($){const rA=getTractSizesFromStyleDeclaration($.style.gridTemplateRows),tA=getTractSizesFromStyleDeclaration($.style.gridTemplateColumns),AA=getAreaMatrixFromStyleDeclaration($.style.gridTemplateAreas),eA=$.style.getPropertyValue("--grid-gap");return{row_sizes:rA,col_sizes:tA,areas:AA,gap_size:eA}}function getTractSizesInPx({container:$,dir:rA}){return getComputedStyle($).getPropertyValue(rA==="rows"?"grid-template-rows":"grid-template-columns").split(" ").map(tA=>Number(tA.replaceAll("px","")))}function getDragInfo($,rA){const tA=getUnitInfo($),AA=rA===null?"missing":getUnitInfo(rA);if(tA.type==="pixel"&&(AA==="missing"||AA.type==="fr"))return{type:"before-pixel",beforeInfo:tA};if(AA==="missing")throw new Error("Somehow have a final tract drag without a pixel valued tract before....");return tA.type==="pixel"&&AA.type==="pixel"?{type:"both-pixel",beforeInfo:tA,afterInfo:AA}:tA.type==="fr"&&AA.type==="pixel"?{type:"after-pixel",afterInfo:AA}:tA.type==="fr"&&AA.type==="fr"?{type:"both-relative",beforeInfo:tA,afterInfo:AA}:{type:"unsupported"}}function getPxToFrRatioForRelativeTracts({container:$,index:rA,dir:tA,frCounts:AA}){const eA=getTractSizesInPx({container:$,dir:tA}),nA=eA[rA-2],oA=eA[rA-1];return(AA.before+AA.after)/(oA+nA)}function initDragState({mousePosition:$,dir:rA,index:tA,container:AA}){const eA=rA==="rows"?"gridTemplateRows":"gridTemplateColumns";let nA=AA.style[eA].split(" ");const oA=getHasAutoUnits(nA),iA=getHasRelativeUnits(nA);oA&&!iA&&(nA=getComputedStyle(AA).getPropertyValue(rA==="rows"?"grid-template-rows":"grid-template-columns").split(" ").slice(0,nA.length),AA.style[eA]=nA.join(" ")),oA&&iA&&console.warn("There's a mixture of auto and relative units in the grid. This may cause funky behavior on resize. To prevent this switch to only relative or auto units");const lA=tA-2,aA=lA+1;let sA=nA[lA],cA=aA>=nA.length?null:nA[aA];if(sA==="auto"||cA==="auto"){const gA=getComputedStyle(AA).getPropertyValue(rA==="rows"?"grid-template-rows":"grid-template-columns").split(" ");sA==="auto"&&(sA=gA[lA],nA[lA]=sA),cA==="auto"&&(cA=gA[aA],nA[aA]=cA),AA.style[eA]=gA.join(" ")}const pA=getDragInfo(sA,cA);if(pA.type==="unsupported")throw new Error("Unsupported drag type");AA.classList.add("been-dragged");const uA={dir:rA,mouseStart:getMousePosition($,rA),originalSizes:nA,currentSizes:[...nA],beforeIndex:lA,afterIndex:aA,...pA,pixelToFrRatio:1};return pA.type==="both-relative"&&(uA.pixelToFrRatio=getPxToFrRatioForRelativeTracts({container:AA,index:tA,dir:rA,frCounts:{before:pA.beforeInfo.count,after:pA.afterInfo.count}})),uA}function updateDragState({mousePosition:$,drag:rA,container:tA}){const eA=getMousePosition($,rA.dir)-rA.mouseStart,nA=[...rA.originalSizes];let oA;switch(rA.type){case"before-pixel":oA=dragPixelBefore(eA,rA);break;case"after-pixel":oA=dragPixelAfter(eA,rA);break;case"both-pixel":oA=dragBothPixel(eA,rA);break;case"both-relative":oA=dragBothRelative(eA,rA);break}oA!=="no-change"&&(oA.beforeSize&&(nA[rA.beforeIndex]=oA.beforeSize),oA.afterSize&&(nA[rA.afterIndex]=oA.afterSize),rA.currentSizes=nA,rA.dir==="cols"?tA.style.gridTemplateColumns=nA.join(" "):tA.style.gridTemplateRows=nA.join(" "))}function isPxUnit($){return $.match(/[0-9|.]+px/)!==null}function isFrUnit($){return $.match(/[0-9|.]+fr/)!==null}function getUnitInfo($){if(isFrUnit($))return{type:"fr",count:Number($.replace("fr","")),value:$};if(isPxUnit($))return{type:"pixel",count:Number($.replace("px","")),value:$};throw new Error("Unknown tract sizing unit: "+$)}function getMousePosition($,rA){return rA==="rows"?$.clientY:$.clientX}function getHasRelativeUnits($){return $.some(rA=>isFrUnit(rA))}function getHasAutoUnits($){return $.some(rA=>rA==="auto")}const tractInfoDisplay="_tractInfoDisplay_cvtwo_1",sizeWidget="_sizeWidget_cvtwo_61",cssSizeInput="_cssSizeInput_cvtwo_80",hoverListener="_hoverListener_cvtwo_94",buttons="_buttons_cvtwo_114",tractAddButton="_tractAddButton_cvtwo_127",deleteButton="_deleteButton_cvtwo_128",classes$j={tractInfoDisplay,sizeWidget,cssSizeInput,hoverListener,buttons,tractAddButton,deleteButton},ALLOWED_UNITS=["fr","px"];function TractInfoDisplay({dir:$,index:rA,size:tA,deletionConflicts:AA,addTract:eA,deleteTract:nA,changeUnit:oA,changeCount:iA}){const{unit:lA,count:aA}=parseCSSMeasure(tA);return jsxs("div",{className:classes$j.tractInfoDisplay,"data-drag-dir":$,style:{"--tract-index":rA+1},children:[jsx("div",{className:classes$j.hoverListener}),jsxs("div",{className:classes$j.sizeWidget,onClick:stopPropagation,children:[jsxs("div",{className:classes$j.buttons,children:[jsx(AddTractButton,{dir:$,onClick:()=>eA("before")}),jsx(DeleteTractButton,{dir:$,onClick:nA,deletionConflicts:AA}),jsx(AddTractButton,{dir:$,onClick:()=>eA("after")})]}),jsx("div",{className:classes$j.cssSizeInput,children:jsx(CSSUnitInputCore,{count:aA,unit:lA,onCountChange:iA,onUnitChange:oA,allowedUnits:ALLOWED_UNITS})})]})]})}function DeleteTractButton({dir:$,onClick:rA,deletionConflicts:tA}){const AA=$==="rows"?"right":"bottom",eA=tA.length===0,nA=eA?"Delete tract":`Can't delete because the items ${tA.join(",")} are entirely contained in tract`;return jsx(PopoverButton,{className:classes$j.deleteButton,onClick:removeFocusAfterClick(eA?rA:void 0),"data-enabled":eA,popoverContent:nA,placement:AA,variant:"icon",children:jsx(SvgTrash,{})})}function AddTractButton({dir:$,onClick:rA}){const tA=$==="rows"?"right":"bottom",AA=$==="rows"?"Add row":"Add column";return jsx(PopoverButton,{className:classes$j.tractAddButton,onClick:removeFocusAfterClick(rA),placement:tA,popoverContent:AA,variant:"icon",children:jsx(FaPlus,{})})}function removeFocusAfterClick($){return function(rA){rA.currentTarget.blur(),$==null||$()}}function getFrUnitSizeInPx($,rA){let tA=0,AA=0;for(let eA=0;eAconflictsToRemoveTract(AA,{dir:sA,index:cA+1}),[AA]),oA=sA=>cA=>{const{unit:pA}=parseCSSMeasure(rA[sA]);eA({type:"RESIZE",index:sA,dir:$,size:`${cA}${pA}`})},iA=sA=>cA=>{const pA=tA(),{count:uA}=parseCSSMeasure(rA[sA]);let gA=1;cA==="px"&&(gA=roundPixel(pA[sA]));const fA=getFrUnitSizeInPx(pA,rA);cA==="fr"&&fA!=="NO_FR_UNITS"&&(gA=cleanNumber(roundFr(uA?uA*fA:1))),eA({type:"RESIZE",index:sA,dir:$,size:`${gA}${cA}`})},lA=sA=>cA=>eA({type:"ADD",dir:$,index:cA==="before"?sA:sA+1}),aA=sA=>()=>{eA({type:"DELETE",dir:$,index:sA+1})};return jsx(Fragment,{children:rA.map((sA,cA)=>jsx(TractInfoDisplay,{index:cA,dir:$,addTract:lA(cA),deleteTract:aA(cA),changeUnit:iA(cA),changeCount:oA(cA),size:sA,deletionConflicts:nA({dir:$,index:cA})},$+cA))})}function stopPropagation($){$.stopPropagation()}function hideOrShowTractInfo($,rA){$.querySelectorAll(`.${classes$j.tractInfoDisplay}`).forEach(tA=>{tA.style.display=rA==="hide"?"none":"block"})}const columnSizer="_columnSizer_9b32k_1",rowSizer="_rowSizer_9b32k_2",classes$i={columnSizer,rowSizer};function TractSizerHandle({dir:$,index:rA,onStartDrag:tA}){return jsx("div",{className:$==="rows"?classes$i.rowSizer:classes$i.columnSizer,title:`resize ${$==="rows"?"rows":"columns"} ${rA-1} and ${rA}`,onMouseDown:AA=>tA({e:AA,dir:$,index:rA}),style:{[$==="rows"?"gridRow":"gridColumn"]:rA}})}function validateRef($,rA="Ref is not yet initialized"){if($.current===null)throw new Error(rA);return $.current}function useDragToResizeGrid({containerRef:$,onDragEnd:rA}){return React.useCallback(({e:AA,dir:eA,index:nA})=>{const oA=validateRef($,"How are you dragging on an element without a container?");AA.preventDefault();const iA=initDragState({mousePosition:AA,dir:eA,index:nA,container:oA}),{beforeIndex:lA,afterIndex:aA}=iA,sA=setupSizeFeedbackDisplay(oA,{dir:eA,index:lA,size:iA.currentSizes[lA]}),cA=setupSizeFeedbackDisplay(oA,{dir:eA,index:aA,size:iA.currentSizes[aA]});setupDragWatcherDiv(oA,iA.dir,{move:pA=>{updateDragState({mousePosition:pA,drag:iA,container:oA}),sA.update(iA.currentSizes[lA]),cA.update(iA.currentSizes[aA])},end:()=>{sA.remove(),cA.remove(),rA&&rA(getLayoutFromGridElement(oA))}})},[$,rA])}function setupSizeFeedbackDisplay($,{dir:rA,index:tA,size:AA}){const eA=document.createElement("div"),nA=rA==="rows"?{gridRow:String(tA+1),gridColumn:"1",flexDirection:"row"}:{gridColumn:String(tA+1),gridRow:"1",flexDirection:"column"};Object.assign(eA.style,nA,{zIndex:"1",display:"flex",alignItems:"center"});const oA=document.createElement("div");return Object.assign(oA.style,{padding:"3px 7px",borderRadius:"var(--corner-radius)",backgroundColor:"var(--light-grey, pink)"}),oA.innerHTML=AA,eA.appendChild(oA),$.appendChild(eA),hideOrShowTractInfo($,"hide"),{remove:()=>{eA.remove(),hideOrShowTractInfo($,"show")},update:iA=>{oA.innerHTML=iA}}}function setupDragWatcherDiv($,rA,tA){const AA=document.createElement("div");Object.assign(AA.style,{position:"fixed",inset:"0px",zIndex:"3",cursor:rA==="rows"?"ns-resize":"ew-resize"}),$.appendChild(AA);const eA=()=>{nA(),tA.end()};AA.addEventListener("mousemove",tA.move),AA.addEventListener("mouseup",eA),AA.addEventListener("mouseleave",eA);function nA(){AA.removeEventListener("mousemove",tA.move),AA.removeEventListener("mouseup",eA),AA.removeEventListener("mouseleave",eA),AA.remove()}}function cleanupLayoutArgs({areas:$,col_sizes:rA,row_sizes:tA,gap_size:AA}){return{areas:$,gap_size:AA,col_sizes:ensureArray$1(rA),row_sizes:ensureArray$1(tA)}}const NEW_TRACT_SIZE="1fr";function EditableGridContainer({className:$,children:rA,onNewLayout:tA,...AA}){AA=cleanupLayoutArgs(AA);let{row_sizes:eA,col_sizes:nA}=AA;const oA=reactExports.useRef(null),iA=layoutDefToStyles(AA),lA=nA.length<2?[]:buildRange(2,nA.length),aA=eA.length<2?[]:buildRange(2,eA.length),sA=useDragToResizeGrid({containerRef:oA,onDragEnd:tA}),cA=[classes$k.ResizableGrid];$&&cA.push($);const pA=reactExports.useCallback(fA=>{switch(fA.type){case"ADD":return addTract(AA,{afterIndex:fA.index,dir:fA.dir,size:NEW_TRACT_SIZE});case"RESIZE":return updateTractSize(AA,fA);case"DELETE":return removeTract(AA,fA)}},[AA]),uA=reactExports.useCallback(fA=>tA(pA(fA)),[pA,tA]),gA=reactExports.useCallback(fA=>{const wA=oA.current;return wA?getTractSizesInPx({container:wA,dir:fA}):[]},[]);return jsxs("div",{className:mergeClasses(...cA),ref:oA,style:iA,children:[lA.map(fA=>jsx(TractSizerHandle,{dir:"cols",index:fA,onStartDrag:sA},"cols"+fA)),aA.map(fA=>jsx(TractSizerHandle,{dir:"rows",index:fA,onStartDrag:sA},"rows"+fA)),rA,jsx(TractInfoDisplays,{dir:"cols",sizes:nA,getActualSizes:()=>gA("cols"),areas:AA.areas,onUpdate:uA}),jsx(TractInfoDisplays,{dir:"rows",sizes:eA,getActualSizes:()=>gA("rows"),areas:AA.areas,onUpdate:uA})]})}function updateTractSize($,{dir:rA,index:tA,size:AA}){return fn($,eA=>{eA[rA==="rows"?"row_sizes":"col_sizes"][tA]=AA})}const EditorSkeleton="_EditorSkeleton_obu7s_1",elements_panel="_elements_panel_obu7s_15",properties_panel="_properties_panel_obu7s_20",app_preview="_app_preview_obu7s_25",panel="_panel_obu7s_50",panel_title="_panel_title_obu7s_61",styles$b={EditorSkeleton,elements_panel,properties_panel,app_preview,panel,panel_title};function PanelHeader({children:$,className:rA=""}){return jsx("h3",{className:mergeClasses(rA,styles$b.panel_title),children:$})}const portalHolder="_portalHolder_qvrvc_1",portalModal="_portalModal_qvrvc_11",title$2="_title_qvrvc_21",body="_body_qvrvc_25",portalForm="_portalForm_qvrvc_30",portalFormInputs="_portalFormInputs_qvrvc_35",portalFormFooter="_portalFormFooter_qvrvc_42",validationMsg="_validationMsg_qvrvc_48",infoText="_infoText_qvrvc_53",classes$h={portalHolder,portalModal,title:title$2,body,portalForm,portalFormInputs,portalFormFooter,validationMsg,infoText};function PortalModal({children:$,title:rA,label:tA,onConfirm:AA,onCancel:eA}){return jsx(Portal,{children:jsx("div",{className:classes$h.portalHolder,onClick:()=>eA(),onKeyDown:nA=>{nA.key==="Escape"&&eA()},children:jsxs("div",{className:classes$h.portalModal,onClick:nA=>nA.stopPropagation(),"aria-label":tA??"popup modal",children:[rA?jsx(PanelHeader,{className:classes$h.title,children:rA}):null,jsx("div",{className:classes$h.body,children:$})]})})})}function NameNewPanelModal({onCancel:$,onDone:rA,existingAreaNames:tA}){const AA=`area${tA.length}`,[eA,nA]=React.useState(AA),[oA,iA]=React.useState(null),lA=React.useCallback(sA=>{sA&&sA.preventDefault();const cA=validateGridAreaName({name:eA,existingAreaNames:tA});if(cA){iA(cA);return}rA(eA)},[tA,eA,rA]),aA=React.useCallback(sA=>{sA.type!=="REMOVE"&&(iA(null),nA(sA.value))},[]);return jsxs(PortalModal,{title:"Name new grid area",label:"New grid area naming modal",onConfirm:()=>rA(eA),onCancel:$,children:[jsx("form",{className:classes$h.portalForm,onSubmit:lA,children:jsxs("div",{className:classes$h.portalFormInputs,children:[jsx("span",{className:classes$h.infoText,children:"Name for grid area needs to be unique, start with a letter, and contain only letters and numbers."}),jsx(SettingsInput,{label:"Name of new grid area",name:"New-Item-Name",inputType:"string",onUpdate:aA,value:eA,defaultValue:AA}),oA?jsx("div",{className:classes$h.validationMsg,children:oA}):null]})}),jsxs("div",{className:classes$h.portalFormFooter,children:[jsx(Button,{variant:"delete",onClick:$,children:"Cancel"}),jsx(Button,{onClick:()=>lA(),children:"Done"})]})]})}function validateGridAreaName({name:$,existingAreaNames:rA}){return $===""?"A name is needed for the grid area":rA.includes($)?`You already have an item with the name "${$}", all names @@ -318,5 +318,5 @@ ${generateSerializedStateForError(rA)}`,labels:["Settings-Panel"]}),...$}),messa transform: scale(1); } } - `;oA.type="text/css",oA.id="joyride-beacon-animation",AA.nonce!==void 0&&oA.setAttribute("nonce",AA.nonce),oA.appendChild(document.createTextNode(iA)),nA.appendChild(oA)}return eA}return _createClass(tA,[{key:"componentDidMount",value:function(){var eA=this,nA=this.props.shouldFocus;setTimeout(function(){src_default.domElement(eA.beacon)&&nA&&eA.beacon.focus()},0)}},{key:"componentWillUnmount",value:function(){var eA=document.getElementById("joyride-beacon-animation");eA&&eA.parentNode.removeChild(eA)}},{key:"render",value:function(){var eA=this.props,nA=eA.beaconComponent,oA=eA.locale,iA=eA.onClickOrHover,lA=eA.styles,aA={"aria-label":oA.open,onClick:iA,onMouseEnter:iA,ref:this.setBeaconRef,title:oA.open},sA;if(nA){var cA=nA;sA=React.createElement(cA,aA)}else sA=React.createElement("button",_extends({key:"JoyrideBeacon",className:"react-joyride__beacon",style:lA.beacon,type:"button"},aA),React.createElement("span",{style:lA.beaconInner}),React.createElement("span",{style:lA.beaconOuter}));return sA}}]),tA}(React.Component);function JoyrideSpotlight($){var rA=$.styles;return React.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight",style:rA})}var _excluded$2=["mixBlendMode","zIndex"],JoyrideOverlay=function($){_inherits(tA,$);var rA=_createSuper(tA);function tA(){var AA;_classCallCheck(this,tA);for(var eA=arguments.length,nA=new Array(eA),oA=0;oA=uA&&fA<=uA+sA,EA=wA>=cA&&wA<=cA+gA,QA=EA&&BA;QA!==lA&&AA.updateState({mouseOverSpotlight:QA})}),_defineProperty(_assertThisInitialized(AA),"handleScroll",function(){var iA=AA.props.target,lA=getElement(iA);if(AA.scrollParent!==document){var aA=AA.state.isScrolling;aA||AA.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(AA.scrollTimeout),AA.scrollTimeout=setTimeout(function(){AA.updateState({isScrolling:!1,showSpotlight:!0})},50)}else hasPosition(lA,"sticky")&&AA.updateState({})}),_defineProperty(_assertThisInitialized(AA),"handleResize",function(){clearTimeout(AA.resizeTimeout),AA.resizeTimeout=setTimeout(function(){AA._isMounted&&AA.forceUpdate()},100)}),AA}return _createClass(tA,[{key:"componentDidMount",value:function(){var eA=this.props;eA.debug,eA.disableScrolling;var nA=eA.disableScrollParentFix,oA=eA.target,iA=getElement(oA);this.scrollParent=getScrollParent(iA,nA,!0),this._isMounted=!0,window.addEventListener("resize",this.handleResize)}},{key:"componentDidUpdate",value:function(eA){var nA=this,oA=this.props,iA=oA.lifecycle,lA=oA.spotlightClicks,aA=treeChanges(eA,this.props),sA=aA.changed;sA("lifecycle",LIFECYCLE.TOOLTIP)&&(this.scrollParent.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(function(){var cA=nA.state.isScrolling;cA||nA.updateState({showSpotlight:!0})},100)),(sA("spotlightClicks")||sA("disableOverlay")||sA("lifecycle"))&&(lA&&iA===LIFECYCLE.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):iA!==LIFECYCLE.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),this.scrollParent.removeEventListener("scroll",this.handleScroll)}},{key:"spotlightStyles",get:function(){var eA=this.state.showSpotlight,nA=this.props,oA=nA.disableScrollParentFix,iA=nA.spotlightClicks,lA=nA.spotlightPadding,aA=nA.styles,sA=nA.target,cA=getElement(sA),pA=getClientRect(cA),uA=hasPosition(cA),gA=getElementPosition(cA,lA,oA);return _objectSpread2(_objectSpread2({},isLegacy()?aA.spotlightLegacy:aA.spotlight),{},{height:Math.round(pA.height+lA*2),left:Math.round(pA.left-lA),opacity:eA?1:0,pointerEvents:iA?"none":"auto",position:uA?"fixed":"absolute",top:gA,transition:"opacity 0.2s",width:Math.round(pA.width+lA*2)})}},{key:"updateState",value:function(eA){this._isMounted&&this.setState(eA)}},{key:"render",value:function(){var eA=this.state,nA=eA.mouseOverSpotlight,oA=eA.showSpotlight,iA=this.props,lA=iA.disableOverlay,aA=iA.disableOverlayClose,sA=iA.lifecycle,cA=iA.onClickOverlay,pA=iA.placement,uA=iA.styles;if(lA||sA!==LIFECYCLE.TOOLTIP)return null;var gA=uA.overlay;isLegacy()&&(gA=pA==="center"?uA.overlayLegacyCenter:uA.overlayLegacy);var fA=_objectSpread2({cursor:aA?"default":"pointer",height:getDocumentHeight(),pointerEvents:nA?"none":"auto"},gA),wA=pA!=="center"&&oA&&React.createElement(JoyrideSpotlight,{styles:this.spotlightStyles});if(getBrowser()==="safari"){fA.mixBlendMode,fA.zIndex;var BA=_objectWithoutProperties(fA,_excluded$2);wA=React.createElement("div",{style:_objectSpread2({},BA)},wA),delete fA.backgroundColor}return React.createElement("div",{className:"react-joyride__overlay",style:fA,onClick:cA},wA)}}]),tA}(React.Component),_excluded$1=["styles"],_excluded2=["color","height","width"];function JoyrideTooltipCloseBtn($){var rA=$.styles,tA=_objectWithoutProperties($,_excluded$1),AA=rA.color,eA=rA.height,nA=rA.width,oA=_objectWithoutProperties(rA,_excluded2);return React.createElement("button",_extends({style:oA,type:"button"},tA),React.createElement("svg",{width:typeof nA=="number"?"".concat(nA,"px"):nA,height:typeof eA=="number"?"".concat(eA,"px"):eA,viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},React.createElement("g",null,React.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:AA}))))}var JoyrideTooltipContainer=function($){_inherits(tA,$);var rA=_createSuper(tA);function tA(){return _classCallCheck(this,tA),rA.apply(this,arguments)}return _createClass(tA,[{key:"render",value:function(){var eA=this.props,nA=eA.backProps,oA=eA.closeProps,iA=eA.continuous,lA=eA.index,aA=eA.isLastStep,sA=eA.primaryProps,cA=eA.size,pA=eA.skipProps,uA=eA.step,gA=eA.tooltipProps,fA=uA.content,wA=uA.hideBackButton,BA=uA.hideCloseButton,EA=uA.hideFooter,QA=uA.showProgress,dA=uA.showSkipButton,yA=uA.title,hA=uA.styles,vA=uA.locale,CA=vA.back,xA=vA.close,IA=vA.last,OA=vA.next,PA=vA.skip,$A={primary:xA};return iA&&($A.primary=aA?IA:OA,QA&&($A.primary=React.createElement("span",null,$A.primary," (",lA+1,"/",cA,")"))),dA&&!aA&&($A.skip=React.createElement("button",_extends({style:hA.buttonSkip,type:"button","aria-live":"off"},pA),PA)),!wA&&lA>0&&($A.back=React.createElement("button",_extends({style:hA.buttonBack,type:"button"},nA),CA)),$A.close=!BA&&React.createElement(JoyrideTooltipCloseBtn,_extends({styles:hA.buttonClose},oA)),React.createElement("div",_extends({key:"JoyrideTooltip",className:"react-joyride__tooltip",style:hA.tooltip},gA),React.createElement("div",{style:hA.tooltipContainer},yA&&React.createElement("h4",{style:hA.tooltipTitle,"aria-label":yA},yA),React.createElement("div",{style:hA.tooltipContent},fA)),!EA&&React.createElement("div",{style:hA.tooltipFooter},React.createElement("div",{style:hA.tooltipFooterSpacer},$A.skip),$A.back,React.createElement("button",_extends({style:hA.buttonNext,type:"button"},sA),$A.primary)),$A.close)}}]),tA}(React.Component),_excluded=["beaconComponent","tooltipComponent"],JoyrideTooltip=function($){_inherits(tA,$);var rA=_createSuper(tA);function tA(){var AA;_classCallCheck(this,tA);for(var eA=arguments.length,nA=new Array(eA),oA=0;oA0||oA===ACTIONS.PREV),hA=EA("action")||EA("index")||EA("lifecycle")||EA("status"),vA=QA("lifecycle",[LIFECYCLE.TOOLTIP,LIFECYCLE.INIT],LIFECYCLE.INIT),CA=EA("action",[ACTIONS.NEXT,ACTIONS.PREV,ACTIONS.SKIP,ACTIONS.CLOSE]);if(CA&&(vA||aA)&&iA(_objectSpread2(_objectSpread2({},dA),{},{index:eA.index,lifecycle:LIFECYCLE.COMPLETE,step:eA.step,type:EVENTS.STEP_AFTER})),fA.placement==="center"&&gA===STATUS.RUNNING&&EA("index")&&oA!==ACTIONS.START&&pA===LIFECYCLE.INIT&&wA({lifecycle:LIFECYCLE.READY}),hA){var xA=getElement(fA.target),IA=!!xA,OA=IA&&isElementVisible(xA);OA?(QA("status",STATUS.READY,STATUS.RUNNING)||QA("lifecycle",LIFECYCLE.INIT,LIFECYCLE.READY))&&iA(_objectSpread2(_objectSpread2({},dA),{},{step:fA,type:EVENTS.STEP_BEFORE})):(console.warn(IA?"Target not visible":"Target not mounted",fA),iA(_objectSpread2(_objectSpread2({},dA),{},{type:EVENTS.TARGET_NOT_FOUND,step:fA})),aA||wA({index:cA+([ACTIONS.PREV].indexOf(oA)!==-1?-1:1)}))}QA("lifecycle",LIFECYCLE.INIT,LIFECYCLE.READY)&&wA({lifecycle:hideBeacon(fA)||yA?LIFECYCLE.TOOLTIP:LIFECYCLE.BEACON}),EA("index")&&log({title:"step:".concat(pA),data:[{key:"props",value:this.props}],debug:sA}),EA("lifecycle",LIFECYCLE.BEACON)&&iA(_objectSpread2(_objectSpread2({},dA),{},{step:fA,type:EVENTS.BEACON})),EA("lifecycle",LIFECYCLE.TOOLTIP)&&(iA(_objectSpread2(_objectSpread2({},dA),{},{step:fA,type:EVENTS.TOOLTIP})),this.scope=new Scope(this.tooltip,{selector:"[data-action=primary]"}),this.scope.setFocus()),QA("lifecycle",[LIFECYCLE.TOOLTIP,LIFECYCLE.INIT],LIFECYCLE.INIT)&&(this.scope.removeScope(),delete this.beaconPopper,delete this.tooltipPopper)}},{key:"componentWillUnmount",value:function(){this.scope.removeScope()}},{key:"open",get:function(){var eA=this.props,nA=eA.step,oA=eA.lifecycle;return!!(hideBeacon(nA)||oA===LIFECYCLE.TOOLTIP)}},{key:"render",value:function(){var eA=this.props,nA=eA.continuous,oA=eA.debug,iA=eA.helpers,lA=eA.index,aA=eA.lifecycle,sA=eA.nonce,cA=eA.shouldScroll,pA=eA.size,uA=eA.step,gA=getElement(uA.target);return!validateStep(uA)||!src_default.domElement(gA)?null:React.createElement("div",{key:"JoyrideStep-".concat(lA),className:"react-joyride__step"},React.createElement(JoyridePortal,{id:"react-joyride-portal"},React.createElement(JoyrideOverlay,_extends({},uA,{debug:oA,lifecycle:aA,onClickOverlay:this.handleClickOverlay}))),React.createElement(ReactFloater,_extends({component:React.createElement(JoyrideTooltip,{continuous:nA,helpers:iA,index:lA,isLastStep:lA+1===pA,setTooltipRef:this.setTooltipRef,size:pA,step:uA}),debug:oA,getPopper:this.setPopper,id:"react-joyride-step-".concat(lA),isPositioned:uA.isFixed||hasPosition(gA),open:this.open,placement:uA.placement,target:uA.target},uA.floaterProps),React.createElement(JoyrideBeacon,{beaconComponent:uA.beaconComponent,locale:uA.locale,nonce:sA,onClickOrHover:this.handleClickHoverBeacon,shouldFocus:cA,styles:uA.styles})))}}]),tA}(React.Component),Joyride=function($){_inherits(tA,$);var rA=_createSuper(tA);function tA(AA){var eA;return _classCallCheck(this,tA),eA=rA.call(this,AA),_defineProperty(_assertThisInitialized(eA),"initStore",function(){var nA=eA.props,oA=nA.debug,iA=nA.getHelpers,lA=nA.run,aA=nA.stepIndex;eA.store=new createStore(_objectSpread2(_objectSpread2({},eA.props),{},{controlled:lA&&src_default.number(aA)})),eA.helpers=eA.store.getHelpers();var sA=eA.store.addListener;return log({title:"init",data:[{key:"props",value:eA.props},{key:"state",value:eA.state}],debug:oA}),sA(eA.syncState),iA(eA.helpers),eA.store.getState()}),_defineProperty(_assertThisInitialized(eA),"callback",function(nA){var oA=eA.props.callback;src_default.function(oA)&&oA(nA)}),_defineProperty(_assertThisInitialized(eA),"handleKeyboard",function(nA){var oA=eA.state,iA=oA.index,lA=oA.lifecycle,aA=eA.props.steps,sA=aA[iA],cA=window.Event?nA.which:nA.keyCode;lA===LIFECYCLE.TOOLTIP&&cA===27&&sA&&!sA.disableCloseOnEsc&&eA.store.close()}),_defineProperty(_assertThisInitialized(eA),"syncState",function(nA){eA.setState(nA)}),_defineProperty(_assertThisInitialized(eA),"setPopper",function(nA,oA){oA==="wrapper"?eA.beaconPopper=nA:eA.tooltipPopper=nA}),_defineProperty(_assertThisInitialized(eA),"shouldScroll",function(nA,oA,iA,lA,aA,sA,cA){return!nA&&(oA!==0||iA||lA===LIFECYCLE.TOOLTIP)&&aA.placement!=="center"&&(!aA.isFixed||!hasPosition(sA))&&cA.lifecycle!==lA&&[LIFECYCLE.BEACON,LIFECYCLE.TOOLTIP].indexOf(lA)!==-1}),eA.state=eA.initStore(),eA}return _createClass(tA,[{key:"componentDidMount",value:function(){if(canUseDOM){var eA=this.props,nA=eA.disableCloseOnEsc,oA=eA.debug,iA=eA.run,lA=eA.steps,aA=this.store.start;validateSteps(lA,oA)&&iA&&aA(),nA||document.body.addEventListener("keydown",this.handleKeyboard,{passive:!0})}}},{key:"componentDidUpdate",value:function(eA,nA){if(canUseDOM){var oA=this.state,iA=oA.action,lA=oA.controlled,aA=oA.index,sA=oA.lifecycle,cA=oA.status,pA=this.props,uA=pA.debug,gA=pA.run,fA=pA.stepIndex,wA=pA.steps,BA=eA.steps,EA=eA.stepIndex,QA=this.store,dA=QA.reset,yA=QA.setSteps,hA=QA.start,vA=QA.stop,CA=QA.update,xA=treeChanges(eA,this.props),IA=xA.changed,OA=treeChanges(nA,this.state),PA=OA.changed,$A=OA.changedFrom,jA=getMergedStep(wA[aA],this.props),MA=!isEqual(BA,wA),RA=src_default.number(fA)&&IA("stepIndex"),HA=getElement(jA==null?void 0:jA.target);if(MA&&(validateSteps(wA,uA)?yA(wA):console.warn("Steps are not valid",wA)),IA("run")&&(gA?hA(fA):vA()),RA){var DA=EA=0?hA:0,lA===STATUS.RUNNING&&scrollTo(hA,yA,fA)}}}},{key:"render",value:function(){if(!canUseDOM)return null;var eA=this.state,nA=eA.index,oA=eA.status,iA=this.props,lA=iA.continuous,aA=iA.debug,sA=iA.nonce,cA=iA.scrollToFirstStep,pA=iA.steps,uA=getMergedStep(pA[nA],this.props),gA;return oA===STATUS.RUNNING&&uA&&(gA=React.createElement(JoyrideStep,_extends({},this.state,{callback:this.callback,continuous:lA,debug:aA,setPopper:this.setPopper,helpers:this.helpers,nonce:sA,shouldScroll:!uA.disableScrolling&&(nA!==0||cA),step:uA,update:this.store.update}))),React.createElement("div",{className:"react-joyride"},gA)}}]),tA}(React.Component);_defineProperty(Joyride,"defaultProps",{continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:function $(){},hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]});function AppTour(){const[$,rA]=reactExports.useState(0),[tA,AA]=reactExports.useState(!1),eA=useMetaData(),nA=eA===null?!1:eA.app_preview,oA=aA=>{const{action:sA,index:cA,type:pA}=aA;(pA===EVENTS.STEP_AFTER||pA===EVENTS.TARGET_NOT_FOUND)&&(sA===ACTIONS.NEXT?rA(cA+1):sA===ACTIONS.PREV?rA(cA-1):sA===ACTIONS.CLOSE&&AA(!1)),pA===EVENTS.TOUR_END&&(sA===ACTIONS.NEXT&&(AA(!1),rA(0)),sA===ACTIONS.SKIP&&AA(!1))},iA=()=>{AA(!0)},lA=reactExports.useMemo(()=>[{target:"[aria-label='App Skeleton']",disableBeacon:!0,content:jsxs("div",{children:[jsx("p",{children:"The app view shows a skeleton view of the current state of your app's UI."}),jsx("p",{children:"You can click on elements to select them or drag them around to move them."}),jsx("p",{children:"Cards can be resized by dragging resize handles on the sides."}),jsx("p",{children:"Rows and Columns can be resized by dragging between tracts and added by hovering over the left and top respectively to reveal the tract controls widget."}),jsx("p",{children:jsx("a",{href:"https://rstudio.github.io/shinyuieditor/articles/how-to.html#show-size-widget",children:"More info"})})]})},{target:"[aria-label='Elements Panel']",content:jsxs("div",{children:[jsx("p",{children:"Drag elements from the elements palette into the app pane on the right to add them to your app."}),jsxs("p",{children:["In the app view, the areas available for the element to be dropped in will pulse with an"," ",jsx("span",{className:styles$h.can_accept_drop,style:{padding:"2px"},children:"orange outline."})]})]}),placement:"right-start",disableBeacon:!0},{target:"[aria-label='Properties panel']",content:jsxs("div",{children:[jsx("p",{children:"After selecting an element in your app, you can adjust the settings for that element in the properties pane."}),jsx("p",{children:"Changes made will be automatically applied to your element both in the app view and your code so there's no need to save or submit these changes."})]}),placement:"left-start"},{target:"[aria-label='App Preview']",content:nA?jsxs("div",{children:[jsx("p",{children:"At any point while editing your application you can see the code to recreate the current app."}),jsx("p",{children:"Simply copy and paste the code into your editor of choice to get going with your app."})]}):jsxs("div",{children:[jsx("p",{children:"You can see how the changes impact your app with the app preview."}),jsx("p",{children:"Click in the center of the preview to expand it to full screen to get a better view of your app."}),jsx("p",{children:'Any log messages from the app will be placed into the "App Logs" drawer.'})]}),placement:"top-start"},{target:"[aria-label='Undo/Redo buttons']",content:"Mess something up? You can use the change history to undo or redo your changes",placement:"bottom"}],[nA]);return jsxs(Fragment,{children:[jsxs(Button,{onClick:iA,title:"Take a guided tour of app",variant:"transparent",children:[jsx(PngIcon,{id:"tour",size:"24px"}),"Tour App"]}),jsx(Joyride,{callback:oA,steps:lA,stepIndex:$,run:tA,continuous:!0,showProgress:!0,showSkipButton:!0,disableScrolling:!0,locale:{next:"Next",back:"Back",close:"Close",last:"Let's go!",open:"Open the dialog",skip:"Skip tour"},styles:joyrideStyles})]})}const beaconColorBase="#e07189",beaconColorLight="#f6d5dc",joyrideStyles={options:{arrowColor:"var(--rstudio-white, white)",backgroundColor:"var(--rstudio-white, white)",primaryColor:"var(--rstudio-blue, steelblue)",textColor:"var(--rstudio-grey, black)"},beaconInner:{backgroundColor:beaconColorBase},beaconOuter:{backgroundColor:beaconColorLight,border:`2px solid ${beaconColorBase}`},tooltipContainer:{textAlign:"left"}},SvgShinyLogo=$=>jsx("svg",{viewBox:"0 0 168 114",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"Shiny Logo",...$,children:jsx("path",{opacity:.9,d:"M17.524 62.626c-.898-.027-.3 0 0 0Zm-.027 0c-.871-.027-.49 0-.19 0h.462-.272c.272.027.19 0 0 0Zm.244 0c9.497.218 19.43-1.986 22.313-13.279 1.878-7.293-2.802-12.599-6.938-17.932-.028-.027-.055-.054-.055-.109-.163-.68-4.653-4.816-5.904-6.367 0-.027-.028-.027-.055-.055-.599-.435-1.224-2.64-1.524-3.864a3.323 3.323 0 0 1-.027-1.55c1.089-5.552 1.687-9.606 9.061-8.409 5.306.871 2.558 8.653 5.415 9.415h.055c1.714.164 5.06-3.945 5.55-5.333 1.905-5.388-9.088-8.68-12.435-8.463-6.72.408-11.129 4.055-13.823 10.068-4.952 11.075 4.3 18.45 9.905 26.041 4.245 5.742 4.054 10.857-1.143 15.782-5.714 5.415-12.354-2.04-13.116-7.292-.68-4.816-.625-8.163-4.653-2.04-3.728 5.686.11 13.088 7.374 13.387ZM167.266 36.34v.055a13.555 13.555 0 0 1-.762 3.428 27.79 27.79 0 0 1-2.693 5.306c-1.334 2.041-2.041 2.857-3.429 4.653-2.612 3.402-4.626 5.932-7.674 9.17-4.244 4.49-8.979 9.633-14.149 13.306-7.374 5.28-16.68 6.722-25.497 7.538-25.796 2.34-63.755 5.823-71.755 33.741-.054.164-.19.245-.354.191-.081-.027-.136-.055-.163-.136-7.837-13.388-24.68-23.211-40.3-22.748-.162.027-.299-.055-.326-.218-.027-.163.055-.3.218-.327 40.218-19.972 81.306-10.394 124.735-18.15 10.857-1.931 19.972-9.06 26.53-17.632 2.504-3.238 5.715-5.986 7.919-9.442.353-.572 2.176-5.116-.653-3.184-4.381 2.966-8.082 6.64-12.844 8.953a5.605 5.605 0 0 1-.707.299c-.082.027-.137.109-.164.19a27.286 27.286 0 0 1-2.857 6.368 18.325 18.325 0 0 1-5.66 5.632c-2.122 1.415-4.598 2.232-7.129 2.422-.354.027-.68.027-1.034.027-2.014 0-3.32-.163-4.871-.952-1.986-1.034-2.612-2.721-2.748-4.762-.082-1.224.68-2.558 1.306-3.565.626-1.006 1.633-2.122 2.34-2.421l.055-.028c3.537-2.612 9.551-2.802 13.632-3.918.109-.027.191-.109.191-.19l2.041-7.456c.054-.163-.055-.3-.191-.354a.301.301 0 0 0-.299.109 40.263 40.263 0 0 1-3.402 4.326c-1.605 1.688-2.857 2.721-3.809 3.102a11.152 11.152 0 0 1-3.374.708c-1.361.082-2.531-.463-3.429-1.605-.898-1.143-1.388-2.83-1.496-5.062a8.521 8.521 0 0 1 0-1.197.312.312 0 0 0-.191-.354.313.313 0 0 0-.354.19c-.435.844-.87 1.633-1.306 2.34-1.279 2.232-2.884 4.273-4.707 6.096-1.796 1.796-3.538 2.748-5.143 2.857-3.021.19-4.653-1.523-4.871-5.115-.218-3.429 1.143-10.477 4.082-20.98.163-.462.217-.952.19-1.415-.054-.952-.598-1.333-1.714-1.252a6.312 6.312 0 0 0-3.51 1.47 12.19 12.19 0 0 0-3.021 3.837c-.898 1.632-1.687 3.32-2.421 5.034a42.75 42.75 0 0 0-1.878 5.823c-.544 2.204-1.007 4.054-1.306 5.496a144.944 144.944 0 0 0-.925 4.708c-.218 1.143-.463 2.557-.517 2.775l-.055.218-7.483.49-.027-.272c-.054-.654.49-2.966 1.578-7.02l-.653 1.142a29.066 29.066 0 0 1-4.68 6.095c-1.796 1.796-3.537 2.749-5.143 2.857h-.326c-2.64 0-4.136-2.068-4.381-6.15-.055-.816-.082-1.632-.055-2.475a.312.312 0 0 0-.19-.354.312.312 0 0 0-.354.19c-4.109 7.538-7.81 11.347-11.238 11.565-3.02.19-4.653-1.605-4.898-5.36-.272-4.164.87-10.26 3.401-18.096.545-1.932.79-3.265.735-3.973-.082-1.088-.571-1.224-.98-1.224h-.108c-.354.027-1.116.245-2.722 1.252a14.477 14.477 0 0 0-3.646 3.4c-1.17 1.525-2.095 3.239-2.775 5.035-.708 1.905-1.28 3.565-1.687 4.952-.408 1.388-.817 3.102-1.225 5.062-.408 1.959-.762 3.646-1.088 4.898a73.777 73.777 0 0 0-.98 4.353l-.054.218-7.184.462c-.163 0-.3-.108-.3-.272v-.108c1.062-3.674 2.559-9.633 4.463-17.688 1.905-8.054 3.647-14.503 5.061-19.129 1.225-4.027 2.667-8 4.354-11.836a32.438 32.438 0 0 1 5.225-8.273c2.04-2.285 4.326-3.51 6.748-3.673 2.558-.163 3.919 1.116 4.109 3.755.109 1.769-.408 4.136-1.524 7.102-2.04 5.252-5.442 11.374-10.15 18.204a.296.296 0 0 0 0 .408c.11.11.3.11.409 0a16.315 16.315 0 0 1 2.612-1.66c1.36-.707 2.857-1.115 4.408-1.251 2.912-.19 4.463 1.143 4.653 3.945a8.216 8.216 0 0 1-.326 3.048c-.273.898-.572 1.96-.926 3.13-.326 1.17-.598 2.149-.816 2.884-.218.761-.49 1.768-.844 3.047-.353 1.28-.625 2.395-.789 3.266-.49 2.204-.68 3.972-.598 5.251.109 1.633.762 1.633.98 1.633h.081c2.748-.163 5.986-4.953 9.66-14.204.027-.055.027-.082.054-.136a64.454 64.454 0 0 1 3.184-8.925c1.524-3.347 3.374-5.116 5.551-5.252l4.354-.218c.163 0 .299.109.299.272a.31.31 0 0 1-.082.218c-.68.653-1.578 2.395-2.666 5.197-1.143 3.02-1.932 5.089-2.45 6.476-.516 1.443-1.115 3.402-1.74 5.85-.627 2.45-.899 4.409-.79 5.878.136 1.932.87 1.932 1.116 1.932h.081c.381-.027 1.089-.299 2.368-1.47a14.924 14.924 0 0 0 2.53-3.02c.653-1.06 1.36-2.394 2.15-4.027.79-1.632 1.47-3.047 2.04-4.245.627-1.279.872-1.714 1.035-1.877l.354-.653c1.333-5.388 1.959-9.17 1.823-11.266a2.31 2.31 0 0 0-.245-1.034c-.082-.108-.082-.299.054-.38a.387.387 0 0 1 .163-.055l3.02-.19c1.77-.11 2.885 0 3.457.38.571.381.925 1.007.952 1.66a9.83 9.83 0 0 1-.19 1.987c-.028.163.081.3.245.326.081.028.19-.027.244-.081 3.402-3.538 6.939-5.442 10.585-5.66 2.912-.19 4.49 1.197 4.654 4.109.054.925 0 1.85-.191 2.775-.19.925-.653 2.721-1.469 5.497-1.715 5.959-2.531 9.959-2.395 11.918.082 1.388.626 1.551 1.034 1.551h.082c.381-.027 1.088-.3 2.34-1.496a17.296 17.296 0 0 0 2.558-3.075 43.208 43.208 0 0 0 2.177-3.973c.789-1.578 1.442-2.993 2.013-4.19.191-.436.354-.762.49-1.035 0-.027.027-.027.027-.054.789-3.32 1.714-6.068 2.776-8.19 1.224-2.504 2.612-4.164 4.081-4.98 1.47-.816 3.483-1.279 6.068-1.442a.58.58 0 0 1 .626.517v.054c.027.3-.136.626-.462 1.034-1.824 1.987-3.592 5.497-5.307 10.45-1.714 4.952-2.448 9.115-2.258 12.435.109 1.523.49 2.313 1.143 2.313h.054c1.606-.11 3.647-2.096 6.014-5.932a50.108 50.108 0 0 0 5.442-11.674c.163-.544.381-1.306.68-2.34.3-1.034.517-1.714.626-2.095.109-.381.327-.925.599-1.606.19-.544.462-1.034.789-1.496.218-.245.544-.572.925-.98.381-.408.816-.707 1.333-.87a19.15 19.15 0 0 1 3.919-.735l3.02-.19c.136-.055.3.026.354.162.054.137-.027.3-.163.354l-.055.055c-1.36 1.06-2.694 3.591-3.945 7.537-1.034 3.347-1.905 6.449-2.585 9.197a295.694 295.694 0 0 1-1.279 5.034c-.164.599-.517 2.068-1.061 4.3a177.514 177.514 0 0 1-1.062 4.19c-.054.136 0 .3.136.354.082.027.191.027.272-.055a43.638 43.638 0 0 0 8.164-6.313c1.387-1.387 11.918-13.088 12.408-5.66l.054.327ZM66.503 2.708c-1.06.054-2.938 1.687-5.768 8.98-1.96 5.033-3.864 10.775-5.687 17.087-.055.164.054.3.19.354.109.027.245 0 .327-.109 4.898-7.483 8.299-13.714 10.095-18.585 1.115-3.32 1.633-5.523 1.578-6.503-.082-1.197-.544-1.197-.68-1.197l-.055-.027ZM137.17 54c.054-.136-.027-.3-.163-.354a.173.173 0 0 0-.163 0c-1.47.3-2.939.544-4.381.898-2.041.49-5.143.98-6.722 2.694-.027.027-.027.054-.054.082-.272.598-.326 1.55-.272 2.748.054.844.871 1.633 1.578 2.204a3.24 3.24 0 0 0 2.313.68c3.211-.244 5.85-3.238 7.864-8.952ZM88.517 18.98c1.742-.082 3.918-.735 4.435-3.32.245-1.17-.462-2.504-.898-2.885-.435-.38-1.034-.544-1.823-.49-.789.055-1.741.545-2.64 1.389-1.196 1.115-1.142 2.72-.761 3.782.354.898.98 1.496 1.687 1.524Z",fill:"#fff"})}),container="_container_1d7pe_1",classes={container};function UndoRedoButtons({goBackward:$,canGoBackward:rA,goForward:tA,canGoForward:AA}){return jsxs("div",{className:mergeClasses(classes.container,"undo-redo-buttons"),"aria-label":"Undo/Redo buttons",children:[jsx(Button,{variant:["transparent","icon"],disabled:!rA,"aria-label":"Undo last change",title:"Undo last change",onClick:$,children:jsx(SvgUndo,{height:"100%"})}),jsx(Button,{variant:["transparent","icon"],disabled:!AA,"aria-label":"Redo last change",title:"Redo last change",onClick:tA,children:jsx(SvgRedo,{height:"100%"})})]})}const shiny_logo="_shiny_logo_ywfqv_1",app_title="_app_title_ywfqv_10",divider="_divider_ywfqv_15",header="_header_ywfqv_21",OpenSideBySideWindowButton$1="_OpenSideBySideWindowButton_ywfqv_30",right="_right_ywfqv_55",spacer="_spacer_ywfqv_67",last="_last_ywfqv_71",styles$2={shiny_logo,app_title,divider,header,OpenSideBySideWindowButton:OpenSideBySideWindowButton$1,"react-joyride":"_react-joyride_ywfqv_47","undo-redo-buttons":"_undo-redo-buttons_ywfqv_51",right,spacer,last};function SiPython($){return GenIcon({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"title",attr:{},child:[]},{tag:"path",attr:{d:"M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"}}]})($)}function SiR($){return GenIcon({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"title",attr:{},child:[]},{tag:"path",attr:{d:"M12 2.746c-6.627 0-12 3.599-12 8.037 0 3.897 4.144 7.144 9.64 7.88V16.26c-2.924-.915-4.925-2.755-4.925-4.877 0-3.035 4.084-5.494 9.12-5.494 5.038 0 8.757 1.683 8.757 5.494 0 1.976-.999 3.379-2.662 4.272.09.066.174.128.258.216.169.149.25.363.372.544 2.128-1.45 3.44-3.437 3.44-5.631 0-4.44-5.373-8.038-12-8.038zm-2.111 4.99v13.516l4.093-.002-.002-5.291h1.1c.225 0 .321.066.549.25.272.22.715.982.715.982l2.164 4.063 4.627-.002-2.864-4.826s-.086-.193-.265-.383a2.22 2.22 0 00-.582-.416c-.422-.214-1.149-.434-1.149-.434s3.578-.264 3.578-3.826c0-3.562-3.744-3.63-3.744-3.63zm4.127 2.93l2.478.002s1.149-.062 1.149 1.127c0 1.165-1.149 1.17-1.149 1.17h-2.478zm1.754 6.119c-.494.049-1.012.079-1.54.088v1.807a16.622 16.622 0 002.37-.473l-.471-.891s-.108-.183-.248-.394c-.039-.054-.08-.098-.111-.137z"}}]})($)}const language_badge="_language_badge_67rf7_1",styles$1={language_badge};function LanguageModeBadge(){const $=useLanguageMode();return jsxs(Tooltip,{placement:"bottom-start",children:[jsx(TooltipTrigger,{asChild:!0,children:jsx("div",{className:styles$1.language_badge,children:$==="PYTHON"?jsx(SiPython,{height:"100%",width:"100%"}):jsx(SiR,{height:"100%",width:"100%"})})}),jsxs(TooltipContent,{children:["Current language is ",$==="PYTHON"?"Python":"R",". Only supported ui elements for the language are shown."]})]})}function OpenSideBySideWindowButton(){const{sendMsg:$,mode:rA}=useBackendConnection();return rA!=="VSCODE"?null:jsxs(Fragment,{children:[jsx(PopoverButton,{className:"OpenSideBySideWindowButton mr-2",popoverContent:"Open app code next to editor",placement:"bottom",variant:["icon","transparent"],onClick:()=>{$({path:"OPEN-COMPANION-EDITOR",payload:"BESIDE"})},children:jsx(FaCode,{})}),jsx("div",{className:"divider"})]})}function HeaderView({state:$,history:rA}){return jsxs("header",{className:styles$2.header,children:[jsx(SvgShinyLogo,{className:styles$2.shiny_logo}),jsx("h1",{className:styles$2.app_title,children:"Shiny UI Editor"}),jsx(LanguageModeBadge,{}),jsxs("div",{className:styles$2.right,children:[$.mode==="MAIN"?jsxs(Fragment,{children:[jsx(OpenSideBySideWindowButton,{}),jsx(AppTour,{})]}):null,jsx("div",{className:styles$2.divider}),jsx(UndoRedoButtons,{...rA}),jsx("div",{className:mergeClasses(styles$2.spacer,styles$2.last)})]})]})}function LostConnectionPopup(){return useSelector(rA=>rA.connected_to_server)?null:jsx(PortalModal,{onConfirm:()=>{},onCancel:()=>{},children:jsx("p",{style:{color:"var(--red, pink)",textAlign:"center"},children:"Lost connection to backend. Check console where editor was launched for details."})})}function EditorContainer(){const{state:$,history:rA}=useSyncUiWithBackend();return jsx(HistoryGoBackwardProvider,{goBackward:rA.goBackward,canGoBackward:rA.canGoBackward,children:jsxs("div",{className:styles$7.EditorContainer,style:sizes_inline_styles,children:[jsx(HeaderView,{state:$,history:rA}),jsx(EditorView,{state:$}),jsx(LostConnectionPopup,{})]})})}const connectedToServerSlice=createSlice({name:"connectedToServer",initialState:!0,reducers:{DISCONNECTED_FROM_SERVER:($,rA)=>!1}}),connectedToServerReducer=connectedToServerSlice.reducer;function getNewSelectionPathAfterDeletion({selectedPath:$,deletedPath:rA}){if($===null)return $;if(sameArray(rA,$))return stepSelectionBack($);if($.lengthnA)return $;const oA=[...$],iA=nA-1;return iA<0||(oA[AA]=iA),oA}function stepSelectionBack($){return $.slice(0,$.length-1)}const listenForDeleteMiddleware=createListenerMiddleware();listenForDeleteMiddleware.startListening({actionCreator:DELETE_NODE,effect:async($,rA)=>{const tA=$.payload.path,AA=rA.getState().selected_path;if(AA===null)return;const eA=getNewSelectionPathAfterDeletion({selectedPath:AA,deletedPath:tA});rA.dispatch(SET_SELECTION({path:eA}))}});const listenForDeleteMiddleware$1=listenForDeleteMiddleware.middleware;function getPathAfterMove({fromPath:$,toPath:rA}){const tA=nodeDepth($);if(nodeDepth(rA)=oA)return rA;const iA=[...rA];return iA[eA]--,iA}const listenForNodeAddMiddleware=createListenerMiddleware();listenForNodeAddMiddleware.startListening({actionCreator:PLACE_NODE,effect:async($,rA)=>{const tA=$.payload;let AA=tA.path;isNodeMove(tA)&&(AA=getPathAfterMove({fromPath:tA.currentPath,toPath:AA})),rA.dispatch(SET_SELECTION({path:AA}))}});const listenForNodeAddMiddleware$1=listenForNodeAddMiddleware.middleware,listenForTemplateChooserMode=createListenerMiddleware();listenForTemplateChooserMode.startListening({actionCreator:SET_FULL_STATE,effect:async($,rA)=>{rA.dispatch(SET_SELECTION({path:[]}))}});const resetSelectionInTemplateChooser=listenForTemplateChooserMode.middleware,store=configureStore({reducer:{app_info:uiTreeReducer,meta_data:metaDataReducer,selected_path:selectedPathReducer,connected_to_server:connectedToServerReducer,currentlyDraggedNode:currentlyDraggedNodeReducer},middleware:$=>$().concat(listenForDeleteMiddleware$1).concat(listenForNodeAddMiddleware$1).concat(resetSelectionInTemplateChooser)});function ReduxProvider({children:$}){return jsx(Provider,{store,children:$})}const error_fallback_container="_error_fallback_container_121a4_1",error_fallback="_error_fallback_121a4_1",styles={error_fallback_container,error_fallback};function SUE({showMessages:$=!0,backendDispatch:{sendMsg:rA,incomingMsgs:tA,mode:AA}=staticDispatchFromTree(),pathToTreeSitterWasm:eA}){return jsx(ReduxProvider,{children:jsx($44d7e150ebc754d2$export$e926676385687eaf,{fallbackRender:WholeAppErrorFallback,children:jsx(BackendConnectionProvider,{...$?{sendMsg:rA,incomingMsgs:{subscribe:(oA,iA)=>tA.subscribe(oA,iA)},mode:AA}:{sendMsg:rA,incomingMsgs:tA,mode:AA},children:jsxs(TSParserProvider,{pathToTreeSitterWasm:eA,children:[jsx(EditorContainer,{}),jsx(k$6,{})]})})})})}const WholeAppErrorFallback=$=>jsx("div",{className:styles.error_fallback_container,children:jsxs("div",{className:mergeClasses("card",styles.error_fallback),children:[jsx("h2",{children:"Uh oh! you shouldn't be here..."}),jsx(GeneralErrorView,{header:"ShinyUiEditor encountered an error",generateIssueLink:rA=>generateGhIssueURL({title:"Error in ShinyUiEditor at root",body:`Error at root of editor: + `;oA.type="text/css",oA.id="joyride-beacon-animation",AA.nonce!==void 0&&oA.setAttribute("nonce",AA.nonce),oA.appendChild(document.createTextNode(iA)),nA.appendChild(oA)}return eA}return _createClass(tA,[{key:"componentDidMount",value:function(){var eA=this,nA=this.props.shouldFocus;setTimeout(function(){src_default.domElement(eA.beacon)&&nA&&eA.beacon.focus()},0)}},{key:"componentWillUnmount",value:function(){var eA=document.getElementById("joyride-beacon-animation");eA&&eA.parentNode.removeChild(eA)}},{key:"render",value:function(){var eA=this.props,nA=eA.beaconComponent,oA=eA.locale,iA=eA.onClickOrHover,lA=eA.styles,aA={"aria-label":oA.open,onClick:iA,onMouseEnter:iA,ref:this.setBeaconRef,title:oA.open},sA;if(nA){var cA=nA;sA=React.createElement(cA,aA)}else sA=React.createElement("button",_extends({key:"JoyrideBeacon",className:"react-joyride__beacon",style:lA.beacon,type:"button"},aA),React.createElement("span",{style:lA.beaconInner}),React.createElement("span",{style:lA.beaconOuter}));return sA}}]),tA}(React.Component);function JoyrideSpotlight($){var rA=$.styles;return React.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight",style:rA})}var _excluded$2=["mixBlendMode","zIndex"],JoyrideOverlay=function($){_inherits(tA,$);var rA=_createSuper(tA);function tA(){var AA;_classCallCheck(this,tA);for(var eA=arguments.length,nA=new Array(eA),oA=0;oA=uA&&fA<=uA+sA,EA=wA>=cA&&wA<=cA+gA,QA=EA&&BA;QA!==lA&&AA.updateState({mouseOverSpotlight:QA})}),_defineProperty(_assertThisInitialized(AA),"handleScroll",function(){var iA=AA.props.target,lA=getElement(iA);if(AA.scrollParent!==document){var aA=AA.state.isScrolling;aA||AA.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(AA.scrollTimeout),AA.scrollTimeout=setTimeout(function(){AA.updateState({isScrolling:!1,showSpotlight:!0})},50)}else hasPosition(lA,"sticky")&&AA.updateState({})}),_defineProperty(_assertThisInitialized(AA),"handleResize",function(){clearTimeout(AA.resizeTimeout),AA.resizeTimeout=setTimeout(function(){AA._isMounted&&AA.forceUpdate()},100)}),AA}return _createClass(tA,[{key:"componentDidMount",value:function(){var eA=this.props;eA.debug,eA.disableScrolling;var nA=eA.disableScrollParentFix,oA=eA.target,iA=getElement(oA);this.scrollParent=getScrollParent(iA,nA,!0),this._isMounted=!0,window.addEventListener("resize",this.handleResize)}},{key:"componentDidUpdate",value:function(eA){var nA=this,oA=this.props,iA=oA.lifecycle,lA=oA.spotlightClicks,aA=treeChanges(eA,this.props),sA=aA.changed;sA("lifecycle",LIFECYCLE.TOOLTIP)&&(this.scrollParent.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(function(){var cA=nA.state.isScrolling;cA||nA.updateState({showSpotlight:!0})},100)),(sA("spotlightClicks")||sA("disableOverlay")||sA("lifecycle"))&&(lA&&iA===LIFECYCLE.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):iA!==LIFECYCLE.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),this.scrollParent.removeEventListener("scroll",this.handleScroll)}},{key:"spotlightStyles",get:function(){var eA=this.state.showSpotlight,nA=this.props,oA=nA.disableScrollParentFix,iA=nA.spotlightClicks,lA=nA.spotlightPadding,aA=nA.styles,sA=nA.target,cA=getElement(sA),pA=getClientRect(cA),uA=hasPosition(cA),gA=getElementPosition(cA,lA,oA);return _objectSpread2(_objectSpread2({},isLegacy()?aA.spotlightLegacy:aA.spotlight),{},{height:Math.round(pA.height+lA*2),left:Math.round(pA.left-lA),opacity:eA?1:0,pointerEvents:iA?"none":"auto",position:uA?"fixed":"absolute",top:gA,transition:"opacity 0.2s",width:Math.round(pA.width+lA*2)})}},{key:"updateState",value:function(eA){this._isMounted&&this.setState(eA)}},{key:"render",value:function(){var eA=this.state,nA=eA.mouseOverSpotlight,oA=eA.showSpotlight,iA=this.props,lA=iA.disableOverlay,aA=iA.disableOverlayClose,sA=iA.lifecycle,cA=iA.onClickOverlay,pA=iA.placement,uA=iA.styles;if(lA||sA!==LIFECYCLE.TOOLTIP)return null;var gA=uA.overlay;isLegacy()&&(gA=pA==="center"?uA.overlayLegacyCenter:uA.overlayLegacy);var fA=_objectSpread2({cursor:aA?"default":"pointer",height:getDocumentHeight(),pointerEvents:nA?"none":"auto"},gA),wA=pA!=="center"&&oA&&React.createElement(JoyrideSpotlight,{styles:this.spotlightStyles});if(getBrowser()==="safari"){fA.mixBlendMode,fA.zIndex;var BA=_objectWithoutProperties(fA,_excluded$2);wA=React.createElement("div",{style:_objectSpread2({},BA)},wA),delete fA.backgroundColor}return React.createElement("div",{className:"react-joyride__overlay",style:fA,onClick:cA},wA)}}]),tA}(React.Component),_excluded$1=["styles"],_excluded2=["color","height","width"];function JoyrideTooltipCloseBtn($){var rA=$.styles,tA=_objectWithoutProperties($,_excluded$1),AA=rA.color,eA=rA.height,nA=rA.width,oA=_objectWithoutProperties(rA,_excluded2);return React.createElement("button",_extends({style:oA,type:"button"},tA),React.createElement("svg",{width:typeof nA=="number"?"".concat(nA,"px"):nA,height:typeof eA=="number"?"".concat(eA,"px"):eA,viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},React.createElement("g",null,React.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:AA}))))}var JoyrideTooltipContainer=function($){_inherits(tA,$);var rA=_createSuper(tA);function tA(){return _classCallCheck(this,tA),rA.apply(this,arguments)}return _createClass(tA,[{key:"render",value:function(){var eA=this.props,nA=eA.backProps,oA=eA.closeProps,iA=eA.continuous,lA=eA.index,aA=eA.isLastStep,sA=eA.primaryProps,cA=eA.size,pA=eA.skipProps,uA=eA.step,gA=eA.tooltipProps,fA=uA.content,wA=uA.hideBackButton,BA=uA.hideCloseButton,EA=uA.hideFooter,QA=uA.showProgress,dA=uA.showSkipButton,yA=uA.title,hA=uA.styles,vA=uA.locale,CA=vA.back,xA=vA.close,IA=vA.last,OA=vA.next,PA=vA.skip,$A={primary:xA};return iA&&($A.primary=aA?IA:OA,QA&&($A.primary=React.createElement("span",null,$A.primary," (",lA+1,"/",cA,")"))),dA&&!aA&&($A.skip=React.createElement("button",_extends({style:hA.buttonSkip,type:"button","aria-live":"off"},pA),PA)),!wA&&lA>0&&($A.back=React.createElement("button",_extends({style:hA.buttonBack,type:"button"},nA),CA)),$A.close=!BA&&React.createElement(JoyrideTooltipCloseBtn,_extends({styles:hA.buttonClose},oA)),React.createElement("div",_extends({key:"JoyrideTooltip",className:"react-joyride__tooltip",style:hA.tooltip},gA),React.createElement("div",{style:hA.tooltipContainer},yA&&React.createElement("h4",{style:hA.tooltipTitle,"aria-label":yA},yA),React.createElement("div",{style:hA.tooltipContent},fA)),!EA&&React.createElement("div",{style:hA.tooltipFooter},React.createElement("div",{style:hA.tooltipFooterSpacer},$A.skip),$A.back,React.createElement("button",_extends({style:hA.buttonNext,type:"button"},sA),$A.primary)),$A.close)}}]),tA}(React.Component),_excluded=["beaconComponent","tooltipComponent"],JoyrideTooltip=function($){_inherits(tA,$);var rA=_createSuper(tA);function tA(){var AA;_classCallCheck(this,tA);for(var eA=arguments.length,nA=new Array(eA),oA=0;oA0||oA===ACTIONS.PREV),hA=EA("action")||EA("index")||EA("lifecycle")||EA("status"),vA=QA("lifecycle",[LIFECYCLE.TOOLTIP,LIFECYCLE.INIT],LIFECYCLE.INIT),CA=EA("action",[ACTIONS.NEXT,ACTIONS.PREV,ACTIONS.SKIP,ACTIONS.CLOSE]);if(CA&&(vA||aA)&&iA(_objectSpread2(_objectSpread2({},dA),{},{index:eA.index,lifecycle:LIFECYCLE.COMPLETE,step:eA.step,type:EVENTS.STEP_AFTER})),fA.placement==="center"&&gA===STATUS.RUNNING&&EA("index")&&oA!==ACTIONS.START&&pA===LIFECYCLE.INIT&&wA({lifecycle:LIFECYCLE.READY}),hA){var xA=getElement(fA.target),IA=!!xA,OA=IA&&isElementVisible(xA);OA?(QA("status",STATUS.READY,STATUS.RUNNING)||QA("lifecycle",LIFECYCLE.INIT,LIFECYCLE.READY))&&iA(_objectSpread2(_objectSpread2({},dA),{},{step:fA,type:EVENTS.STEP_BEFORE})):(console.warn(IA?"Target not visible":"Target not mounted",fA),iA(_objectSpread2(_objectSpread2({},dA),{},{type:EVENTS.TARGET_NOT_FOUND,step:fA})),aA||wA({index:cA+([ACTIONS.PREV].indexOf(oA)!==-1?-1:1)}))}QA("lifecycle",LIFECYCLE.INIT,LIFECYCLE.READY)&&wA({lifecycle:hideBeacon(fA)||yA?LIFECYCLE.TOOLTIP:LIFECYCLE.BEACON}),EA("index")&&log({title:"step:".concat(pA),data:[{key:"props",value:this.props}],debug:sA}),EA("lifecycle",LIFECYCLE.BEACON)&&iA(_objectSpread2(_objectSpread2({},dA),{},{step:fA,type:EVENTS.BEACON})),EA("lifecycle",LIFECYCLE.TOOLTIP)&&(iA(_objectSpread2(_objectSpread2({},dA),{},{step:fA,type:EVENTS.TOOLTIP})),this.scope=new Scope(this.tooltip,{selector:"[data-action=primary]"}),this.scope.setFocus()),QA("lifecycle",[LIFECYCLE.TOOLTIP,LIFECYCLE.INIT],LIFECYCLE.INIT)&&(this.scope.removeScope(),delete this.beaconPopper,delete this.tooltipPopper)}},{key:"componentWillUnmount",value:function(){this.scope.removeScope()}},{key:"open",get:function(){var eA=this.props,nA=eA.step,oA=eA.lifecycle;return!!(hideBeacon(nA)||oA===LIFECYCLE.TOOLTIP)}},{key:"render",value:function(){var eA=this.props,nA=eA.continuous,oA=eA.debug,iA=eA.helpers,lA=eA.index,aA=eA.lifecycle,sA=eA.nonce,cA=eA.shouldScroll,pA=eA.size,uA=eA.step,gA=getElement(uA.target);return!validateStep(uA)||!src_default.domElement(gA)?null:React.createElement("div",{key:"JoyrideStep-".concat(lA),className:"react-joyride__step"},React.createElement(JoyridePortal,{id:"react-joyride-portal"},React.createElement(JoyrideOverlay,_extends({},uA,{debug:oA,lifecycle:aA,onClickOverlay:this.handleClickOverlay}))),React.createElement(ReactFloater,_extends({component:React.createElement(JoyrideTooltip,{continuous:nA,helpers:iA,index:lA,isLastStep:lA+1===pA,setTooltipRef:this.setTooltipRef,size:pA,step:uA}),debug:oA,getPopper:this.setPopper,id:"react-joyride-step-".concat(lA),isPositioned:uA.isFixed||hasPosition(gA),open:this.open,placement:uA.placement,target:uA.target},uA.floaterProps),React.createElement(JoyrideBeacon,{beaconComponent:uA.beaconComponent,locale:uA.locale,nonce:sA,onClickOrHover:this.handleClickHoverBeacon,shouldFocus:cA,styles:uA.styles})))}}]),tA}(React.Component),Joyride=function($){_inherits(tA,$);var rA=_createSuper(tA);function tA(AA){var eA;return _classCallCheck(this,tA),eA=rA.call(this,AA),_defineProperty(_assertThisInitialized(eA),"initStore",function(){var nA=eA.props,oA=nA.debug,iA=nA.getHelpers,lA=nA.run,aA=nA.stepIndex;eA.store=new createStore(_objectSpread2(_objectSpread2({},eA.props),{},{controlled:lA&&src_default.number(aA)})),eA.helpers=eA.store.getHelpers();var sA=eA.store.addListener;return log({title:"init",data:[{key:"props",value:eA.props},{key:"state",value:eA.state}],debug:oA}),sA(eA.syncState),iA(eA.helpers),eA.store.getState()}),_defineProperty(_assertThisInitialized(eA),"callback",function(nA){var oA=eA.props.callback;src_default.function(oA)&&oA(nA)}),_defineProperty(_assertThisInitialized(eA),"handleKeyboard",function(nA){var oA=eA.state,iA=oA.index,lA=oA.lifecycle,aA=eA.props.steps,sA=aA[iA],cA=window.Event?nA.which:nA.keyCode;lA===LIFECYCLE.TOOLTIP&&cA===27&&sA&&!sA.disableCloseOnEsc&&eA.store.close()}),_defineProperty(_assertThisInitialized(eA),"syncState",function(nA){eA.setState(nA)}),_defineProperty(_assertThisInitialized(eA),"setPopper",function(nA,oA){oA==="wrapper"?eA.beaconPopper=nA:eA.tooltipPopper=nA}),_defineProperty(_assertThisInitialized(eA),"shouldScroll",function(nA,oA,iA,lA,aA,sA,cA){return!nA&&(oA!==0||iA||lA===LIFECYCLE.TOOLTIP)&&aA.placement!=="center"&&(!aA.isFixed||!hasPosition(sA))&&cA.lifecycle!==lA&&[LIFECYCLE.BEACON,LIFECYCLE.TOOLTIP].indexOf(lA)!==-1}),eA.state=eA.initStore(),eA}return _createClass(tA,[{key:"componentDidMount",value:function(){if(canUseDOM){var eA=this.props,nA=eA.disableCloseOnEsc,oA=eA.debug,iA=eA.run,lA=eA.steps,aA=this.store.start;validateSteps(lA,oA)&&iA&&aA(),nA||document.body.addEventListener("keydown",this.handleKeyboard,{passive:!0})}}},{key:"componentDidUpdate",value:function(eA,nA){if(canUseDOM){var oA=this.state,iA=oA.action,lA=oA.controlled,aA=oA.index,sA=oA.lifecycle,cA=oA.status,pA=this.props,uA=pA.debug,gA=pA.run,fA=pA.stepIndex,wA=pA.steps,BA=eA.steps,EA=eA.stepIndex,QA=this.store,dA=QA.reset,yA=QA.setSteps,hA=QA.start,vA=QA.stop,CA=QA.update,xA=treeChanges(eA,this.props),IA=xA.changed,OA=treeChanges(nA,this.state),PA=OA.changed,$A=OA.changedFrom,jA=getMergedStep(wA[aA],this.props),MA=!isEqual(BA,wA),RA=src_default.number(fA)&&IA("stepIndex"),HA=getElement(jA==null?void 0:jA.target);if(MA&&(validateSteps(wA,uA)?yA(wA):console.warn("Steps are not valid",wA)),IA("run")&&(gA?hA(fA):vA()),RA){var DA=EA=0?hA:0,lA===STATUS.RUNNING&&scrollTo(hA,yA,fA)}}}},{key:"render",value:function(){if(!canUseDOM)return null;var eA=this.state,nA=eA.index,oA=eA.status,iA=this.props,lA=iA.continuous,aA=iA.debug,sA=iA.nonce,cA=iA.scrollToFirstStep,pA=iA.steps,uA=getMergedStep(pA[nA],this.props),gA;return oA===STATUS.RUNNING&&uA&&(gA=React.createElement(JoyrideStep,_extends({},this.state,{callback:this.callback,continuous:lA,debug:aA,setPopper:this.setPopper,helpers:this.helpers,nonce:sA,shouldScroll:!uA.disableScrolling&&(nA!==0||cA),step:uA,update:this.store.update}))),React.createElement("div",{className:"react-joyride"},gA)}}]),tA}(React.Component);_defineProperty(Joyride,"defaultProps",{continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:function $(){},hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]});function AppTour(){const[$,rA]=reactExports.useState(0),[tA,AA]=reactExports.useState(!1),eA=useMetaData(),nA=eA===null?!1:eA.app_preview,oA=aA=>{const{action:sA,index:cA,type:pA}=aA;(pA===EVENTS.STEP_AFTER||pA===EVENTS.TARGET_NOT_FOUND)&&(sA===ACTIONS.NEXT?rA(cA+1):sA===ACTIONS.PREV?rA(cA-1):sA===ACTIONS.CLOSE&&AA(!1)),pA===EVENTS.TOUR_END&&(sA===ACTIONS.NEXT&&(AA(!1),rA(0)),sA===ACTIONS.SKIP&&AA(!1))},iA=()=>{AA(!0)},lA=reactExports.useMemo(()=>[{target:"[aria-label='App Skeleton']",disableBeacon:!0,content:jsxs("div",{children:[jsx("p",{children:"The app view shows a skeleton view of the current state of your app's UI."}),jsx("p",{children:"You can click on elements to select them or drag them around to move them."}),jsx("p",{children:"Cards can be resized by dragging resize handles on the sides."}),jsx("p",{children:"Rows and Columns can be resized by dragging between tracts and added by hovering over the left and top respectively to reveal the tract controls widget."}),jsx("p",{children:jsx("a",{href:"https://rstudio.github.io/shinyuieditor/articles/how-to.html#show-size-widget",children:"More info"})})]})},{target:"[aria-label='Elements Panel']",content:jsxs("div",{children:[jsx("p",{children:"Drag elements from the elements palette into the app pane on the right to add them to your app."}),jsxs("p",{children:["In the app view, the areas available for the element to be dropped in will pulse orange:"," ",jsx("span",{className:mergeClasses(styles$h.can_accept_drop,"text-transparent"),"aria-hidden":"true",style:{padding:"2px"},children:"drop"}),"."]})]}),placement:"right-start",disableBeacon:!0},{target:"[aria-label='Properties panel']",content:jsxs("div",{children:[jsx("p",{children:"After selecting an element in your app, you can adjust the settings for that element in the properties pane."}),jsx("p",{children:"Changes made will be automatically applied to your element both in the app view and your code so there's no need to save or submit these changes."})]}),placement:"left-start"},{target:"[aria-label='App Preview']",content:nA?jsxs("div",{children:[jsx("p",{children:"At any point while editing your application you can see the code to recreate the current app."}),jsx("p",{children:"Simply copy and paste the code into your editor of choice to get going with your app."})]}):jsxs("div",{children:[jsx("p",{children:"You can see how the changes impact your app with the app preview."}),jsx("p",{children:"Click in the center of the preview to expand it to full screen to get a better view of your app."}),jsx("p",{children:'Any log messages from the app will be placed into the "App Logs" drawer.'})]}),placement:"top-start"},{target:"[aria-label='Undo/Redo buttons']",content:"Mess something up? You can use the change history to undo or redo your changes",placement:"bottom"}],[nA]);return jsxs(Fragment,{children:[jsxs(Button,{onClick:iA,title:"Take a guided tour of app",variant:"transparent",children:[jsx(PngIcon,{id:"tour",size:"24px"}),"Tour App"]}),jsx(Joyride,{callback:oA,steps:lA,stepIndex:$,run:tA,continuous:!0,showProgress:!0,showSkipButton:!0,disableScrolling:!0,locale:{next:"Next",back:"Back",close:"Close",last:"Let's go!",open:"Open the dialog",skip:"Skip tour"},styles:joyrideStyles})]})}const beaconColorBase="#e07189",beaconColorLight="#f6d5dc",joyrideStyles={options:{arrowColor:"var(--rstudio-white, white)",backgroundColor:"var(--rstudio-white, white)",primaryColor:"var(--rstudio-blue, steelblue)",textColor:"var(--rstudio-grey, black)"},beaconInner:{backgroundColor:beaconColorBase},beaconOuter:{backgroundColor:beaconColorLight,border:`2px solid ${beaconColorBase}`},tooltipContainer:{textAlign:"left"}},SvgShinyLogo=$=>jsx("svg",{viewBox:"0 0 168 114",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"Shiny Logo",...$,children:jsx("path",{opacity:.9,d:"M17.524 62.626c-.898-.027-.3 0 0 0Zm-.027 0c-.871-.027-.49 0-.19 0h.462-.272c.272.027.19 0 0 0Zm.244 0c9.497.218 19.43-1.986 22.313-13.279 1.878-7.293-2.802-12.599-6.938-17.932-.028-.027-.055-.054-.055-.109-.163-.68-4.653-4.816-5.904-6.367 0-.027-.028-.027-.055-.055-.599-.435-1.224-2.64-1.524-3.864a3.323 3.323 0 0 1-.027-1.55c1.089-5.552 1.687-9.606 9.061-8.409 5.306.871 2.558 8.653 5.415 9.415h.055c1.714.164 5.06-3.945 5.55-5.333 1.905-5.388-9.088-8.68-12.435-8.463-6.72.408-11.129 4.055-13.823 10.068-4.952 11.075 4.3 18.45 9.905 26.041 4.245 5.742 4.054 10.857-1.143 15.782-5.714 5.415-12.354-2.04-13.116-7.292-.68-4.816-.625-8.163-4.653-2.04-3.728 5.686.11 13.088 7.374 13.387ZM167.266 36.34v.055a13.555 13.555 0 0 1-.762 3.428 27.79 27.79 0 0 1-2.693 5.306c-1.334 2.041-2.041 2.857-3.429 4.653-2.612 3.402-4.626 5.932-7.674 9.17-4.244 4.49-8.979 9.633-14.149 13.306-7.374 5.28-16.68 6.722-25.497 7.538-25.796 2.34-63.755 5.823-71.755 33.741-.054.164-.19.245-.354.191-.081-.027-.136-.055-.163-.136-7.837-13.388-24.68-23.211-40.3-22.748-.162.027-.299-.055-.326-.218-.027-.163.055-.3.218-.327 40.218-19.972 81.306-10.394 124.735-18.15 10.857-1.931 19.972-9.06 26.53-17.632 2.504-3.238 5.715-5.986 7.919-9.442.353-.572 2.176-5.116-.653-3.184-4.381 2.966-8.082 6.64-12.844 8.953a5.605 5.605 0 0 1-.707.299c-.082.027-.137.109-.164.19a27.286 27.286 0 0 1-2.857 6.368 18.325 18.325 0 0 1-5.66 5.632c-2.122 1.415-4.598 2.232-7.129 2.422-.354.027-.68.027-1.034.027-2.014 0-3.32-.163-4.871-.952-1.986-1.034-2.612-2.721-2.748-4.762-.082-1.224.68-2.558 1.306-3.565.626-1.006 1.633-2.122 2.34-2.421l.055-.028c3.537-2.612 9.551-2.802 13.632-3.918.109-.027.191-.109.191-.19l2.041-7.456c.054-.163-.055-.3-.191-.354a.301.301 0 0 0-.299.109 40.263 40.263 0 0 1-3.402 4.326c-1.605 1.688-2.857 2.721-3.809 3.102a11.152 11.152 0 0 1-3.374.708c-1.361.082-2.531-.463-3.429-1.605-.898-1.143-1.388-2.83-1.496-5.062a8.521 8.521 0 0 1 0-1.197.312.312 0 0 0-.191-.354.313.313 0 0 0-.354.19c-.435.844-.87 1.633-1.306 2.34-1.279 2.232-2.884 4.273-4.707 6.096-1.796 1.796-3.538 2.748-5.143 2.857-3.021.19-4.653-1.523-4.871-5.115-.218-3.429 1.143-10.477 4.082-20.98.163-.462.217-.952.19-1.415-.054-.952-.598-1.333-1.714-1.252a6.312 6.312 0 0 0-3.51 1.47 12.19 12.19 0 0 0-3.021 3.837c-.898 1.632-1.687 3.32-2.421 5.034a42.75 42.75 0 0 0-1.878 5.823c-.544 2.204-1.007 4.054-1.306 5.496a144.944 144.944 0 0 0-.925 4.708c-.218 1.143-.463 2.557-.517 2.775l-.055.218-7.483.49-.027-.272c-.054-.654.49-2.966 1.578-7.02l-.653 1.142a29.066 29.066 0 0 1-4.68 6.095c-1.796 1.796-3.537 2.749-5.143 2.857h-.326c-2.64 0-4.136-2.068-4.381-6.15-.055-.816-.082-1.632-.055-2.475a.312.312 0 0 0-.19-.354.312.312 0 0 0-.354.19c-4.109 7.538-7.81 11.347-11.238 11.565-3.02.19-4.653-1.605-4.898-5.36-.272-4.164.87-10.26 3.401-18.096.545-1.932.79-3.265.735-3.973-.082-1.088-.571-1.224-.98-1.224h-.108c-.354.027-1.116.245-2.722 1.252a14.477 14.477 0 0 0-3.646 3.4c-1.17 1.525-2.095 3.239-2.775 5.035-.708 1.905-1.28 3.565-1.687 4.952-.408 1.388-.817 3.102-1.225 5.062-.408 1.959-.762 3.646-1.088 4.898a73.777 73.777 0 0 0-.98 4.353l-.054.218-7.184.462c-.163 0-.3-.108-.3-.272v-.108c1.062-3.674 2.559-9.633 4.463-17.688 1.905-8.054 3.647-14.503 5.061-19.129 1.225-4.027 2.667-8 4.354-11.836a32.438 32.438 0 0 1 5.225-8.273c2.04-2.285 4.326-3.51 6.748-3.673 2.558-.163 3.919 1.116 4.109 3.755.109 1.769-.408 4.136-1.524 7.102-2.04 5.252-5.442 11.374-10.15 18.204a.296.296 0 0 0 0 .408c.11.11.3.11.409 0a16.315 16.315 0 0 1 2.612-1.66c1.36-.707 2.857-1.115 4.408-1.251 2.912-.19 4.463 1.143 4.653 3.945a8.216 8.216 0 0 1-.326 3.048c-.273.898-.572 1.96-.926 3.13-.326 1.17-.598 2.149-.816 2.884-.218.761-.49 1.768-.844 3.047-.353 1.28-.625 2.395-.789 3.266-.49 2.204-.68 3.972-.598 5.251.109 1.633.762 1.633.98 1.633h.081c2.748-.163 5.986-4.953 9.66-14.204.027-.055.027-.082.054-.136a64.454 64.454 0 0 1 3.184-8.925c1.524-3.347 3.374-5.116 5.551-5.252l4.354-.218c.163 0 .299.109.299.272a.31.31 0 0 1-.082.218c-.68.653-1.578 2.395-2.666 5.197-1.143 3.02-1.932 5.089-2.45 6.476-.516 1.443-1.115 3.402-1.74 5.85-.627 2.45-.899 4.409-.79 5.878.136 1.932.87 1.932 1.116 1.932h.081c.381-.027 1.089-.299 2.368-1.47a14.924 14.924 0 0 0 2.53-3.02c.653-1.06 1.36-2.394 2.15-4.027.79-1.632 1.47-3.047 2.04-4.245.627-1.279.872-1.714 1.035-1.877l.354-.653c1.333-5.388 1.959-9.17 1.823-11.266a2.31 2.31 0 0 0-.245-1.034c-.082-.108-.082-.299.054-.38a.387.387 0 0 1 .163-.055l3.02-.19c1.77-.11 2.885 0 3.457.38.571.381.925 1.007.952 1.66a9.83 9.83 0 0 1-.19 1.987c-.028.163.081.3.245.326.081.028.19-.027.244-.081 3.402-3.538 6.939-5.442 10.585-5.66 2.912-.19 4.49 1.197 4.654 4.109.054.925 0 1.85-.191 2.775-.19.925-.653 2.721-1.469 5.497-1.715 5.959-2.531 9.959-2.395 11.918.082 1.388.626 1.551 1.034 1.551h.082c.381-.027 1.088-.3 2.34-1.496a17.296 17.296 0 0 0 2.558-3.075 43.208 43.208 0 0 0 2.177-3.973c.789-1.578 1.442-2.993 2.013-4.19.191-.436.354-.762.49-1.035 0-.027.027-.027.027-.054.789-3.32 1.714-6.068 2.776-8.19 1.224-2.504 2.612-4.164 4.081-4.98 1.47-.816 3.483-1.279 6.068-1.442a.58.58 0 0 1 .626.517v.054c.027.3-.136.626-.462 1.034-1.824 1.987-3.592 5.497-5.307 10.45-1.714 4.952-2.448 9.115-2.258 12.435.109 1.523.49 2.313 1.143 2.313h.054c1.606-.11 3.647-2.096 6.014-5.932a50.108 50.108 0 0 0 5.442-11.674c.163-.544.381-1.306.68-2.34.3-1.034.517-1.714.626-2.095.109-.381.327-.925.599-1.606.19-.544.462-1.034.789-1.496.218-.245.544-.572.925-.98.381-.408.816-.707 1.333-.87a19.15 19.15 0 0 1 3.919-.735l3.02-.19c.136-.055.3.026.354.162.054.137-.027.3-.163.354l-.055.055c-1.36 1.06-2.694 3.591-3.945 7.537-1.034 3.347-1.905 6.449-2.585 9.197a295.694 295.694 0 0 1-1.279 5.034c-.164.599-.517 2.068-1.061 4.3a177.514 177.514 0 0 1-1.062 4.19c-.054.136 0 .3.136.354.082.027.191.027.272-.055a43.638 43.638 0 0 0 8.164-6.313c1.387-1.387 11.918-13.088 12.408-5.66l.054.327ZM66.503 2.708c-1.06.054-2.938 1.687-5.768 8.98-1.96 5.033-3.864 10.775-5.687 17.087-.055.164.054.3.19.354.109.027.245 0 .327-.109 4.898-7.483 8.299-13.714 10.095-18.585 1.115-3.32 1.633-5.523 1.578-6.503-.082-1.197-.544-1.197-.68-1.197l-.055-.027ZM137.17 54c.054-.136-.027-.3-.163-.354a.173.173 0 0 0-.163 0c-1.47.3-2.939.544-4.381.898-2.041.49-5.143.98-6.722 2.694-.027.027-.027.054-.054.082-.272.598-.326 1.55-.272 2.748.054.844.871 1.633 1.578 2.204a3.24 3.24 0 0 0 2.313.68c3.211-.244 5.85-3.238 7.864-8.952ZM88.517 18.98c1.742-.082 3.918-.735 4.435-3.32.245-1.17-.462-2.504-.898-2.885-.435-.38-1.034-.544-1.823-.49-.789.055-1.741.545-2.64 1.389-1.196 1.115-1.142 2.72-.761 3.782.354.898.98 1.496 1.687 1.524Z",fill:"#fff"})}),container="_container_1d7pe_1",classes={container};function UndoRedoButtons({goBackward:$,canGoBackward:rA,goForward:tA,canGoForward:AA}){return jsxs("div",{className:mergeClasses(classes.container,"undo-redo-buttons"),"aria-label":"Undo/Redo buttons",children:[jsx(Button,{variant:["transparent","icon"],disabled:!rA,"aria-label":"Undo last change",title:"Undo last change",onClick:$,children:jsx(SvgUndo,{height:"100%"})}),jsx(Button,{variant:["transparent","icon"],disabled:!AA,"aria-label":"Redo last change",title:"Redo last change",onClick:tA,children:jsx(SvgRedo,{height:"100%"})})]})}const shiny_logo="_shiny_logo_ywfqv_1",app_title="_app_title_ywfqv_10",divider="_divider_ywfqv_15",header="_header_ywfqv_21",OpenSideBySideWindowButton$1="_OpenSideBySideWindowButton_ywfqv_30",right="_right_ywfqv_55",spacer="_spacer_ywfqv_67",last="_last_ywfqv_71",styles$2={shiny_logo,app_title,divider,header,OpenSideBySideWindowButton:OpenSideBySideWindowButton$1,"react-joyride":"_react-joyride_ywfqv_47","undo-redo-buttons":"_undo-redo-buttons_ywfqv_51",right,spacer,last};function SiPython($){return GenIcon({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"title",attr:{},child:[]},{tag:"path",attr:{d:"M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"}}]})($)}function SiR($){return GenIcon({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"title",attr:{},child:[]},{tag:"path",attr:{d:"M12 2.746c-6.627 0-12 3.599-12 8.037 0 3.897 4.144 7.144 9.64 7.88V16.26c-2.924-.915-4.925-2.755-4.925-4.877 0-3.035 4.084-5.494 9.12-5.494 5.038 0 8.757 1.683 8.757 5.494 0 1.976-.999 3.379-2.662 4.272.09.066.174.128.258.216.169.149.25.363.372.544 2.128-1.45 3.44-3.437 3.44-5.631 0-4.44-5.373-8.038-12-8.038zm-2.111 4.99v13.516l4.093-.002-.002-5.291h1.1c.225 0 .321.066.549.25.272.22.715.982.715.982l2.164 4.063 4.627-.002-2.864-4.826s-.086-.193-.265-.383a2.22 2.22 0 00-.582-.416c-.422-.214-1.149-.434-1.149-.434s3.578-.264 3.578-3.826c0-3.562-3.744-3.63-3.744-3.63zm4.127 2.93l2.478.002s1.149-.062 1.149 1.127c0 1.165-1.149 1.17-1.149 1.17h-2.478zm1.754 6.119c-.494.049-1.012.079-1.54.088v1.807a16.622 16.622 0 002.37-.473l-.471-.891s-.108-.183-.248-.394c-.039-.054-.08-.098-.111-.137z"}}]})($)}const language_badge="_language_badge_67rf7_1",styles$1={language_badge};function LanguageModeBadge(){const $=useLanguageMode();return jsxs(Tooltip,{placement:"bottom-start",children:[jsx(TooltipTrigger,{asChild:!0,children:jsx("div",{className:styles$1.language_badge,children:$==="PYTHON"?jsx(SiPython,{height:"100%",width:"100%"}):jsx(SiR,{height:"100%",width:"100%"})})}),jsxs(TooltipContent,{children:["Current language is ",$==="PYTHON"?"Python":"R",". Only supported ui elements for the language are shown."]})]})}function OpenSideBySideWindowButton(){const{sendMsg:$,mode:rA}=useBackendConnection();return rA!=="VSCODE"?null:jsxs(Fragment,{children:[jsx(PopoverButton,{className:"OpenSideBySideWindowButton mr-2",popoverContent:"Open app code next to editor",placement:"bottom",variant:["icon","transparent"],onClick:()=>{$({path:"OPEN-COMPANION-EDITOR",payload:"BESIDE"})},children:jsx(FaCode,{})}),jsx("div",{className:"divider"})]})}function HeaderView({state:$,history:rA}){return jsxs("header",{className:styles$2.header,children:[jsx(SvgShinyLogo,{className:styles$2.shiny_logo}),jsx("h1",{className:styles$2.app_title,children:"Shiny UI Editor"}),jsx(LanguageModeBadge,{}),jsxs("div",{className:styles$2.right,children:[$.mode==="MAIN"?jsxs(Fragment,{children:[jsx(OpenSideBySideWindowButton,{}),jsx(AppTour,{})]}):null,jsx("div",{className:styles$2.divider}),jsx(UndoRedoButtons,{...rA}),jsx("div",{className:mergeClasses(styles$2.spacer,styles$2.last)})]})]})}function LostConnectionPopup(){return useSelector(rA=>rA.connected_to_server)?null:jsx(PortalModal,{onConfirm:()=>{},onCancel:()=>{},children:jsx("p",{style:{color:"var(--red, pink)",textAlign:"center"},children:"Lost connection to backend. Check console where editor was launched for details."})})}function EditorContainer(){const{state:$,history:rA}=useSyncUiWithBackend();return jsx(HistoryGoBackwardProvider,{goBackward:rA.goBackward,canGoBackward:rA.canGoBackward,children:jsxs("div",{className:styles$7.EditorContainer,style:sizes_inline_styles,children:[jsx(HeaderView,{state:$,history:rA}),jsx(EditorView,{state:$}),jsx(LostConnectionPopup,{})]})})}const connectedToServerSlice=createSlice({name:"connectedToServer",initialState:!0,reducers:{DISCONNECTED_FROM_SERVER:($,rA)=>!1}}),connectedToServerReducer=connectedToServerSlice.reducer;function getNewSelectionPathAfterDeletion({selectedPath:$,deletedPath:rA}){if($===null)return $;if(sameArray(rA,$))return stepSelectionBack($);if($.lengthnA)return $;const oA=[...$],iA=nA-1;return iA<0||(oA[AA]=iA),oA}function stepSelectionBack($){return $.slice(0,$.length-1)}const listenForDeleteMiddleware=createListenerMiddleware();listenForDeleteMiddleware.startListening({actionCreator:DELETE_NODE,effect:async($,rA)=>{const tA=$.payload.path,AA=rA.getState().selected_path;if(AA===null)return;const eA=getNewSelectionPathAfterDeletion({selectedPath:AA,deletedPath:tA});rA.dispatch(SET_SELECTION({path:eA}))}});const listenForDeleteMiddleware$1=listenForDeleteMiddleware.middleware;function getPathAfterMove({fromPath:$,toPath:rA}){const tA=nodeDepth($);if(nodeDepth(rA)=oA)return rA;const iA=[...rA];return iA[eA]--,iA}const listenForNodeAddMiddleware=createListenerMiddleware();listenForNodeAddMiddleware.startListening({actionCreator:PLACE_NODE,effect:async($,rA)=>{const tA=$.payload;let AA=tA.path;isNodeMove(tA)&&(AA=getPathAfterMove({fromPath:tA.currentPath,toPath:AA})),rA.dispatch(SET_SELECTION({path:AA}))}});const listenForNodeAddMiddleware$1=listenForNodeAddMiddleware.middleware,listenForTemplateChooserMode=createListenerMiddleware();listenForTemplateChooserMode.startListening({actionCreator:SET_FULL_STATE,effect:async($,rA)=>{rA.dispatch(SET_SELECTION({path:[]}))}});const resetSelectionInTemplateChooser=listenForTemplateChooserMode.middleware,store=configureStore({reducer:{app_info:uiTreeReducer,meta_data:metaDataReducer,selected_path:selectedPathReducer,connected_to_server:connectedToServerReducer,currentlyDraggedNode:currentlyDraggedNodeReducer},middleware:$=>$().concat(listenForDeleteMiddleware$1).concat(listenForNodeAddMiddleware$1).concat(resetSelectionInTemplateChooser)});function ReduxProvider({children:$}){return jsx(Provider,{store,children:$})}const error_fallback_container="_error_fallback_container_121a4_1",error_fallback="_error_fallback_121a4_1",styles={error_fallback_container,error_fallback};function SUE({showMessages:$=!0,backendDispatch:{sendMsg:rA,incomingMsgs:tA,mode:AA}=staticDispatchFromTree(),pathToTreeSitterWasm:eA}){return jsx(ReduxProvider,{children:jsx($44d7e150ebc754d2$export$e926676385687eaf,{fallbackRender:WholeAppErrorFallback,children:jsx(BackendConnectionProvider,{...$?{sendMsg:rA,incomingMsgs:{subscribe:(oA,iA)=>tA.subscribe(oA,iA)},mode:AA}:{sendMsg:rA,incomingMsgs:tA,mode:AA},children:jsxs(TSParserProvider,{pathToTreeSitterWasm:eA,children:[jsx(EditorContainer,{}),jsx(k$6,{})]})})})})}const WholeAppErrorFallback=$=>jsx("div",{className:styles.error_fallback_container,children:jsxs("div",{className:mergeClasses("card",styles.error_fallback),children:[jsx("h2",{children:"Uh oh! you shouldn't be here..."}),jsx(GeneralErrorView,{header:"ShinyUiEditor encountered an error",generateIssueLink:rA=>generateGhIssueURL({title:"Error in ShinyUiEditor at root",body:`Error at root of editor: ${generateSerializedStateForError(rA)}`}),...$})]})});function runSUE({container:$,showMessages:rA,backendDispatch:tA}){createRoot($).render(jsx(SUE,{backendDispatch:tA,showMessages:rA}))}const devModeApp="TEMPLATE_CHOOSER",language="R",app_script=devModeApp,showMessages=!0;(async()=>{try{const $=makeMessageDispatcher(),rA=await setupWebsocketBackend({messageDispatch:$,onClose:()=>console.log("Websocket closed!!"),pathToWebsocket:DEV_MODE?"localhost:8888":void 0}),tA=rA==="NO-WS-CONNECTION"?setupStaticBackend({messageDispatch:$,showMessages,defaultInfo:{language,app_script}}):rA;runSUE({container:document.getElementById("root"),backendDispatch:tA,showMessages})}catch{}})(); diff --git a/inst/editor/build/index.html b/inst/editor/build/index.html index 514e8415a..ccfb5d09c 100644 --- a/inst/editor/build/index.html +++ b/inst/editor/build/index.html @@ -26,7 +26,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Shiny UI Editor - + diff --git a/inst/vscode-extension/shinyuieditor-0.5.1.vsix b/inst/vscode-extension/shinyuieditor-0.5.1.vsix index e18a54cb4c066638262bb51f3858c79640b25f41..3fa50baa0d5b2ab2cdddb6c98d8509574ec9397f 100644 GIT binary patch delta 1009 zcmXZaOH30%7zc2=v#pD?JlXZQWISOoO%(6OgIqiqh{gYW%i)*)_nY~q`)y|7={#EiPggrr z{TUgWmN7XIf8%Lp48L=|tk%J5C*sK`YA3rr5w{lohXcv98j{7iYG=@1O}ID}mRvPd zuqLy8`oo}R1~msLz(55jxL^y&^-S0*f?8HpzdXXKjOOWLDv>p?LXYzQ%(Z$qcpw{c zAXlu_=Y?|R784z!GU~0HrG|e~M!;%|=H-j$>)!8PSrd30%}41`neU~8-Nislu7Gu4 z;a<^O?)y@iCg#y+%<3-}b7rns#POpF2HIMa~@e-?aSudu&;boo15v$Akf+9=iY)Xf6 z*aa1^8}`6n*atz_4+r2N91^psN;4_DlL?IbDW$u`;8@k*D>@LL)?D<5pc-o62polD za2#r(4o*NloP;nmz$s{iCWydkI0Mbl05ru!`^D;C_GH}u1n!96rL%YT|br0JrTxZ)HTC+g2G?MBNW0aZ=mo%wjFxc*g($ delta 1009 zcmXZaO-vI(6bEp+v#pD?e6$6WBFG|s)DN)W2Z%+e0s^I=2o*)DqJXe-FkbY6i7|Un z5@SO)hzC8I7!rfY5JRHGlktSXG*P@84|4HfAQu1gmcuXo@0)qkeVbXBo@Wc->1t=H zKO;laGLkd#H=bt3@H^MbY8@;-6Hh)>JK3X|xV7j%97v|skSxwsJA?LW!o{husE3NJ8+BR(-4@oN=yB-#V!;14^J2c0!q$ z9MRWD>6k<;6tKn_FA^WV=mqw7di~3;d92Tjmsq9CdNJ({FY7dpSY6f^6j?H7Q#zEx zE~tRrum|?SJ_y2oH~PC+9yK?F|28EA$UXoa)T2JO%RQRsvibU`7oZpVAPyIy zA1=XV7=SA<2no0f*Wfw~!40?x!!QD)a0|v@TrB#Hm2Yx#@nY2|bjtfJ-u*E;Gi9=} z(nceNSlS57UDlJd(L{ItYuae1O8JJ-LE-j>(MI9@hS4I!R3@kEJ2k|+>3N>pEiQ*$ zu=*Xmk6PY3?5$Rg!ozg$x)k0*;hD18^;6m06Jb0?T~mxFDEwtSLLsd31`798-a{d! Za{H}tPCzs``EM81tK8fk?T(wb{s*XPh3NnQ From f5a079e772f550f9bd94a7d8a362aa94926b968c Mon Sep 17 00:00:00 2001 From: Nick Strayer Date: Thu, 26 Oct 2023 11:13:08 -0400 Subject: [PATCH 3/7] Make sure that `global` is injected to the JS environment for the Tour mode to use. --- inst/website/src/pages/live-demo.astro | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/inst/website/src/pages/live-demo.astro b/inst/website/src/pages/live-demo.astro index 0d567508a..82de197ae 100644 --- a/inst/website/src/pages/live-demo.astro +++ b/inst/website/src/pages/live-demo.astro @@ -11,6 +11,8 @@ import "@/styles/globals.css"; import { internalLink } from "@/lib/utils"; --- + +
@@ -24,3 +26,13 @@ import { internalLink } from "@/lib/utils"; + + \ No newline at end of file From 1d7ab463d5a72183e7140c5fcd84e11d5af893b6 Mon Sep 17 00:00:00 2001 From: Nick Strayer Date: Thu, 26 Oct 2023 11:15:16 -0400 Subject: [PATCH 4/7] Update news --- NEWS.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS.md b/NEWS.md index 56861b14f..96007c251 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# Development version + +### Minor new features and improvements + +- Tour works again in website live-demo mode + # 0.5.1 ### Major changes From 44c8b91c3b09e571e547e1045813f4d8d232d4af Mon Sep 17 00:00:00 2001 From: nstrayer Date: Thu, 26 Oct 2023 15:18:34 +0000 Subject: [PATCH 5/7] Commit build assets --- .../vscode-extension/shinyuieditor-0.5.1.vsix | Bin 7212220 -> 7212220 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/inst/vscode-extension/shinyuieditor-0.5.1.vsix b/inst/vscode-extension/shinyuieditor-0.5.1.vsix index 3fa50baa0d5b2ab2cdddb6c98d8509574ec9397f..68007ca695e7e77b102343a918f5575c32d25ce9 100644 GIT binary patch delta 965 zcmXxiOH30%7zgm~qjiCT^ua@@AY1VP3Q|Rshee7~D5Vtz0mXu-Ah2VICwk$aNxd0U z&4k3n#G6JmhQnxrhQyQcLQEq@vMk2maKCQ44vHVdll+4<*ADLP%|DdokUY^oDwBweP{(`o-p3>jQwEDuT4qn&| zm9Pi)!amp!RZtBF;2_k9h1J?SNlZ@0aK`tmx?RMk4#l3(=kQa(2Z!MZ)WcC|fMakR z8lefAp#@HWA6nrgv_Syc;S`*P4hTXgbU_HZAq+hbfhe4TUN{Tqpbz@tJPg1f48aAs z2*Yp*VlV=ua2dwn3S5P2Fb)%N9VTH4rp2<`So=ah^wCeF*oylsUjH&8S$N>tX`_v@ zCvEuA!SAMx0NwCZ+UTaSzGZ|dXSR$G<=ZVIh2L5eZfOCgxqY?aI*AC#DRl@}$m zi|5JAPj@RKvmoWXoaz5AXWq9dEJ`20udq?d-wJD|Y*AS&<($g;C_kyp+yv%(gx|{6 PZB(tbGxG>H?X2@3BCCSz delta 965 zcmXxiUr19?90%~-KU-IwOSkzaU7B~K_EtrnjW6{n4U$|RPu^D}axBhQ+($ggwCY1?$!D!HUqx*bptf9I-Ktnb0ay!-)KZDB{uzb$OQ*%hdivMk2maKCQ44vGP$bl+4<*ADLP%|DdokUY^oDwBtZZe?i;aNa=56T77X%2QTb~ zO4tK?VIS;=15gDA;Sf}d#kHEdNlZ>gamM#+x?M!44o9ER=kQa(2S?!;)WUJ7gA-5> z4bTXF2*61QLKB>VW(YwGoQ5;d3T@C19nc9~5Qc7uKo6XSUN{Hmp%41u0t~<)48cXX z1jBF{qA&uZa0SNTDqMr>Fb)%N114b#rp1ceSpPyl^wCeF*oylsUjH&8S$N>tX``94 zJ8cBf!SAJw5Z&-p+UTOOzGZ|dV_QZi<=ZWz4f#-GgA`+|mqIYJ*(#YsJ}5EsDlbW9 z7k9`kNOvnDvo^|kIn)1L&b)6{SPy;tfx<>9e=DqoGN7_1$~l$wQGQaHxe3hoh@h2i P*r-}#XXX)R?5zDC?M7!X From 9b0dc34bcce27f2678dc416e502dbc421f6378b5 Mon Sep 17 00:00:00 2001 From: Nick Strayer Date: Thu, 26 Oct 2023 11:37:51 -0400 Subject: [PATCH 6/7] Add playwright tests for tour mode --- inst/editor/playwright/tour-mode.spec.ts | 49 ++++++++++++++++++++++ inst/website/tests/check-live-demo.spec.ts | 13 ++++++ 2 files changed, 62 insertions(+) create mode 100644 inst/editor/playwright/tour-mode.spec.ts diff --git a/inst/editor/playwright/tour-mode.spec.ts b/inst/editor/playwright/tour-mode.spec.ts new file mode 100644 index 000000000..276f6fd1d --- /dev/null +++ b/inst/editor/playwright/tour-mode.spec.ts @@ -0,0 +1,49 @@ +import { test, expect } from "@playwright/test"; + +import { startupMockedApp } from "./utils/mockBackend"; + +test("Live Demo loads and can be navigated", async ({ page }) => { + await startupMockedApp(page, { language: "R" }); + + // Select a template. + await page.locator(".template-container").first().click(); + + // Click button to proceed with template + await page + .getByRole("button", { name: "Start editor with selected template" }) + .click(); + + // Make sure the main view has loaded by looking for the "Elements" section + await expect(page.getByRole("heading", { name: "Elements" })).toBeVisible(); + + // Click "Tour App" button + await page.getByRole("button", { name: "Tour App" }).click(); + + // Make sure that the tour has started + await expect(page.getByRole("alertdialog")).toBeVisible(); + + // Get the text content of the tour alert dialog so we can check that it changes in the next step + const tourText = await page.getByRole("alertdialog").textContent(); + + // Click the "Next" button + await page.getByRole("button", { name: "Next" }).click(); + + // Make sure that the tour has advanced to the next step by checking that the + // text content of the alert dialog has changed + const tourText2 = await page.getByRole("alertdialog").textContent(); + expect(tourText2).not.toBe(tourText); + + // Close the tour with the X button + await page.getByLabel("Close").click(); + + // Make sure that the tour has closed + await expect(page.getByRole("alertdialog")).not.toBeVisible(); + + // Re-opening the tour will start from the left off step + await page.getByRole("button", { name: "Tour App" }).click(); + expect(await page.getByRole("alertdialog").textContent()).toBe(tourText2); + + // Pressing the back button will go back to the first step + await page.getByRole("button", { name: "Back" }).click(); + expect(await page.getByRole("alertdialog").textContent()).toBe(tourText); +}); diff --git a/inst/website/tests/check-live-demo.spec.ts b/inst/website/tests/check-live-demo.spec.ts index 8a4a038b0..cd6f9e22e 100644 --- a/inst/website/tests/check-live-demo.spec.ts +++ b/inst/website/tests/check-live-demo.spec.ts @@ -25,4 +25,17 @@ test("Live Demo loads and can be navigated", async ({ page }) => { // Make sure the main view has loaded by looking for the "Elements" section await expect(page.getByRole("heading", { name: "Elements" })).toBeVisible(); + + // Make sure tour mode works + // Click "Tour App" button + await page.getByRole("button", { name: "Tour App" }).click(); + + // Make sure that the tour has started + await expect(page.getByRole("alertdialog")).toBeVisible(); + + // Close the tour with the X button + await page.getByLabel("Close").click(); + + // Make sure that the tour has closed + await expect(page.getByRole("alertdialog")).not.toBeVisible(); }); From c7a49c90910460f6b4c0096bf5eb3fb67823c149 Mon Sep 17 00:00:00 2001 From: nstrayer Date: Thu, 26 Oct 2023 15:41:15 +0000 Subject: [PATCH 7/7] Commit build assets --- .../vscode-extension/shinyuieditor-0.5.1.vsix | Bin 7212220 -> 7212220 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/inst/vscode-extension/shinyuieditor-0.5.1.vsix b/inst/vscode-extension/shinyuieditor-0.5.1.vsix index 68007ca695e7e77b102343a918f5575c32d25ce9..bbbf94c1ec6b7d7d29032fbf116fda7e0a9e1fb6 100644 GIT binary patch delta 965 zcmXxiOH30%7zc3nRTn4-ZFvY4WGlW<&?=%lEK-zbX+=Rmu^=i4>=@$7q=bVe^=3>p z6A}{>ZyM2<9!3*1B%X*DVj62y&L$r4Vq%0?{D0ec_~pOz?Ke9!n^~NHtt^5))TOAd zj0|1R&}LuR+Z0)wjrS?_lDr&=-B*M1p9o)a9dgG~su!iWSF5sKg>5%zxMHiNA)lFW zxo>;)s7IGT1_e~mzy@1@-e*FV@aWlf12nNZkna(5BiX~>XhbVT*BkAS1G%sj^2B;$ zzBdmYQS^)IfTQ7svK$%Wf9K3n-WkX*5RWz-UmgEDBVEhk9~4%`%M*s1cHEROUeY$#62@DZR$oXO;DMb` z3Ag<1hi&VG^cbS}eKD)i3lzAOAFqHQZ4qm#W;czEO*23_vuSowzS}h0kq>n?NHNBGDFm~cHOU(CL5W#cIWAdU zJXdBux?4e+wNuW^>HhC>`hAPSLiF(m3LB;Tt*}vMk2maKCQ44vHVdll+4<*ADLP%|DdokUY^oDwBweP{(`o-p3>jQwEDuT4qn&| zm9Pi)!amp!RZtBF;2_k9h1J?SNlZ@0aK`tmx?RMk4#l3(=kQa(2Z!MZ)WcC|fMakR z8lefAp#@HWA6nrgv_Syc;S`*P4hTXgbU_HZAq+hbfhe4TUN{Tqpbz@tJPg1f48aAs z2*Yp*VlV=ua2dwn3S5P2Fb)%N9VTH4rp2<`So=ah^wCeF*oylsUjH&8S$N>tX`_v@ zCvEuA!SAMx0NwCZ+UTaSzGZ|dXSR$G<=ZVIh2L5eZfOCgxqY?aI*AC#DRl@}$m zi|5JAPj@RKvmoWXoaz5AXWq9dEJ`20udq?d-wJD|Y*AS&<($g;C_kyp+yv%(gx|{6 PZB(tbGxG>H?X2@3BCCSz