@spteck/react-controls-v2 2.7.3 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +2716 -2724
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -220,7 +220,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
220
220
  font-weight: 600;
221
221
  text-align: center;
222
222
  margin-top: 6px;
223
- `,cy=({data:e,flagClass:t,onClick:r})=>(0,n.jsx)(o.Tooltip,{relationship:`label`,content:(0,n.jsxs)(o.Card,{className:oy,children:[(0,n.jsx)(`img`,{src:e.imageUrl,alt:e.name,className:ay}),(0,n.jsx)(o.Text,{className:sy,children:e.name})]}),withArrow:!0,positioning:`above`,children:(0,n.jsx)(`img`,{src:e.imageUrl,alt:e.name,className:t||ay,role:`button`,tabIndex:0,onClick:()=>r?.(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r?.(e))}})}),ly=e=>{let[n,r]=(0,t.useState)(void 0),{error:i}=V();return(0,t.useEffect)(()=>{let t=!1;return(async()=>{try{let n=await(await fetch(e)).json();t||r(n)}catch(e){i(`Error loading style:`,e instanceof Error?e:void 0)}})(),()=>{t=!0}},[e]),n},uy=e=>({defaultMapStyles:(0,t.useMemo)(()=>({width:`100%`,height:`600px`,fontFamily:o.tokens.fontFamilyBase}),[]),flagClass:(0,t.useMemo)(()=>(0,f.css)({width:`32px`,height:`20px`,border:`1px solid ${o.tokens.colorNeutralBackground1}`,borderRadius:o.tokens.borderRadiusSmall,boxShadow:o.tokens.shadow4,transition:`transform 0.1s ease`}),[])}),dy=`https://api.maptiler.com/maps/topo-v2/style.json?key=fYK99t1qjkKbINH0saMD`,fy=({data:r,onClick:i,mapStyleUrl:a=dy,style:s,fitPadding:c=20})=>{ey();let l=(0,t.useRef)(null),u=ly(a),d=r,{defaultMapStyles:f,flagClass:p}=uy(),m=e.T();return(0,t.useEffect)(()=>{if(!l.current||d.length===0)return;let e=d.map(e=>e.coordinates[0]),t=d.map(e=>e.coordinates[1]);l.current.getMap().fitBounds([[Math.min(...e),Math.min(...t)],[Math.max(...e),Math.max(...t)]],{padding:c})},[d,c]),u?(0,n.jsxs)(ne.default,{ref:l,initialViewState:{longitude:0,latitude:20,zoom:1},style:{...s??f},mapStyle:u,pixelRatio:window.devicePixelRatio,children:[(0,n.jsx)(iy,{mapRef:l,initialViewState:{longitude:0,latitude:20,zoom:1}}),d.map(e=>(0,n.jsx)(ne.Marker,{longitude:e.coordinates[0],latitude:e.coordinates[1],anchor:`center`,children:(0,n.jsx)(cy,{data:e,onClick:i,flagClass:p})},e.id))]}):(0,n.jsx)(o.Text,{children:m.loadingMapStyle})},py=function(e){return e[e.SharePoint=0]=`SharePoint`,e[e.Teams=1]=`Teams`,e[e.TeamsDark=2]=`TeamsDark`,e[e.TeamsHighContrast=3]=`TeamsHighContrast`,e}({}),my=(e,t)=>{let n=(0,re.create)();n.put(`.${t}-ac-container:focus`,{outline:`none !important`}),n.put(`.${t}-ac-adaptiveCard:focus`,{outline:`none !important`}),n.put(`.${t}-ac-pushButton`,{overflow:`hidden`,textOverflow:`ellipsis`,textAlign:`center`,verticalAlign:`middle`,cursor:`pointer`,fontFamily:`inherit`,fontSize:`14px`,fontWeight:`600`,padding:`4px 10px 5px 10px`,WebkitUserSelect:`none`,MozUserSelect:`none`,MsUserSelect:`none`,userSelect:`none`,height:`32px`,borderRadius:`2px`,border:`1px solid ${e.colorNeutralStrokeAccessible}`,backgroundColor:e.colorNeutralBackground1,color:e.colorNeutralForeground1}),n.put(`.${t}-ac-pushButton:hover`,{border:`1px solid ${e.colorNeutralStrokeAccessible}`,backgroundColor:e.colorNeutralBackground2,color:e.colorNeutralForeground2}),n.put(`.${t}-ac-pushButton:active`,{border:`1px solid ${e.colorNeutralStrokeAccessible}`,backgroundColor:e.colorNeutralBackground3,color:e.colorNeutralForeground3}),n.put(`.${t}-ac-pushButton-disabled`,{overflow:`hidden`,textOverflow:`ellipsis`,textAlign:`center`,verticalAlign:`middle`,cursor:`pointer`,fontFamily:`inherit`,fontSize:`14px`,fontWeight:`600`,padding:`4px 10px 5px 10px`,WebkitUserSelect:`none`,MozUserSelect:`none`,MsUserSelect:`none`,userSelect:`none`,height:`32px`,borderRadius:`2px`,border:`1px solid ${e.colorNeutralStrokeDisabled}`,backgroundColor:e.colorNeutralBackgroundDisabled,color:e.colorNeutralForegroundDisabled}),n.put(`.${t}-ac-ctrl-overlay`,{fontFamily:e.fontFamilyBase,position:`absolute`,left:`0`,top:`0`,zIndex:`10000`}),n.put(`.${t}-ac-ctrl`,{boxSizing:`border-box`,fontSize:`14px`,fontWeight:`normal`}),n.put(`.${t}-ac-ctrl-popup-container`,{backgroundColor:e.colorNeutralBackground1,position:`absolute`,overflowY:`auto`,boxShadow:`0px 3.2px 7.2px rgba(0,0,0,0.13), 0px 0.6px 1.8px rgba(0,0,0,0.11)`,borderRadius:`2px`}),n.put(`.${t}-ac-ctrl-popup-container:focus`,{outline:`0`}),n.put(`.${t}-ac-ctrl-slide`,{animationDuration:`0.5s`,animationTimingFunction:`cubic-bezier(0.1, 0.9, 0.2, 1)`}),n.put(`.${t}-ac-ctrl-slide.${t}-ac-ctrl-slideTopToBottom`,{animationName:`fadeIn, slideTopToBottom`}),n.put(`.${t}-ac-ctrl-slide.${t}-ac-ctrl-slideBottomToTop`,{animationName:`fadeIn, slideBottomToTop`}),n.put(`.${t}-ac-ctrl-slide.${t}-ac-ctrl-slideLeftToRight`,{animationName:`fadeIn, slideLeftToRight`}),n.put(`.${t}-ac-ctrl-slide.${t}-ac-ctrl-slideRightToLeft`,{animationName:`fadeIn, slideRightToLeft`}),n.put(`.${t}-ac-ctrl-dropdown-item`,{width:`100%`,textOverflow:`ellipsis`,overflow:`hidden`,whiteSpace:`nowrap`,display:`block`,padding:`0px 12px`,lineHeight:`30px`,cursor:`pointer`,backgroundColor:e.colorNeutralBackground1,color:e.colorNeutralForeground1}),n.put(`.${t}-ac-ctrl-dropdown-item:hover`,{backgroundColor:e.colorNeutralBackground2,color:e.colorNeutralForeground2}),n.put(`.${t}-ac-ctrl-dropdown-item:focus`,{outline:`0`,backgroundColor:e.colorNeutralBackground3,color:e.colorNeutralForeground3}),n.put(`.${t}-ac-ctrl-dropdown-item-disabled`,{width:`100%`,textOverflow:`ellipsis`,overflow:`hidden`,whiteSpace:`nowrap`,display:`block`,padding:`0px 12px`,lineHeight:`30px`,cursor:`pointer`,backgroundColor:e.colorNeutralBackgroundDisabled,color:e.colorNeutralForegroundDisabled})},hy=e=>new z.HostConfig({fontFamily:e.fontFamilyBase,separator:{lineThickness:1,lineColor:e.colorNeutralStroke2},containerStyles:{default:{backgroundColor:e.colorNeutralBackground1,foregroundColors:{default:{default:e.colorNeutralForeground1,subtle:e.colorNeutralForeground2},dark:{default:e.colorNeutralForeground3,subtle:e.colorNeutralForeground4},light:{default:e.colorNeutralForeground1,subtle:e.colorNeutralForeground2},accent:{default:e.colorBrandForeground1,subtle:e.colorBrandForeground2},attention:{default:e.colorPaletteRedBackground3,subtle:e.colorPaletteRedBackground2},good:{default:e.colorPaletteGreenBackground3,subtle:e.colorPaletteGreenBackground2},warning:{default:e.colorPaletteYellowBackground3,subtle:e.colorPaletteYellowBackground2}}},emphasis:{backgroundColor:e.colorNeutralBackground3,foregroundColors:{default:{default:e.colorNeutralForeground1,subtle:e.colorNeutralForeground2},dark:{default:e.colorNeutralForeground3,subtle:e.colorNeutralForeground4},light:{default:e.colorNeutralForeground1,subtle:e.colorNeutralForeground2},accent:{default:e.colorBrandForeground1,subtle:e.colorBrandForeground2},attention:{default:e.colorPaletteRedBackground3,subtle:e.colorPaletteRedBackground2},good:{default:e.colorPaletteGreenBackground3,subtle:e.colorPaletteGreenBackground2},warning:{default:e.colorPaletteYellowBackground3,subtle:e.colorPaletteYellowBackground2}}}},inputs:{label:{requiredInputs:{weight:`bold`},optionalInputs:{weight:`bold`}},errorMessage:{color:`attention`,weight:`bold`}},actions:{buttonSpacing:10,actionAlignment:`right`}}),gy=`fluentUITheme`,_y=(e,t)=>{e.hostCapabilities.setCustomProperty(gy,t)},vy=e=>{let t=e.hostCapabilities.getCustomProperty(gy);return t||=o.webLightTheme,t},yy=(e,t)=>{let n;switch(e){case py.SharePoint:n={theme:t,hostConfig:hy(t)};break;case py.Teams:n={theme:o.teamsLightTheme,hostConfig:hy(o.teamsLightTheme)};break;case py.TeamsDark:n={theme:o.teamsDarkTheme,hostConfig:hy(o.teamsDarkTheme)};break;case py.TeamsHighContrast:n={theme:o.teamsHighContrastTheme,hostConfig:hy(o.teamsHighContrastTheme)};break;default:n={theme:t,hostConfig:hy(t)};break}return n.hostConfig.cssClassNamePrefix=`ach${Math.random().toString().replace(/\./g,``)}`,_y(n.hostConfig,n.theme),my(n.theme,n.hostConfig.cssClassNamePrefix),n},by=e=>{z.AdaptiveCard.onProcessMarkdown||(z.AdaptiveCard.onProcessMarkdown=(t,n)=>{n.outputHtml=new ie.default().render(t),n.didProcess=!0;try{n.outputHtml=new ie.default().render(t),n.didProcess=!0}catch(t){e&&e(`AdaptiveCardHost: Error parsing Markdown`,t instanceof Error?t:void 0),n.didProcess=!1}})},xy=(e,t,n)=>{let r,i;return i=n?{theme:t,aadInfo:n?.pageContext?.aadInfo?{instanceUrl:n.pageContext.aadInfo.instanceUrl||``,tenantId:n.pageContext.aadInfo.tenantId||``,userId:n.pageContext.aadInfo.userId||``}:void 0,cultureInfo:n?.pageContext?.cultureInfo?{currentCultureName:n.pageContext.cultureInfo.currentCultureName,currentUICultureName:n.pageContext.cultureInfo.currentUICultureName,isRightToLeft:n.pageContext.cultureInfo.isRightToLeft||!1}:void 0,userInfo:n?.pageContext?.user?{displayName:n.pageContext.user.displayName,email:n.pageContext.user.email,isAnonymousGuestUser:n.pageContext.user.isAnonymousGuestUser||!1,isExternalGuestUser:n.pageContext.user.isExternalGuestUser||!1,loginName:n.pageContext.user.loginName,preferUserTimeZone:n.pageContext.user.preferUserTimeZone||!1}:void 0,spListInfo:n?.pageContext?.list?{id:n.pageContext.list.id,serverRelativeUrl:n.pageContext.list.serverRelativeUrl||``,title:n.pageContext.list.title}:void 0,spListItemInfo:n?.pageContext?.listItem?{id:n.pageContext.listItem.id.toString()}:void 0,spSiteInfo:n?.pageContext?.site?{absoluteUrl:n.pageContext.site.absoluteUrl,cdnPrefix:n.pageContext.site.cdnPrefix||``,classification:n.pageContext.site.classification||``,correlationId:n.pageContext.site.correlationId||``,id:n.pageContext.site.id,isNoScriptEnabled:n.pageContext.site.isNoScriptEnabled||!1,recycleBinItemCount:n.pageContext.site.recycleBinItemCount||0,serverRelativeUrl:n.pageContext.site.serverRelativeUrl||``,serverRequestPath:n.pageContext.site.serverRequestPath||``,sitePagesEnabled:n.pageContext.site.sitePagesEnabled||!1}:void 0,spWebInfo:n?.pageContext?.web?{absoluteUrl:n.pageContext.web.absoluteUrl,id:n.pageContext.web.id,isAppWeb:n.pageContext.web.isAppWeb||!1,language:n.pageContext.web.language||0,languageName:n.pageContext.web.languageName||``,logoUrl:n.pageContext.web.logoUrl||``,serverRelativeUrl:n.pageContext.web.serverRelativeUrl||``,templateName:n.pageContext.web.templateName||``,title:n.pageContext.web.title,description:n.pageContext.web.description||``}:void 0}:{theme:t},r=e?{$root:{...e?.$root,"@context":i}}:{$root:{"@context":i}},r};function Sy(e){try{let{createRoot:t}=require(`react-dom/client`);return t(e)}catch{return{render:t=>h.render(t,e),unmount:()=>h.unmountComponentAtNode(e)}}}var Cy=e=>{let t;return t=e.iconUrl?(0,n.jsx)(o.Button,{className:e.className,onClick:e.actionClickHandler,appearance:`primary`,children:(0,n.jsxs)(`div`,{style:{display:`flex`,flexDirection:e.iconPlacement===oe.ActionIconPlacement.LeftOfTitle?`row`:`column`,justifyContent:`center`,alignItems:`center`},children:[(0,n.jsx)(`img`,{src:e.iconUrl,style:{width:e.iconSize,height:e.iconSize,flexShrink:0,marginRight:e.iconPlacement===oe.ActionIconPlacement.LeftOfTitle?4:0,marginBottom:e.iconPlacement===oe.ActionIconPlacement.LeftOfTitle?0:4},alt:``}),(0,n.jsx)(`span`,{children:e.text})]})}):e.style.toLocaleLowerCase().trim()===`positive`||e.style.toLocaleLowerCase().trim()===`destructive`?(0,n.jsx)(o.Button,{className:e.className,onClick:e.actionClickHandler,appearance:`primary`,children:e.text}):(0,n.jsx)(o.Button,{className:e.className,onClick:e.actionClickHandler,children:e.text}),t},wy=(e,t,r,i,a,s,c,l)=>{let u=document.createElement(`div`);u.className=`fluentUI`;let d=Sy(u);d.render((0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:l,children:(0,n.jsx)(Cy,{text:e,className:r,iconUrl:t,iconPlacement:i,iconSize:a,actionClickHandler:s,style:c,theme:l})})}));let f=new MutationObserver(e=>{for(let t of e)for(let e of Array.from(t.removedNodes))if(e===u||u.contains(e)){d.unmount(),f.disconnect();return}});if(u.parentNode)f.observe(u.parentNode,{childList:!0});else{let e=new MutationObserver(()=>{u.parentNode&&(f.observe(u.parentNode,{childList:!0}),e.disconnect())});e.observe(document.body,{childList:!0,subtree:!0})}return u},Ty=class extends ae.ExecuteAction{updateCssClasses(){}actionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.execute()};render(e){let t=this.hostConfig.hostCapabilities.getCustomProperty(gy),n=this.parent?.hostConfig?.actions??{iconPlacement:`left`,iconSize:24};this._renderedElement=wy(this.title??``,this.iconUrl||``,e||``,n.iconPlacement,n.iconSize,this.actionClickHandler,this.style,t)}},Ey=class extends ae.OpenUrlAction{updateCssClasses(){}actionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.execute()};render(e){let t=this.hostConfig.hostCapabilities.getCustomProperty(gy),n=this.parent?.hostConfig?.actions??{iconPlacement:`left`,iconSize:24};this._renderedElement=wy(this.title??``,this.iconUrl||``,e||``,n.iconPlacement,n.iconSize,this.actionClickHandler,this.style,t)}},Dy=class extends ae.ShowCardAction{updateCssClasses(){if(this.renderedElement){let e=this.state===1;this.renderedElement.setAttribute(`aria-expanded`,e.toString())}}actionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.execute()};render(e){let t=this.parent?.hostConfig?.actions??{iconPlacement:`left`,iconSize:24};this._renderedElement=wy(this.title||`Default Title`,this.iconUrl||``,this.iconUrl??``,t.iconPlacement,t.iconSize,this.actionClickHandler,this.style)}},Oy=class extends ae.SubmitAction{updateCssClasses(){}actionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.execute()};render(e){let t=this.hostConfig.hostCapabilities.getCustomProperty(gy),n=this.parent?.hostConfig?.actions??{iconPlacement:`left`,iconSize:24};this._renderedElement=wy(this.title??``,this.iconUrl??``,e||``,n.iconPlacement,n.iconSize,this.actionClickHandler,this.style,t)}},ky=class extends ae.ToggleVisibilityAction{updateCssClasses(){if(this.renderedElement){let e=this.state===1;this.renderedElement.setAttribute(`aria-expanded`,e.toString())}}actionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.execute()};render(e){let t=this.hostConfig.hostCapabilities.getCustomProperty(gy),n=this.parent?.hostConfig?.actions??{iconPlacement:`left`,iconSize:24};this._renderedElement=wy(this.title??``,this.iconUrl??``,e||``,n.iconPlacement,n.iconSize,this.actionClickHandler,this.style,t)}};function Ay(e){e.register(`Action.Submit`,Oy),e.register(`Action.OpenUrl`,Ey),e.register(`Action.ShowCard`,Dy),e.register(`Action.ToggleVisibility`,ky),e.register(`Action.Execute`,Ty)}var jy=e=>{let t=document.createElement(`div`);return Sy(t).render(e()),t};function Q(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function $(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var My=class extends z.Input{static valueProperty=new z.StringProperty(z.Versions.v1_5,`value`);static choicesProperty=new z.SerializableObjectCollectionProperty(z.Versions.v1_5,`choices`,z.Choice);static styleProperty=new z.ValueSetProperty(z.Versions.v1_5,`style`,[{value:`compact`},{value:`expanded`},{value:`filtered`,targetVersion:z.Versions.v1_5}],`compact`);static isMultiSelectProperty=new z.BoolProperty(z.Versions.v1_5,`isMultiSelect`,!1);static placeholderProperty=new z.StringProperty(z.Versions.v1_5,`placeholder`);static wrapProperty=new z.BoolProperty(z.Versions.v1_5,`wrap`,!1);defaultValue;style;get isCompact(){return!this.style||this.style===`compact`}set isCompact(e){this.style=e?void 0:`expanded`}isMultiSelect=!1;placeholder;wrap=!1;choices=[];element;refControl;selectedValues=[];defaultSelectedValues=[];updateSelectedValues=(e,t,n)=>{t?n?this.selectedValues.includes(e)||this.selectedValues.push(e):this.removeItemFromArray(this.selectedValues,e):this.selectedValues=[e]};removeItemFromArray=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)};internalRender(){let e=vy(this.hostConfig),r=this.choices?this.choices.map(e=>({key:e.value,text:e.title})):[];this.defaultValue&&(this.defaultSelectedValues=this.defaultValue.split(this.hostConfig.choiceSetInputValueSeparator),this.selectedValues=[...this.defaultSelectedValues]);let i=()=>{let[e,i]=t.useState(this.selectedValues);return t.useEffect(()=>{i(this.selectedValues)},[this.selectedValues.join(this.hostConfig.choiceSetInputValueSeparator)]),(0,n.jsx)(o.Combobox,{style:{width:`100%`},placeholder:this.placeholder,multiselect:this.isMultiSelect,value:this.isMultiSelect?e.map(e=>r.find(t=>t.key===e)?.text).join(this.hostConfig.choiceSetInputValueSeparator):r.find(t=>e[0]===t.key)?.text,selectedOptions:this.isMultiSelect?e:[e[0]],autoComplete:this.style===`filtered`?`on`:`off`,onOptionSelect:(e,t)=>{if(this.isMultiSelect)i(t.selectedOptions),this.selectedValues=t.selectedOptions;else{let e=t.optionValue??``;i([e]),this.selectedValues=[e]}this.valueChanged()},ref:e=>{this.refControl=e},children:r.map(e=>(0,n.jsx)(o.Option,{value:e.key,children:e.text??``},e.key))})};return this.element=jy(()=>(0,n.jsxs)(n.Fragment,{children:[!this.isMultiSelect&&this.style===`expanded`&&(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(o.RadioGroup,{defaultValue:this.defaultValue,onChange:(e,t)=>{this.updateSelectedValues(t.value,this.isMultiSelect,!0),this.valueChanged()},ref:e=>{this.refControl=e},children:this.choices.map((e,t)=>(0,n.jsx)(o.Radio,{value:e.value,label:e.title,style:{marginTop:t>0?this.hostConfig.spacing.default:0}},e.value))})})}),this.isMultiSelect&&this.style===`expanded`&&(0,n.jsx)(`div`,{style:{display:`flex`,gap:this.hostConfig.spacing.default},children:this.choices.map((t,r)=>{let i=this.defaultSelectedValues.indexOf(t.value??``)>-1;return(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(o.Checkbox,{label:t.title,defaultChecked:i,onChange:(e,n)=>{this.updateSelectedValues(t.value??``,this.isMultiSelect,!!n),this.valueChanged()},ref:e=>{r===0&&(this.refControl=e)}})})},t.value)})}),(this.style===`compact`||this.style===`filtered`)&&(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(i,{})})})]})),this.element.style.width=`100%`,this.element}getJsonTypeName(){return`Input.ChoiceSet`}focus(){this.refControl&&this.refControl.focus&&this.refControl.focus()}internalValidateProperties(e){super.internalValidateProperties(e),this.choices.length===0&&e.addFailure(this,z.ValidationEvent.CollectionCantBeEmpty,z.Strings.errors.choiceSetMustHaveAtLeastOneChoice());for(let t of this.choices)(!t.title||!t.value)&&e.addFailure(this,z.ValidationEvent.PropertyCantBeNull,z.Strings.errors.choiceSetChoicesMustHaveTitleAndValue())}isSet(){return!!this.value}isValid(){return this.value?!0:!this.isRequired}get value(){if(this.selectedValues)return this.selectedValues.join(this.hostConfig.choiceSetInputValueSeparator)}};$([(0,z.property)(My.valueProperty),Q(`design:type`,String)],My.prototype,`defaultValue`,void 0),$([(0,z.property)(My.styleProperty),Q(`design:type`,String)],My.prototype,`style`,void 0),$([(0,z.property)(My.isMultiSelectProperty),Q(`design:type`,Boolean)],My.prototype,`isMultiSelect`,void 0),$([(0,z.property)(My.placeholderProperty),Q(`design:type`,String)],My.prototype,`placeholder`,void 0),$([(0,z.property)(My.wrapProperty),Q(`design:type`,Boolean)],My.prototype,`wrap`,void 0),$([(0,z.property)(My.choicesProperty),Q(`design:type`,Array)],My.prototype,`choices`,void 0);var Ny=class extends z.Input{static valueProperty=new z.StringProperty(z.Versions.v1_5,`value`);static placeholderProperty=new z.StringProperty(z.Versions.v1_5,`placeholder`);static minProperty=new z.StringProperty(z.Versions.v1_0,`min`);static maxProperty=new z.StringProperty(z.Versions.v1_0,`max`);defaultValue;min;max;placeholder;_value;refControl;element;internalRender(){let e=vy(this.hostConfig);return this.element=jy(()=>(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(se.DatePicker,{id:this.id,placeholder:this.placeholder,minDate:this.convertStringToDate(this.min),maxDate:this.convertStringToDate(this.max),onSelectDate:e=>{this._value=e??void 0,this.valueChanged()},ref:e=>{this.refControl=e},style:{width:`100%`}})})})),this.element.style.width=`100%`,this.element}convertStringToDate(e){if(e)try{let t=new Date(e);return isNaN(t.getTime())?void 0:t}catch{return}}getJsonTypeName(){return`Input.Date`}focus(){this.refControl?.focus()}updateInputControlAriaLabelledBy(){if(this.element){let e=this.getAllLabelIds().join(` `);e?this.element.setAttribute(`aria-labelledby`,e):this.element.removeAttribute(`aria-labelledby`)}}isSet(){return!!this.value}isValid(){if(!this.value)return!this.isRequired;let e=new Date(this.value),t=!0;if(this.min){let n=new Date(this.min);t&&=e>=n}if(this.max){let n=new Date(this.max);t&&=e<=n}return t}get value(){if(this._value){let e=this._value.getTimezoneOffset();return new Date(this._value.getTime()-e*60*1e3).toISOString().split(`T`)[0]}}};$([(0,z.property)(Ny.valueProperty),Q(`design:type`,String)],Ny.prototype,`defaultValue`,void 0),$([(0,z.property)(Ny.minProperty),Q(`design:type`,String)],Ny.prototype,`min`,void 0),$([(0,z.property)(Ny.maxProperty),Q(`design:type`,String)],Ny.prototype,`max`,void 0),$([(0,z.property)(Ny.placeholderProperty),Q(`design:type`,String)],Ny.prototype,`placeholder`,void 0);var Py=class extends z.Input{static valueProperty=new z.NumProperty(z.Versions.v1_5,`value`);static placeholderProperty=new z.StringProperty(z.Versions.v1_5,`placeholder`);static minProperty=new z.NumProperty(z.Versions.v1_0,`min`);static maxProperty=new z.NumProperty(z.Versions.v1_0,`max`);defaultValue;min;max;placeholder;refControl=null;element;internalRender(){let e=vy(this.hostConfig);return this.element=jy(()=>(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(o.SpinButton,{style:{width:`calc(100% - 10px)`},id:this.id,defaultValue:this.defaultValue===void 0?void 0:this.defaultValue,placeholder:this.placeholder,min:this.min,max:this.max,onChange:()=>{this.valueChanged()},ref:e=>{this.refControl=e}})})})),this.element.style.width=`100%`,this.element}getJsonTypeName(){return`Input.Number`}focus(){this.refControl?.focus()}updateInputControlAriaLabelledBy(){if(this.element){let e=this.getAllLabelIds().join(` `);e?this.element.setAttribute(`aria-labelledby`,e):this.element.removeAttribute(`aria-labelledby`)}}isSet(){let e=this.value;return e!==void 0&&!isNaN(e)}isValid(){let e=this.value;if(e===void 0)return!this.isRequired;let t=!0;return this.min!==void 0&&(t&&=e>=this.min),this.max!==void 0&&(t&&=e<=this.max),t}get value(){return this.refControl?Number(this.refControl.value):void 0}};$([(0,z.property)(Py.valueProperty),Q(`design:type`,Number)],Py.prototype,`defaultValue`,void 0),$([(0,z.property)(Py.minProperty),Q(`design:type`,Number)],Py.prototype,`min`,void 0),$([(0,z.property)(Py.maxProperty),Q(`design:type`,Number)],Py.prototype,`max`,void 0),$([(0,z.property)(Py.placeholderProperty),Q(`design:type`,String)],Py.prototype,`placeholder`,void 0);var Fy=e=>{let{ariaLabel:t,iconProps:r,styles:i,className:a,onClick:s,...c}=e;return(0,n.jsx)(o.Button,{appearance:`transparent`,"aria-label":t,className:a,onClick:s,style:i,...c,children:(0,n.jsx)(`img`,{src:r.src,alt:t,style:{height:r.height||`100%`,width:r.width||`auto`}})})},Iy={marginLeft:8},Ly,Ry,zy=class extends z.Input{static valueProperty=new z.StringProperty(z.Versions.v1_0,`value`);static maxLengthProperty=new z.NumProperty(z.Versions.v1_0,`maxLength`);static isMultilineProperty=new z.BoolProperty(z.Versions.v1_0,`isMultiline`,!1);static placeholderProperty=new z.StringProperty(z.Versions.v1_0,`placeholder`);static styleProperty=new z.EnumProperty(z.Versions.v1_0,`style`,z.InputTextStyle,z.InputTextStyle.Text);static inlineActionProperty=new z.ActionProperty(z.Versions.v1_0,`inlineAction`,[`Action.ShowCard`]);static regexProperty=new z.StringProperty(z.Versions.v1_3,`regex`,!0);defaultValue;maxLength;isMultiline=!1;placeholder;style=z.InputTextStyle.Text;inlineAction;regex;refControl=null;element;_value=this.defaultValue||``;internalRender(){let e=vy(this.hostConfig);return this.element=jy(()=>(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:this.isMultiline?(0,n.jsx)(o.Textarea,{resize:`vertical`,style:{width:`100%`},id:this.id,defaultValue:this.defaultValue,placeholder:this.placeholder,maxLength:this.maxLength,onChange:(e,t)=>{this._value=t.value,this.valueChanged()},onKeyDown:this.handleKeyDown,ref:e=>{this.refControl=e}}):(0,n.jsx)(o.Input,{id:this.id,style:{width:`100%`},type:z.InputTextStyle[this.style].toLowerCase(),defaultValue:this.defaultValue,placeholder:this.placeholder,maxLength:this.maxLength,onChange:(e,t)=>{this._value=t.value,this.valueChanged()},onKeyDown:this.handleKeyDown,ref:e=>{this.refControl=e?e.inputElement:null}})})})),this.element.style.width=`100%`,this.element}handleKeyDown=e=>{e.key===`Enter`&&this.inlineAction&&this.inlineAction?.execute()};overrideInternalRender(){let e=super.overrideInternalRender();return this.inlineAction&&this.inputControlContainerElement.appendChild(this.buildInlineActionButton()),e||document.createElement(`div`)}buildInlineActionButton=()=>jy(this.inlineAction?.iconUrl?this.inlineIconActionButton:this.buildTextOnlyInlineActionActionButton);inlineActionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.inlineAction?.execute()};inlineIconActionButton=()=>(0,n.jsx)(o.FluentProvider,{theme:this.hostConfig.hostCapabilities.getCustomProperty(gy),children:(0,n.jsx)(Fy,{ariaLabel:this.inlineAction?.title||`Inline action`,className:this.hostConfig.makeCssClassName(`ac-inlineActionButton`,`iconOnly`),iconProps:{src:this.inlineAction?.iconUrl??``},onClick:this.inlineActionClickHandler,styles:Iy})});buildTextOnlyInlineActionActionButton=()=>{let e=this.hostConfig.hostCapabilities.getCustomProperty(gy);return(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(o.Button,{appearance:`primary`,className:this.hostConfig.makeCssClassName(`ac-inlineActionButton`,`textOnly`),onClick:this.inlineActionClickHandler,style:Iy,children:this.inlineAction?.title??``})})})};getJsonTypeName(){return`Input.Text`}focus(){this.refControl?.focus()}updateInputControlAriaLabelledBy(){if(this.element){let e=this.getAllLabelIds().join(` `);e?this.element.setAttribute(`aria-labelledby`,e):this.element.removeAttribute(`aria-labelledby`)}}getActionById(e){let t=super.getActionById(e);if(!t&&this.inlineAction&&(t=this.inlineAction.getActionById(e)),!t)throw Error(`Action with id '${e}' not found.`);return t}isSet(){return!!this.value}isValid(){return this.value?this.regex?new RegExp(this.regex,`g`).test(this.value):!0:!this.isRequired}get value(){if(this._value)return this._value}};$([(0,z.property)(zy.valueProperty),Q(`design:type`,String)],zy.prototype,`defaultValue`,void 0),$([(0,z.property)(zy.maxLengthProperty),Q(`design:type`,Number)],zy.prototype,`maxLength`,void 0),$([(0,z.property)(zy.isMultilineProperty),Q(`design:type`,Boolean)],zy.prototype,`isMultiline`,void 0),$([(0,z.property)(zy.placeholderProperty),Q(`design:type`,String)],zy.prototype,`placeholder`,void 0),$([(0,z.property)(zy.styleProperty),Q(`design:type`,typeof(Ly=z.InputTextStyle!==void 0&&z.InputTextStyle)==`function`?Ly:Object)],zy.prototype,`style`,void 0),$([(0,z.property)(zy.inlineActionProperty),Q(`design:type`,typeof(Ry=z.Action!==void 0&&z.Action)==`function`?Ry:Object)],zy.prototype,`inlineAction`,void 0),$([(0,z.property)(zy.regexProperty),Q(`design:type`,String)],zy.prototype,`regex`,void 0);var By=e=>{let{id:r,defaultTime:i,minTime:a,maxTime:s,placeholder:c,theme:l,onTimeChange:u}=e,[d,f]=t.useState(i),[m,h]=t.useState(i?(0,B.formatDateToTimeString)(i??new Date):``);return(0,n.jsx)(o.IdPrefixProvider,{value:r,children:(0,n.jsx)(o.FluentProvider,{theme:l,children:(0,n.jsx)(B.TimePicker,{style:{width:`100%`},expandIcon:(0,n.jsx)(p.ClockRegular,{}),id:r,freeform:!0,min:a?(0,B.formatDateToTimeString)(a):void 0,max:s?(0,B.formatDateToTimeString)(s):void 0,placeholder:c,value:d?(0,B.formatDateToTimeString)(d):m,onTimeChange:(e,t)=>{let n=t.selectedTime??void 0,r=t.selectedTimeText??``;f(n),h(r),u&&n&&u(n,r)},onInput:e=>{h(e.target.value)}})})})},Vy=class e extends z.Input{static convertTimeStringToDate(e){return new Date(`1973-09-04T`+e+`:00Z`)}static valueProperty=new z.TimeProperty(z.Versions.v1_0,`value`);static placeholderProperty=new z.StringProperty(z.Versions.v1_0,`placeholder`);static minProperty=new z.TimeProperty(z.Versions.v1_0,`min`);static maxProperty=new z.TimeProperty(z.Versions.v1_0,`max`);defaultValue;min;max;placeholder;_time;element;internalRender(){let t=vy(this.hostConfig),r=this.defaultValue?e.convertTimeStringToDate(this.defaultValue):void 0,i=this.min?e.convertTimeStringToDate(this.min):void 0,a=this.max?e.convertTimeStringToDate(this.max):void 0;return this.element=jy(()=>(0,n.jsx)(By,{id:(0,z.generateUniqueId)(),defaultTime:r,minTime:i,maxTime:a,placeholder:this.placeholder,theme:t,onTimeChange:e=>{this._time=e,this.valueChanged()}})),this.element.style.width=`100%`,this.element}getJsonTypeName(){return`Input.Time`}focus(){}updateInputControlAriaLabelledBy(){if(this.element){let e=this.getAllLabelIds().join(` `);e?this.element.setAttribute(`aria-labelledby`,e):this.element.removeAttribute(`aria-labelledby`)}}isSet(){return!!this.value}isValid(){if(!this.value)return!this.isRequired;if(!this._time)return!1;let t=!0;if(this.min){let n=e.convertTimeStringToDate(this.min);t&&=this._time>=n}if(this.max){let n=e.convertTimeStringToDate(this.max);t&&=this._time<=n}return t}get value(){return this._time?(0,B.formatDateToTimeString)(this._time):void 0}};$([(0,z.property)(Vy.valueProperty),Q(`design:type`,String)],Vy.prototype,`defaultValue`,void 0),$([(0,z.property)(Vy.minProperty),Q(`design:type`,String)],Vy.prototype,`min`,void 0),$([(0,z.property)(Vy.maxProperty),Q(`design:type`,String)],Vy.prototype,`max`,void 0),$([(0,z.property)(Vy.placeholderProperty),Q(`design:type`,String)],Vy.prototype,`placeholder`,void 0);var Hy=class extends z.Input{static valueProperty=new z.StringProperty(z.Versions.v1_5,`value`);static titleProperty=new z.StringProperty(z.Versions.v1_5,`title`);static valueOnProperty=new z.StringProperty(z.Versions.v1_5,`valueOn`,!0,void 0,`true`,e=>`true`);static valueOffProperty=new z.StringProperty(z.Versions.v1_5,`valueOff`,!0,void 0,`false`,e=>`false`);static wrapProperty=new z.BoolProperty(z.Versions.v1_2,`wrap`,!1);defaultValue;title;valueOn=`true`;valueOff=`false`;wrap=!1;_value;refControl=null;element;internalRender(){let e=vy(this.hostConfig);return this.element=jy(()=>(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,style:{backgroundColor:`transparent`},children:(0,n.jsx)(o.Switch,{id:this.id,label:this.title,onChange:(e,t)=>{this._value=t.checked,this.valueChanged()},defaultChecked:this.defaultValue===this.valueOn,style:{marginBottom:0,marginTop:0},ref:e=>{this.refControl=e}})})})),this.element.style.width=`100%`,this.element}get isNullable(){return!1}getJsonTypeName(){return`Input.Toggle`}focus(){this.refControl?.focus()}updateInputControlAriaLabelledBy(){if(this.element){let e=this.getAllLabelIds().join(` `);e?this.element.setAttribute(`aria-labelledby`,e):this.element.removeAttribute(`aria-labelledby`)}}isSet(){return this.isRequired?this.value===this.valueOn:!!this.value}get value(){return this._value!==null&&this._value!==void 0?this._value?this.valueOn:this.valueOff:this.isRequired?void 0:this.valueOff}};$([(0,z.property)(Hy.valueProperty),Q(`design:type`,String)],Hy.prototype,`defaultValue`,void 0),$([(0,z.property)(Hy.titleProperty),Q(`design:type`,String)],Hy.prototype,`title`,void 0),$([(0,z.property)(Hy.valueOnProperty),Q(`design:type`,String)],Hy.prototype,`valueOn`,void 0),$([(0,z.property)(Hy.valueOffProperty),Q(`design:type`,String)],Hy.prototype,`valueOff`,void 0),$([(0,z.property)(Hy.wrapProperty),Q(`design:type`,Boolean)],Hy.prototype,`wrap`,void 0);function Uy(e){e.register(`Input.Text`,zy),e.register(`Input.Number`,Py),e.register(`Input.Time`,Vy),e.register(`Input.Date`,Ny),e.register(`Input.Toggle`,Hy),e.register(`Input.ChoiceSet`,My)}var Wy=e=>{switch(e){case py.SharePoint:return o.webLightTheme;case py.Teams:return o.teamsLightTheme;case py.TeamsDark:return o.teamsDarkTheme;case py.TeamsHighContrast:return o.teamsHighContrastTheme;default:return o.webLightTheme}},Gy=e=>{let r=(0,t.useRef)(null),{log:i,error:a,LogLevel:s}=V(),c=(0,t.useRef)(null),l=(0,t.useRef)(null),u=(0,t.useRef)(null);(0,t.useEffect)(()=>{by((e,t)=>a(e,t))},[]),(0,t.useEffect)(()=>{c.current=null,c.current=new z.AdaptiveCard,l.current=new z.SerializationContext},[e]);let d=(0,t.useCallback)(t=>{if(e.onInvokeAction){let n={type:``,title:``},r=t.getJsonTypeName();switch(r){case z.OpenUrlAction.JsonTypeName:{let e=t;n={type:r,title:e.title,url:e.url}}break;case z.SubmitAction.JsonTypeName:{let e=t;n={type:r,title:e.title,data:e.data}}break;case z.ExecuteAction.JsonTypeName:{let e=t;n={type:r,title:e.title,data:e.data,verb:e.verb}}break;default:n={type:r,title:`Unknown Action`};break}e.onInvokeAction(n)}},[e.onInvokeAction]);return(0,t.useEffect)(()=>{let t,n=e.themeType;u.current=null,n||=py.SharePoint,t=e.theme?e.theme:Wy(n);let r=yy(n,t),a=r.hostConfig;i(`hostconfig:`,s.Info,a),u.current=t,c.current&&(c.current.hostConfig=r.hostConfig),e.onUpdateHostCapabilities&&e.onUpdateHostCapabilities(a.hostCapabilities)},[e]),(0,t.useEffect)(()=>{c.current&&(c.current.onExecuteAction=d)},[e,d]),(0,t.useEffect)(()=>{let t=new z.CardObjectRegistry,n=new z.CardObjectRegistry;z.GlobalRegistry.populateWithDefaultElements(t),z.GlobalRegistry.populateWithDefaultActions(n),Uy(t),Ay(n),e.onSetCustomElements&&e.onSetCustomElements(t),e.onSetCustomActions&&e.onSetCustomActions(n);let r=l.current;r&&r.setElementRegistry(t),r&&r.setActionRegistry(n)},[e]),(0,t.useEffect)(()=>{for(;r?.current?.firstChild;)r.current.lastChild&&r.current.removeChild(r.current.lastChild);let t=r.current;if(!t)return;let n=c.current;try{let r=new ce.Template(e.card),i=xy(e.data??{$root:{}},Wy(e.themeType??py.SharePoint),e.context),a=r.expand(i);if(n&&n.parse(a,l.current??void 0),n){let e=n.render();e&&e.outerHTML!==t.innerHTML&&e.outerHTML!==t.innerHTML&&(t.innerHTML=``,t.appendChild(e))}}catch(t){e.onError&&e.onError(t)}},[e,Wy]),(0,n.jsx)(o.IdPrefixProvider,{value:`adaptiveCardHost`,children:(0,n.jsx)(o.FluentProvider,{theme:u.current?u.current:Wy(e.themeType??py.SharePoint),children:(0,n.jsx)(`div`,{ref:r,className:`${e.className?e.className:``}`,style:e.style})})})},Ky=({card:e,data:r})=>{let i=(0,t.useRef)(null);return(0,t.useEffect)(()=>{if(!i.current)return;i.current.innerHTML=``;let t=new ce.Template(e).expand({$root:r}),n=new z.AdaptiveCard;n?.parse(t);let a=n.render();a&&i.current.appendChild(a)},[e,r]),(0,n.jsx)(`div`,{ref:i,role:`region`,"aria-label":`Adaptive Card`})},qy=y.css`
223
+ `,cy=({data:e,flagClass:t,onClick:r})=>(0,n.jsx)(o.Tooltip,{relationship:`label`,content:(0,n.jsxs)(o.Card,{className:oy,children:[(0,n.jsx)(`img`,{src:e.imageUrl,alt:e.name,className:ay}),(0,n.jsx)(o.Text,{className:sy,children:e.name})]}),withArrow:!0,positioning:`above`,children:(0,n.jsx)(`img`,{src:e.imageUrl,alt:e.name,className:t||ay,role:`button`,tabIndex:0,onClick:()=>r?.(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r?.(e))}})}),ly=e=>{let[n,r]=(0,t.useState)(void 0),{error:i}=V();return(0,t.useEffect)(()=>{let t=!1;return(async()=>{try{let n=await(await fetch(e)).json();t||r(n)}catch(e){i(`Error loading style:`,e instanceof Error?e:void 0)}})(),()=>{t=!0}},[e]),n},uy=e=>({defaultMapStyles:(0,t.useMemo)(()=>({width:`100%`,height:`600px`,fontFamily:o.tokens.fontFamilyBase}),[]),flagClass:(0,t.useMemo)(()=>(0,f.css)({width:`32px`,height:`20px`,border:`1px solid ${o.tokens.colorNeutralBackground1}`,borderRadius:o.tokens.borderRadiusSmall,boxShadow:o.tokens.shadow4,transition:`transform 0.1s ease`}),[])}),dy=`https://api.maptiler.com/maps/topo-v2/style.json?key=fYK99t1qjkKbINH0saMD`,fy=({data:r,onClick:i,mapStyleUrl:a=dy,style:s,fitPadding:c=20})=>{ey();let l=(0,t.useRef)(null),u=ly(a),d=r,{defaultMapStyles:f,flagClass:p}=uy(),m=e.T();return(0,t.useEffect)(()=>{if(!l.current||d.length===0)return;let e=d.map(e=>e.coordinates[0]),t=d.map(e=>e.coordinates[1]);l.current.getMap().fitBounds([[Math.min(...e),Math.min(...t)],[Math.max(...e),Math.max(...t)]],{padding:c})},[d,c]),u?(0,n.jsxs)(ne.default,{ref:l,initialViewState:{longitude:0,latitude:20,zoom:1},style:{...s??f},mapStyle:u,pixelRatio:window.devicePixelRatio,children:[(0,n.jsx)(iy,{mapRef:l,initialViewState:{longitude:0,latitude:20,zoom:1}}),d.map(e=>(0,n.jsx)(ne.Marker,{longitude:e.coordinates[0],latitude:e.coordinates[1],anchor:`center`,children:(0,n.jsx)(cy,{data:e,onClick:i,flagClass:p})},e.id))]}):(0,n.jsx)(o.Text,{children:m.loadingMapStyle})},py=function(e){return e[e.SharePoint=0]=`SharePoint`,e[e.Teams=1]=`Teams`,e[e.TeamsDark=2]=`TeamsDark`,e[e.TeamsHighContrast=3]=`TeamsHighContrast`,e}({}),my=(e,t)=>{let n=(0,re.create)();n.put(`.${t}-ac-container:focus`,{outline:`none !important`}),n.put(`.${t}-ac-adaptiveCard:focus`,{outline:`none !important`}),n.put(`.${t}-ac-pushButton`,{overflow:`hidden`,textOverflow:`ellipsis`,textAlign:`center`,verticalAlign:`middle`,cursor:`pointer`,fontFamily:`inherit`,fontSize:`14px`,fontWeight:`600`,padding:`4px 10px 5px 10px`,WebkitUserSelect:`none`,MozUserSelect:`none`,MsUserSelect:`none`,userSelect:`none`,height:`32px`,borderRadius:`2px`,border:`1px solid ${e.colorNeutralStrokeAccessible}`,backgroundColor:e.colorNeutralBackground1,color:e.colorNeutralForeground1}),n.put(`.${t}-ac-pushButton:hover`,{border:`1px solid ${e.colorNeutralStrokeAccessible}`,backgroundColor:e.colorNeutralBackground2,color:e.colorNeutralForeground2}),n.put(`.${t}-ac-pushButton:active`,{border:`1px solid ${e.colorNeutralStrokeAccessible}`,backgroundColor:e.colorNeutralBackground3,color:e.colorNeutralForeground3}),n.put(`.${t}-ac-pushButton-disabled`,{overflow:`hidden`,textOverflow:`ellipsis`,textAlign:`center`,verticalAlign:`middle`,cursor:`pointer`,fontFamily:`inherit`,fontSize:`14px`,fontWeight:`600`,padding:`4px 10px 5px 10px`,WebkitUserSelect:`none`,MozUserSelect:`none`,MsUserSelect:`none`,userSelect:`none`,height:`32px`,borderRadius:`2px`,border:`1px solid ${e.colorNeutralStrokeDisabled}`,backgroundColor:e.colorNeutralBackgroundDisabled,color:e.colorNeutralForegroundDisabled}),n.put(`.${t}-ac-ctrl-overlay`,{fontFamily:e.fontFamilyBase,position:`absolute`,left:`0`,top:`0`,zIndex:`10000`}),n.put(`.${t}-ac-ctrl`,{boxSizing:`border-box`,fontSize:`14px`,fontWeight:`normal`}),n.put(`.${t}-ac-ctrl-popup-container`,{backgroundColor:e.colorNeutralBackground1,position:`absolute`,overflowY:`auto`,boxShadow:`0px 3.2px 7.2px rgba(0,0,0,0.13), 0px 0.6px 1.8px rgba(0,0,0,0.11)`,borderRadius:`2px`}),n.put(`.${t}-ac-ctrl-popup-container:focus`,{outline:`0`}),n.put(`.${t}-ac-ctrl-slide`,{animationDuration:`0.5s`,animationTimingFunction:`cubic-bezier(0.1, 0.9, 0.2, 1)`}),n.put(`.${t}-ac-ctrl-slide.${t}-ac-ctrl-slideTopToBottom`,{animationName:`fadeIn, slideTopToBottom`}),n.put(`.${t}-ac-ctrl-slide.${t}-ac-ctrl-slideBottomToTop`,{animationName:`fadeIn, slideBottomToTop`}),n.put(`.${t}-ac-ctrl-slide.${t}-ac-ctrl-slideLeftToRight`,{animationName:`fadeIn, slideLeftToRight`}),n.put(`.${t}-ac-ctrl-slide.${t}-ac-ctrl-slideRightToLeft`,{animationName:`fadeIn, slideRightToLeft`}),n.put(`.${t}-ac-ctrl-dropdown-item`,{width:`100%`,textOverflow:`ellipsis`,overflow:`hidden`,whiteSpace:`nowrap`,display:`block`,padding:`0px 12px`,lineHeight:`30px`,cursor:`pointer`,backgroundColor:e.colorNeutralBackground1,color:e.colorNeutralForeground1}),n.put(`.${t}-ac-ctrl-dropdown-item:hover`,{backgroundColor:e.colorNeutralBackground2,color:e.colorNeutralForeground2}),n.put(`.${t}-ac-ctrl-dropdown-item:focus`,{outline:`0`,backgroundColor:e.colorNeutralBackground3,color:e.colorNeutralForeground3}),n.put(`.${t}-ac-ctrl-dropdown-item-disabled`,{width:`100%`,textOverflow:`ellipsis`,overflow:`hidden`,whiteSpace:`nowrap`,display:`block`,padding:`0px 12px`,lineHeight:`30px`,cursor:`pointer`,backgroundColor:e.colorNeutralBackgroundDisabled,color:e.colorNeutralForegroundDisabled})},hy=e=>new z.HostConfig({fontFamily:e.fontFamilyBase,separator:{lineThickness:1,lineColor:e.colorNeutralStroke2},containerStyles:{default:{backgroundColor:e.colorNeutralBackground1,foregroundColors:{default:{default:e.colorNeutralForeground1,subtle:e.colorNeutralForeground2},dark:{default:e.colorNeutralForeground3,subtle:e.colorNeutralForeground4},light:{default:e.colorNeutralForeground1,subtle:e.colorNeutralForeground2},accent:{default:e.colorBrandForeground1,subtle:e.colorBrandForeground2},attention:{default:e.colorPaletteRedBackground3,subtle:e.colorPaletteRedBackground2},good:{default:e.colorPaletteGreenBackground3,subtle:e.colorPaletteGreenBackground2},warning:{default:e.colorPaletteYellowBackground3,subtle:e.colorPaletteYellowBackground2}}},emphasis:{backgroundColor:e.colorNeutralBackground3,foregroundColors:{default:{default:e.colorNeutralForeground1,subtle:e.colorNeutralForeground2},dark:{default:e.colorNeutralForeground3,subtle:e.colorNeutralForeground4},light:{default:e.colorNeutralForeground1,subtle:e.colorNeutralForeground2},accent:{default:e.colorBrandForeground1,subtle:e.colorBrandForeground2},attention:{default:e.colorPaletteRedBackground3,subtle:e.colorPaletteRedBackground2},good:{default:e.colorPaletteGreenBackground3,subtle:e.colorPaletteGreenBackground2},warning:{default:e.colorPaletteYellowBackground3,subtle:e.colorPaletteYellowBackground2}}}},inputs:{label:{requiredInputs:{weight:`bold`},optionalInputs:{weight:`bold`}},errorMessage:{color:`attention`,weight:`bold`}},actions:{buttonSpacing:10,actionAlignment:`right`}}),gy=`fluentUITheme`,_y=(e,t)=>{e.hostCapabilities.setCustomProperty(gy,t)},vy=e=>{let t=e.hostCapabilities.getCustomProperty(gy);return t||=o.webLightTheme,t},yy=(e,t)=>{let n;switch(e){case py.SharePoint:n={theme:t,hostConfig:hy(t)};break;case py.Teams:n={theme:o.teamsLightTheme,hostConfig:hy(o.teamsLightTheme)};break;case py.TeamsDark:n={theme:o.teamsDarkTheme,hostConfig:hy(o.teamsDarkTheme)};break;case py.TeamsHighContrast:n={theme:o.teamsHighContrastTheme,hostConfig:hy(o.teamsHighContrastTheme)};break;default:n={theme:t,hostConfig:hy(t)};break}return n.hostConfig.cssClassNamePrefix=`ach${Math.random().toString().replace(/\./g,``)}`,_y(n.hostConfig,n.theme),my(n.theme,n.hostConfig.cssClassNamePrefix),n},by=e=>{z.AdaptiveCard.onProcessMarkdown||(z.AdaptiveCard.onProcessMarkdown=(t,n)=>{n.outputHtml=new ie.default().render(t),n.didProcess=!0;try{n.outputHtml=new ie.default().render(t),n.didProcess=!0}catch(t){e&&e(`AdaptiveCardHost: Error parsing Markdown`,t instanceof Error?t:void 0),n.didProcess=!1}})},xy=(e,t,n)=>{let r,i;return i=n?{theme:t,aadInfo:n?.pageContext?.aadInfo?{instanceUrl:n.pageContext.aadInfo.instanceUrl||``,tenantId:n.pageContext.aadInfo.tenantId||``,userId:n.pageContext.aadInfo.userId||``}:void 0,cultureInfo:n?.pageContext?.cultureInfo?{currentCultureName:n.pageContext.cultureInfo.currentCultureName,currentUICultureName:n.pageContext.cultureInfo.currentUICultureName,isRightToLeft:n.pageContext.cultureInfo.isRightToLeft||!1}:void 0,userInfo:n?.pageContext?.user?{displayName:n.pageContext.user.displayName,email:n.pageContext.user.email,isAnonymousGuestUser:n.pageContext.user.isAnonymousGuestUser||!1,isExternalGuestUser:n.pageContext.user.isExternalGuestUser||!1,loginName:n.pageContext.user.loginName,preferUserTimeZone:n.pageContext.user.preferUserTimeZone||!1}:void 0,spListInfo:n?.pageContext?.list?{id:n.pageContext.list.id,serverRelativeUrl:n.pageContext.list.serverRelativeUrl||``,title:n.pageContext.list.title}:void 0,spListItemInfo:n?.pageContext?.listItem?{id:n.pageContext.listItem.id.toString()}:void 0,spSiteInfo:n?.pageContext?.site?{absoluteUrl:n.pageContext.site.absoluteUrl,cdnPrefix:n.pageContext.site.cdnPrefix||``,classification:n.pageContext.site.classification||``,correlationId:n.pageContext.site.correlationId||``,id:n.pageContext.site.id,isNoScriptEnabled:n.pageContext.site.isNoScriptEnabled||!1,recycleBinItemCount:n.pageContext.site.recycleBinItemCount||0,serverRelativeUrl:n.pageContext.site.serverRelativeUrl||``,serverRequestPath:n.pageContext.site.serverRequestPath||``,sitePagesEnabled:n.pageContext.site.sitePagesEnabled||!1}:void 0,spWebInfo:n?.pageContext?.web?{absoluteUrl:n.pageContext.web.absoluteUrl,id:n.pageContext.web.id,isAppWeb:n.pageContext.web.isAppWeb||!1,language:n.pageContext.web.language||0,languageName:n.pageContext.web.languageName||``,logoUrl:n.pageContext.web.logoUrl||``,serverRelativeUrl:n.pageContext.web.serverRelativeUrl||``,templateName:n.pageContext.web.templateName||``,title:n.pageContext.web.title,description:n.pageContext.web.description||``}:void 0}:{theme:t},r=e?{$root:{...e?.$root,"@context":i}}:{$root:{"@context":i}},r};function Sy(e){return`createRoot`in h?h.createRoot(e):{render:t=>h.render(t,e),unmount:()=>h.unmountComponentAtNode(e)}}var Cy=e=>{let t;return t=e.iconUrl?(0,n.jsx)(o.Button,{className:e.className,onClick:e.actionClickHandler,appearance:`primary`,children:(0,n.jsxs)(`div`,{style:{display:`flex`,flexDirection:e.iconPlacement===oe.ActionIconPlacement.LeftOfTitle?`row`:`column`,justifyContent:`center`,alignItems:`center`},children:[(0,n.jsx)(`img`,{src:e.iconUrl,style:{width:e.iconSize,height:e.iconSize,flexShrink:0,marginRight:e.iconPlacement===oe.ActionIconPlacement.LeftOfTitle?4:0,marginBottom:e.iconPlacement===oe.ActionIconPlacement.LeftOfTitle?0:4},alt:``}),(0,n.jsx)(`span`,{children:e.text})]})}):e.style.toLocaleLowerCase().trim()===`positive`||e.style.toLocaleLowerCase().trim()===`destructive`?(0,n.jsx)(o.Button,{className:e.className,onClick:e.actionClickHandler,appearance:`primary`,children:e.text}):(0,n.jsx)(o.Button,{className:e.className,onClick:e.actionClickHandler,children:e.text}),t},wy=(e,t,r,i,a,s,c,l)=>{let u=document.createElement(`div`);u.className=`fluentUI`;let d=Sy(u);d.render((0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:l,children:(0,n.jsx)(Cy,{text:e,className:r,iconUrl:t,iconPlacement:i,iconSize:a,actionClickHandler:s,style:c,theme:l})})}));let f=new MutationObserver(e=>{for(let t of e)for(let e of Array.from(t.removedNodes))if(e===u||u.contains(e)){d.unmount(),f.disconnect();return}});if(u.parentNode)f.observe(u.parentNode,{childList:!0});else{let e=new MutationObserver(()=>{u.parentNode&&(f.observe(u.parentNode,{childList:!0}),e.disconnect())});e.observe(document.body,{childList:!0,subtree:!0})}return u},Ty=class extends ae.ExecuteAction{updateCssClasses(){}actionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.execute()};render(e){let t=this.hostConfig.hostCapabilities.getCustomProperty(gy),n=this.parent?.hostConfig?.actions??{iconPlacement:`left`,iconSize:24};this._renderedElement=wy(this.title??``,this.iconUrl||``,e||``,n.iconPlacement,n.iconSize,this.actionClickHandler,this.style,t)}},Ey=class extends ae.OpenUrlAction{updateCssClasses(){}actionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.execute()};render(e){let t=this.hostConfig.hostCapabilities.getCustomProperty(gy),n=this.parent?.hostConfig?.actions??{iconPlacement:`left`,iconSize:24};this._renderedElement=wy(this.title??``,this.iconUrl||``,e||``,n.iconPlacement,n.iconSize,this.actionClickHandler,this.style,t)}},Dy=class extends ae.ShowCardAction{updateCssClasses(){if(this.renderedElement){let e=this.state===1;this.renderedElement.setAttribute(`aria-expanded`,e.toString())}}actionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.execute()};render(e){let t=this.parent?.hostConfig?.actions??{iconPlacement:`left`,iconSize:24};this._renderedElement=wy(this.title||`Default Title`,this.iconUrl||``,this.iconUrl??``,t.iconPlacement,t.iconSize,this.actionClickHandler,this.style)}},Oy=class extends ae.SubmitAction{updateCssClasses(){}actionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.execute()};render(e){let t=this.hostConfig.hostCapabilities.getCustomProperty(gy),n=this.parent?.hostConfig?.actions??{iconPlacement:`left`,iconSize:24};this._renderedElement=wy(this.title??``,this.iconUrl??``,e||``,n.iconPlacement,n.iconSize,this.actionClickHandler,this.style,t)}},ky=class extends ae.ToggleVisibilityAction{updateCssClasses(){if(this.renderedElement){let e=this.state===1;this.renderedElement.setAttribute(`aria-expanded`,e.toString())}}actionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.execute()};render(e){let t=this.hostConfig.hostCapabilities.getCustomProperty(gy),n=this.parent?.hostConfig?.actions??{iconPlacement:`left`,iconSize:24};this._renderedElement=wy(this.title??``,this.iconUrl??``,e||``,n.iconPlacement,n.iconSize,this.actionClickHandler,this.style,t)}};function Ay(e){e.register(`Action.Submit`,Oy),e.register(`Action.OpenUrl`,Ey),e.register(`Action.ShowCard`,Dy),e.register(`Action.ToggleVisibility`,ky),e.register(`Action.Execute`,Ty)}var jy=e=>{let t=document.createElement(`div`);return Sy(t).render(e()),t};function Q(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function $(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var My=class extends z.Input{static valueProperty=new z.StringProperty(z.Versions.v1_5,`value`);static choicesProperty=new z.SerializableObjectCollectionProperty(z.Versions.v1_5,`choices`,z.Choice);static styleProperty=new z.ValueSetProperty(z.Versions.v1_5,`style`,[{value:`compact`},{value:`expanded`},{value:`filtered`,targetVersion:z.Versions.v1_5}],`compact`);static isMultiSelectProperty=new z.BoolProperty(z.Versions.v1_5,`isMultiSelect`,!1);static placeholderProperty=new z.StringProperty(z.Versions.v1_5,`placeholder`);static wrapProperty=new z.BoolProperty(z.Versions.v1_5,`wrap`,!1);defaultValue;style;get isCompact(){return!this.style||this.style===`compact`}set isCompact(e){this.style=e?void 0:`expanded`}isMultiSelect=!1;placeholder;wrap=!1;choices=[];element;refControl;selectedValues=[];defaultSelectedValues=[];updateSelectedValues=(e,t,n)=>{t?n?this.selectedValues.includes(e)||this.selectedValues.push(e):this.removeItemFromArray(this.selectedValues,e):this.selectedValues=[e]};removeItemFromArray=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)};internalRender(){let e=vy(this.hostConfig),r=this.choices?this.choices.map(e=>({key:e.value,text:e.title})):[];this.defaultValue&&(this.defaultSelectedValues=this.defaultValue.split(this.hostConfig.choiceSetInputValueSeparator),this.selectedValues=[...this.defaultSelectedValues]);let i=()=>{let[e,i]=t.useState(this.selectedValues);return t.useEffect(()=>{i(this.selectedValues)},[this.selectedValues.join(this.hostConfig.choiceSetInputValueSeparator)]),(0,n.jsx)(o.Combobox,{style:{width:`100%`},placeholder:this.placeholder,multiselect:this.isMultiSelect,value:this.isMultiSelect?e.map(e=>r.find(t=>t.key===e)?.text).join(this.hostConfig.choiceSetInputValueSeparator):r.find(t=>e[0]===t.key)?.text,selectedOptions:this.isMultiSelect?e:[e[0]],autoComplete:this.style===`filtered`?`on`:`off`,onOptionSelect:(e,t)=>{if(this.isMultiSelect)i(t.selectedOptions),this.selectedValues=t.selectedOptions;else{let e=t.optionValue??``;i([e]),this.selectedValues=[e]}this.valueChanged()},ref:e=>{this.refControl=e},children:r.map(e=>(0,n.jsx)(o.Option,{value:e.key,children:e.text??``},e.key))})};return this.element=jy(()=>(0,n.jsxs)(n.Fragment,{children:[!this.isMultiSelect&&this.style===`expanded`&&(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(o.RadioGroup,{defaultValue:this.defaultValue,onChange:(e,t)=>{this.updateSelectedValues(t.value,this.isMultiSelect,!0),this.valueChanged()},ref:e=>{this.refControl=e},children:this.choices.map((e,t)=>(0,n.jsx)(o.Radio,{value:e.value,label:e.title,style:{marginTop:t>0?this.hostConfig.spacing.default:0}},e.value))})})}),this.isMultiSelect&&this.style===`expanded`&&(0,n.jsx)(`div`,{style:{display:`flex`,gap:this.hostConfig.spacing.default},children:this.choices.map((t,r)=>{let i=this.defaultSelectedValues.indexOf(t.value??``)>-1;return(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(o.Checkbox,{label:t.title,defaultChecked:i,onChange:(e,n)=>{this.updateSelectedValues(t.value??``,this.isMultiSelect,!!n),this.valueChanged()},ref:e=>{r===0&&(this.refControl=e)}})})},t.value)})}),(this.style===`compact`||this.style===`filtered`)&&(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(i,{})})})]})),this.element.style.width=`100%`,this.element}getJsonTypeName(){return`Input.ChoiceSet`}focus(){this.refControl&&this.refControl.focus&&this.refControl.focus()}internalValidateProperties(e){super.internalValidateProperties(e),this.choices.length===0&&e.addFailure(this,z.ValidationEvent.CollectionCantBeEmpty,z.Strings.errors.choiceSetMustHaveAtLeastOneChoice());for(let t of this.choices)(!t.title||!t.value)&&e.addFailure(this,z.ValidationEvent.PropertyCantBeNull,z.Strings.errors.choiceSetChoicesMustHaveTitleAndValue())}isSet(){return!!this.value}isValid(){return this.value?!0:!this.isRequired}get value(){if(this.selectedValues)return this.selectedValues.join(this.hostConfig.choiceSetInputValueSeparator)}};$([(0,z.property)(My.valueProperty),Q(`design:type`,String)],My.prototype,`defaultValue`,void 0),$([(0,z.property)(My.styleProperty),Q(`design:type`,String)],My.prototype,`style`,void 0),$([(0,z.property)(My.isMultiSelectProperty),Q(`design:type`,Boolean)],My.prototype,`isMultiSelect`,void 0),$([(0,z.property)(My.placeholderProperty),Q(`design:type`,String)],My.prototype,`placeholder`,void 0),$([(0,z.property)(My.wrapProperty),Q(`design:type`,Boolean)],My.prototype,`wrap`,void 0),$([(0,z.property)(My.choicesProperty),Q(`design:type`,Array)],My.prototype,`choices`,void 0);var Ny=class extends z.Input{static valueProperty=new z.StringProperty(z.Versions.v1_5,`value`);static placeholderProperty=new z.StringProperty(z.Versions.v1_5,`placeholder`);static minProperty=new z.StringProperty(z.Versions.v1_0,`min`);static maxProperty=new z.StringProperty(z.Versions.v1_0,`max`);defaultValue;min;max;placeholder;_value;refControl;element;internalRender(){let e=vy(this.hostConfig);return this.element=jy(()=>(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(se.DatePicker,{id:this.id,placeholder:this.placeholder,minDate:this.convertStringToDate(this.min),maxDate:this.convertStringToDate(this.max),onSelectDate:e=>{this._value=e??void 0,this.valueChanged()},ref:e=>{this.refControl=e},style:{width:`100%`}})})})),this.element.style.width=`100%`,this.element}convertStringToDate(e){if(e)try{let t=new Date(e);return isNaN(t.getTime())?void 0:t}catch{return}}getJsonTypeName(){return`Input.Date`}focus(){this.refControl?.focus()}updateInputControlAriaLabelledBy(){if(this.element){let e=this.getAllLabelIds().join(` `);e?this.element.setAttribute(`aria-labelledby`,e):this.element.removeAttribute(`aria-labelledby`)}}isSet(){return!!this.value}isValid(){if(!this.value)return!this.isRequired;let e=new Date(this.value),t=!0;if(this.min){let n=new Date(this.min);t&&=e>=n}if(this.max){let n=new Date(this.max);t&&=e<=n}return t}get value(){if(this._value){let e=this._value.getTimezoneOffset();return new Date(this._value.getTime()-e*60*1e3).toISOString().split(`T`)[0]}}};$([(0,z.property)(Ny.valueProperty),Q(`design:type`,String)],Ny.prototype,`defaultValue`,void 0),$([(0,z.property)(Ny.minProperty),Q(`design:type`,String)],Ny.prototype,`min`,void 0),$([(0,z.property)(Ny.maxProperty),Q(`design:type`,String)],Ny.prototype,`max`,void 0),$([(0,z.property)(Ny.placeholderProperty),Q(`design:type`,String)],Ny.prototype,`placeholder`,void 0);var Py=class extends z.Input{static valueProperty=new z.NumProperty(z.Versions.v1_5,`value`);static placeholderProperty=new z.StringProperty(z.Versions.v1_5,`placeholder`);static minProperty=new z.NumProperty(z.Versions.v1_0,`min`);static maxProperty=new z.NumProperty(z.Versions.v1_0,`max`);defaultValue;min;max;placeholder;refControl=null;element;internalRender(){let e=vy(this.hostConfig);return this.element=jy(()=>(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(o.SpinButton,{style:{width:`calc(100% - 10px)`},id:this.id,defaultValue:this.defaultValue===void 0?void 0:this.defaultValue,placeholder:this.placeholder,min:this.min,max:this.max,onChange:()=>{this.valueChanged()},ref:e=>{this.refControl=e}})})})),this.element.style.width=`100%`,this.element}getJsonTypeName(){return`Input.Number`}focus(){this.refControl?.focus()}updateInputControlAriaLabelledBy(){if(this.element){let e=this.getAllLabelIds().join(` `);e?this.element.setAttribute(`aria-labelledby`,e):this.element.removeAttribute(`aria-labelledby`)}}isSet(){let e=this.value;return e!==void 0&&!isNaN(e)}isValid(){let e=this.value;if(e===void 0)return!this.isRequired;let t=!0;return this.min!==void 0&&(t&&=e>=this.min),this.max!==void 0&&(t&&=e<=this.max),t}get value(){return this.refControl?Number(this.refControl.value):void 0}};$([(0,z.property)(Py.valueProperty),Q(`design:type`,Number)],Py.prototype,`defaultValue`,void 0),$([(0,z.property)(Py.minProperty),Q(`design:type`,Number)],Py.prototype,`min`,void 0),$([(0,z.property)(Py.maxProperty),Q(`design:type`,Number)],Py.prototype,`max`,void 0),$([(0,z.property)(Py.placeholderProperty),Q(`design:type`,String)],Py.prototype,`placeholder`,void 0);var Fy=e=>{let{ariaLabel:t,iconProps:r,styles:i,className:a,onClick:s,...c}=e;return(0,n.jsx)(o.Button,{appearance:`transparent`,"aria-label":t,className:a,onClick:s,style:i,...c,children:(0,n.jsx)(`img`,{src:r.src,alt:t,style:{height:r.height||`100%`,width:r.width||`auto`}})})},Iy={marginLeft:8},Ly,Ry,zy=class extends z.Input{static valueProperty=new z.StringProperty(z.Versions.v1_0,`value`);static maxLengthProperty=new z.NumProperty(z.Versions.v1_0,`maxLength`);static isMultilineProperty=new z.BoolProperty(z.Versions.v1_0,`isMultiline`,!1);static placeholderProperty=new z.StringProperty(z.Versions.v1_0,`placeholder`);static styleProperty=new z.EnumProperty(z.Versions.v1_0,`style`,z.InputTextStyle,z.InputTextStyle.Text);static inlineActionProperty=new z.ActionProperty(z.Versions.v1_0,`inlineAction`,[`Action.ShowCard`]);static regexProperty=new z.StringProperty(z.Versions.v1_3,`regex`,!0);defaultValue;maxLength;isMultiline=!1;placeholder;style=z.InputTextStyle.Text;inlineAction;regex;refControl=null;element;_value=this.defaultValue||``;internalRender(){let e=vy(this.hostConfig);return this.element=jy(()=>(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:this.isMultiline?(0,n.jsx)(o.Textarea,{resize:`vertical`,style:{width:`100%`},id:this.id,defaultValue:this.defaultValue,placeholder:this.placeholder,maxLength:this.maxLength,onChange:(e,t)=>{this._value=t.value,this.valueChanged()},onKeyDown:this.handleKeyDown,ref:e=>{this.refControl=e}}):(0,n.jsx)(o.Input,{id:this.id,style:{width:`100%`},type:z.InputTextStyle[this.style].toLowerCase(),defaultValue:this.defaultValue,placeholder:this.placeholder,maxLength:this.maxLength,onChange:(e,t)=>{this._value=t.value,this.valueChanged()},onKeyDown:this.handleKeyDown,ref:e=>{this.refControl=e?e.inputElement:null}})})})),this.element.style.width=`100%`,this.element}handleKeyDown=e=>{e.key===`Enter`&&this.inlineAction&&this.inlineAction?.execute()};overrideInternalRender(){let e=super.overrideInternalRender();return this.inlineAction&&this.inputControlContainerElement.appendChild(this.buildInlineActionButton()),e||document.createElement(`div`)}buildInlineActionButton=()=>jy(this.inlineAction?.iconUrl?this.inlineIconActionButton:this.buildTextOnlyInlineActionActionButton);inlineActionClickHandler=e=>{e.stopPropagation(),e.preventDefault(),this.inlineAction?.execute()};inlineIconActionButton=()=>(0,n.jsx)(o.FluentProvider,{theme:this.hostConfig.hostCapabilities.getCustomProperty(gy),children:(0,n.jsx)(Fy,{ariaLabel:this.inlineAction?.title||`Inline action`,className:this.hostConfig.makeCssClassName(`ac-inlineActionButton`,`iconOnly`),iconProps:{src:this.inlineAction?.iconUrl??``},onClick:this.inlineActionClickHandler,styles:Iy})});buildTextOnlyInlineActionActionButton=()=>{let e=this.hostConfig.hostCapabilities.getCustomProperty(gy);return(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,children:(0,n.jsx)(o.Button,{appearance:`primary`,className:this.hostConfig.makeCssClassName(`ac-inlineActionButton`,`textOnly`),onClick:this.inlineActionClickHandler,style:Iy,children:this.inlineAction?.title??``})})})};getJsonTypeName(){return`Input.Text`}focus(){this.refControl?.focus()}updateInputControlAriaLabelledBy(){if(this.element){let e=this.getAllLabelIds().join(` `);e?this.element.setAttribute(`aria-labelledby`,e):this.element.removeAttribute(`aria-labelledby`)}}getActionById(e){let t=super.getActionById(e);if(!t&&this.inlineAction&&(t=this.inlineAction.getActionById(e)),!t)throw Error(`Action with id '${e}' not found.`);return t}isSet(){return!!this.value}isValid(){return this.value?this.regex?new RegExp(this.regex,`g`).test(this.value):!0:!this.isRequired}get value(){if(this._value)return this._value}};$([(0,z.property)(zy.valueProperty),Q(`design:type`,String)],zy.prototype,`defaultValue`,void 0),$([(0,z.property)(zy.maxLengthProperty),Q(`design:type`,Number)],zy.prototype,`maxLength`,void 0),$([(0,z.property)(zy.isMultilineProperty),Q(`design:type`,Boolean)],zy.prototype,`isMultiline`,void 0),$([(0,z.property)(zy.placeholderProperty),Q(`design:type`,String)],zy.prototype,`placeholder`,void 0),$([(0,z.property)(zy.styleProperty),Q(`design:type`,typeof(Ly=z.InputTextStyle!==void 0&&z.InputTextStyle)==`function`?Ly:Object)],zy.prototype,`style`,void 0),$([(0,z.property)(zy.inlineActionProperty),Q(`design:type`,typeof(Ry=z.Action!==void 0&&z.Action)==`function`?Ry:Object)],zy.prototype,`inlineAction`,void 0),$([(0,z.property)(zy.regexProperty),Q(`design:type`,String)],zy.prototype,`regex`,void 0);var By=e=>{let{id:r,defaultTime:i,minTime:a,maxTime:s,placeholder:c,theme:l,onTimeChange:u}=e,[d,f]=t.useState(i),[m,h]=t.useState(i?(0,B.formatDateToTimeString)(i??new Date):``);return(0,n.jsx)(o.IdPrefixProvider,{value:r,children:(0,n.jsx)(o.FluentProvider,{theme:l,children:(0,n.jsx)(B.TimePicker,{style:{width:`100%`},expandIcon:(0,n.jsx)(p.ClockRegular,{}),id:r,freeform:!0,min:a?(0,B.formatDateToTimeString)(a):void 0,max:s?(0,B.formatDateToTimeString)(s):void 0,placeholder:c,value:d?(0,B.formatDateToTimeString)(d):m,onTimeChange:(e,t)=>{let n=t.selectedTime??void 0,r=t.selectedTimeText??``;f(n),h(r),u&&n&&u(n,r)},onInput:e=>{h(e.target.value)}})})})},Vy=class e extends z.Input{static convertTimeStringToDate(e){return new Date(`1973-09-04T`+e+`:00Z`)}static valueProperty=new z.TimeProperty(z.Versions.v1_0,`value`);static placeholderProperty=new z.StringProperty(z.Versions.v1_0,`placeholder`);static minProperty=new z.TimeProperty(z.Versions.v1_0,`min`);static maxProperty=new z.TimeProperty(z.Versions.v1_0,`max`);defaultValue;min;max;placeholder;_time;element;internalRender(){let t=vy(this.hostConfig),r=this.defaultValue?e.convertTimeStringToDate(this.defaultValue):void 0,i=this.min?e.convertTimeStringToDate(this.min):void 0,a=this.max?e.convertTimeStringToDate(this.max):void 0;return this.element=jy(()=>(0,n.jsx)(By,{id:(0,z.generateUniqueId)(),defaultTime:r,minTime:i,maxTime:a,placeholder:this.placeholder,theme:t,onTimeChange:e=>{this._time=e,this.valueChanged()}})),this.element.style.width=`100%`,this.element}getJsonTypeName(){return`Input.Time`}focus(){}updateInputControlAriaLabelledBy(){if(this.element){let e=this.getAllLabelIds().join(` `);e?this.element.setAttribute(`aria-labelledby`,e):this.element.removeAttribute(`aria-labelledby`)}}isSet(){return!!this.value}isValid(){if(!this.value)return!this.isRequired;if(!this._time)return!1;let t=!0;if(this.min){let n=e.convertTimeStringToDate(this.min);t&&=this._time>=n}if(this.max){let n=e.convertTimeStringToDate(this.max);t&&=this._time<=n}return t}get value(){return this._time?(0,B.formatDateToTimeString)(this._time):void 0}};$([(0,z.property)(Vy.valueProperty),Q(`design:type`,String)],Vy.prototype,`defaultValue`,void 0),$([(0,z.property)(Vy.minProperty),Q(`design:type`,String)],Vy.prototype,`min`,void 0),$([(0,z.property)(Vy.maxProperty),Q(`design:type`,String)],Vy.prototype,`max`,void 0),$([(0,z.property)(Vy.placeholderProperty),Q(`design:type`,String)],Vy.prototype,`placeholder`,void 0);var Hy=class extends z.Input{static valueProperty=new z.StringProperty(z.Versions.v1_5,`value`);static titleProperty=new z.StringProperty(z.Versions.v1_5,`title`);static valueOnProperty=new z.StringProperty(z.Versions.v1_5,`valueOn`,!0,void 0,`true`,e=>`true`);static valueOffProperty=new z.StringProperty(z.Versions.v1_5,`valueOff`,!0,void 0,`false`,e=>`false`);static wrapProperty=new z.BoolProperty(z.Versions.v1_2,`wrap`,!1);defaultValue;title;valueOn=`true`;valueOff=`false`;wrap=!1;_value;refControl=null;element;internalRender(){let e=vy(this.hostConfig);return this.element=jy(()=>(0,n.jsx)(o.IdPrefixProvider,{value:(0,z.generateUniqueId)(),children:(0,n.jsx)(o.FluentProvider,{theme:e,style:{backgroundColor:`transparent`},children:(0,n.jsx)(o.Switch,{id:this.id,label:this.title,onChange:(e,t)=>{this._value=t.checked,this.valueChanged()},defaultChecked:this.defaultValue===this.valueOn,style:{marginBottom:0,marginTop:0},ref:e=>{this.refControl=e}})})})),this.element.style.width=`100%`,this.element}get isNullable(){return!1}getJsonTypeName(){return`Input.Toggle`}focus(){this.refControl?.focus()}updateInputControlAriaLabelledBy(){if(this.element){let e=this.getAllLabelIds().join(` `);e?this.element.setAttribute(`aria-labelledby`,e):this.element.removeAttribute(`aria-labelledby`)}}isSet(){return this.isRequired?this.value===this.valueOn:!!this.value}get value(){return this._value!==null&&this._value!==void 0?this._value?this.valueOn:this.valueOff:this.isRequired?void 0:this.valueOff}};$([(0,z.property)(Hy.valueProperty),Q(`design:type`,String)],Hy.prototype,`defaultValue`,void 0),$([(0,z.property)(Hy.titleProperty),Q(`design:type`,String)],Hy.prototype,`title`,void 0),$([(0,z.property)(Hy.valueOnProperty),Q(`design:type`,String)],Hy.prototype,`valueOn`,void 0),$([(0,z.property)(Hy.valueOffProperty),Q(`design:type`,String)],Hy.prototype,`valueOff`,void 0),$([(0,z.property)(Hy.wrapProperty),Q(`design:type`,Boolean)],Hy.prototype,`wrap`,void 0);function Uy(e){e.register(`Input.Text`,zy),e.register(`Input.Number`,Py),e.register(`Input.Time`,Vy),e.register(`Input.Date`,Ny),e.register(`Input.Toggle`,Hy),e.register(`Input.ChoiceSet`,My)}var Wy=e=>{switch(e){case py.SharePoint:return o.webLightTheme;case py.Teams:return o.teamsLightTheme;case py.TeamsDark:return o.teamsDarkTheme;case py.TeamsHighContrast:return o.teamsHighContrastTheme;default:return o.webLightTheme}},Gy=e=>{let r=(0,t.useRef)(null),{log:i,error:a,LogLevel:s}=V(),c=(0,t.useRef)(null),l=(0,t.useRef)(null),u=(0,t.useRef)(null);(0,t.useEffect)(()=>{by((e,t)=>a(e,t))},[]),(0,t.useEffect)(()=>{c.current=null,c.current=new z.AdaptiveCard,l.current=new z.SerializationContext},[e]);let d=(0,t.useCallback)(t=>{if(e.onInvokeAction){let n={type:``,title:``},r=t.getJsonTypeName();switch(r){case z.OpenUrlAction.JsonTypeName:{let e=t;n={type:r,title:e.title,url:e.url}}break;case z.SubmitAction.JsonTypeName:{let e=t;n={type:r,title:e.title,data:e.data}}break;case z.ExecuteAction.JsonTypeName:{let e=t;n={type:r,title:e.title,data:e.data,verb:e.verb}}break;default:n={type:r,title:`Unknown Action`};break}e.onInvokeAction(n)}},[e.onInvokeAction]);return(0,t.useEffect)(()=>{let t,n=e.themeType;u.current=null,n||=py.SharePoint,t=e.theme?e.theme:Wy(n);let r=yy(n,t),a=r.hostConfig;i(`hostconfig:`,s.Info,a),u.current=t,c.current&&(c.current.hostConfig=r.hostConfig),e.onUpdateHostCapabilities&&e.onUpdateHostCapabilities(a.hostCapabilities)},[e]),(0,t.useEffect)(()=>{c.current&&(c.current.onExecuteAction=d)},[e,d]),(0,t.useEffect)(()=>{let t=new z.CardObjectRegistry,n=new z.CardObjectRegistry;z.GlobalRegistry.populateWithDefaultElements(t),z.GlobalRegistry.populateWithDefaultActions(n),Uy(t),Ay(n),e.onSetCustomElements&&e.onSetCustomElements(t),e.onSetCustomActions&&e.onSetCustomActions(n);let r=l.current;r&&r.setElementRegistry(t),r&&r.setActionRegistry(n)},[e]),(0,t.useEffect)(()=>{for(;r?.current?.firstChild;)r.current.lastChild&&r.current.removeChild(r.current.lastChild);let t=r.current;if(!t)return;let n=c.current;try{let r=new ce.Template(e.card),i=xy(e.data??{$root:{}},Wy(e.themeType??py.SharePoint),e.context),a=r.expand(i);if(n&&n.parse(a,l.current??void 0),n){let e=n.render();e&&e.outerHTML!==t.innerHTML&&e.outerHTML!==t.innerHTML&&(t.innerHTML=``,t.appendChild(e))}}catch(t){e.onError&&e.onError(t)}},[e,Wy]),(0,n.jsx)(o.IdPrefixProvider,{value:`adaptiveCardHost`,children:(0,n.jsx)(o.FluentProvider,{theme:u.current?u.current:Wy(e.themeType??py.SharePoint),children:(0,n.jsx)(`div`,{ref:r,className:`${e.className?e.className:``}`,style:e.style})})})},Ky=({card:e,data:r})=>{let i=(0,t.useRef)(null);return(0,t.useEffect)(()=>{if(!i.current)return;i.current.innerHTML=``;let t=new ce.Template(e).expand({$root:r}),n=new z.AdaptiveCard;n?.parse(t);let a=n.render();a&&i.current.appendChild(a)},[e,r]),(0,n.jsx)(`div`,{ref:i,role:`region`,"aria-label":`Adaptive Card`})},qy=y.css`
224
224
  position: relative;
225
225
  display: inline-block;
226
226
  line-height: 0;