@microsoft/sp-dialog
Version:
SharePoint Framework support for displaying dialog boxes
2 lines • 35.1 kB
JavaScript
define("c0c518b8-701b-4f6f-956d-5782772bb731_1.22.2",["@microsoft/sp-application-base","@microsoft/sp-core-library","@microsoft/sp-diagnostics","react","react-dom","tslib","@ms/office-ui-fabric-react-bundle","@microsoft/load-themed-styles","@msinternal/sp-fluentui-v9-react-dialog-bundle","@msinternal/sp-fluentui-v9-react-button-bundle","@msinternal/sp-fluentui-migration-button-bundle","@msinternal/sp-fluentui-v9-utilities-bundle","@msinternal/sp-fluentui-v9-react-spinner-bundle","@msinternal/sp-fluentui-migration-spinner-bundle","@msinternal/office-ui-fabric-react-layer-notification-bundle","@msinternal/sp-fluentui-migration-modal-bundle","@msinternal/sp-fluentui-migration-textfield-bundle"],(e,t,n,a,i,r,o,s,c,d,l,u,f,p,m,_,h)=>(()=>{var b={305:(e,t,n)=>{var a=n(141);e.exports=a.workaround_ResponsiveModeIndex}
,424:e=>{"use strict";e.exports=s},841:t=>{"use strict";t.exports=e},676:e=>{"use strict";e.exports=t},207:e=>{"use strict";e.exports=n},141:e=>{"use strict";e.exports=o},145:e=>{"use strict";e.exports=m},575:e=>{"use strict";e.exports=l},568:e=>{"use strict";e.exports=_},464:e=>{"use strict";e.exports=p},944:e=>{"use strict";e.exports=h},526:e=>{"use strict";e.exports=d},806:e=>{"use strict";e.exports=c},395:e=>{"use strict";e.exports=f},606:e=>{"use strict";e.exports=u},959:e=>{"use strict";e.exports=a},398:e=>{"use strict";e.exports=i},280:e=>{"use strict";e.exports=r}},g={};function v(e){var t=g[e];if(void 0!==t)return t.exports;var n=g[e]={exports:{}};return b[e](n,n.exports,v),n.exports}v.d=(e,t)=>{for(var n in t)v.o(t,n)&&!v.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},v.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),v.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var y={};return(()=>{"use strict";v.r(y),v.d(y,{BaseDialog:()=>x,Dialog:()=>ie,_DialogState:()=>g});var e,t=v(841),n=v(676),a=v(207),i=v(959),r=v(398),o=v(280),s=v(141);!function(e){e[e.normal=0]="normal",e[e.largeHeader=1]="largeHeader",e[e.close=2]="close"}(e||(e={}));var c=(0,s.classNamesFunction)(),d=function(e){function t(t){var n=e.call(this,t)||this;return(0,s.initializeComponentRef)(n),n}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.styles,a=e.theme;return this._classNames=c(n,{theme:a,className:t}),i.createElement("div",{className:this._classNames.actions},i.createElement("div",{className:this._classNames.actionsRight},this._renderChildrenAsActions()))},t.prototype._renderChildrenAsActions=function(){var e=this;return i.Children.map(this.props.children,function(t){return t?i.createElement("span",{className:e._classNames.action},t):null})},t}(i.Component),l={actions:"ms-Dialog-actions",action:"ms-Dialog-action",actionsRight:"ms-Dialog-actionsRight"},u=(0,s.styled)(d,function(e){var t=e.className,n=e.theme,a=(0,s.getGlobalClassNames)(l,n);return{actions:[a.actions,{position:"relative",width:"100%",minHeight:"24px",lineHeight:"24px",margin:"16px 0 0",fontSize:"0",selectors:{".ms-Button":{lineHeight:"normal",verticalAlign:"middle"}}},t],action:[a.action,{margin:"0 4px"}],actionsRight:[a.actionsRight,{alignItems:"center",display:"flex",fontSize:"0",justifyContent:"flex-end",marginRight:"-4px"}]}},void 0,{scope:"DialogFooter"});u.displayName="DialogFooter";var f=v(305),p=(0,s.classNamesFunction)(),m=i.createElement(u,null).type,_=function(t){function n(e){var n=t.call(this,e)||this;return(0,s.initializeComponentRef)(n),(0,s.warnDeprecations)("DialogContent",e,{titleId:"titleProps.id"}),n}return(0,o.__extends)(n,t),n.prototype.render=function(){var t,n=this.props,a=n.showCloseButton,r=n.className,c=n.closeButtonAriaLabel,d=n.onDismiss,l=n.subTextId,u=n.subText,f=n.titleProps,m=void 0===f?{}:f,_=n.titleId,h=n.title,b=n.type,g=n.styles,v=n.theme,y=n.draggableHeaderClassName,S=p(g,{theme:v,className:r,isLargeHeader:b===e.largeHeader,isClose:b===e.close,draggableHeaderClassName:y}),D=this._groupChildren();return u&&(t=i.createElement("p",{className:S.subText,id:l},u)),i.createElement("div",{className:S.content},i.createElement("div",{className:S.header},i.createElement("div",(0,o.__assign)({id:_,role:"heading","aria-level":1},m,{className:(0,s.css)(S.title,m.className)}),h),i.createElement("div",{className:S.topButton},this.props.topButtonsProps.map(function(e,t){return i.createElement(s.IconButton,(0,o.__assign)({key:e.uniqueId||t},e))}),(b===e.close||a&&b!==e.largeHeader)&&i.createElement(s.IconButton,{className:S.button,iconProps:{iconName:"Cancel"},ariaLabel:c,onClick:d}))),i.createElement("div",{className:S.inner},i.createElement("div",{className:S.innerContent},t,D.contents),D.footers))},n.prototype._groupChildren=function(){var e={footers:[],contents:[]};return i.Children.map(this.props.children,function(t){"object"==typeof t&&null!==t&&t.type===m?e.footers.push(t):e.contents.push(t)}),e},n.defaultProps={showCloseButton:!1,className:"",topButtonsProps:[],closeButtonAriaLabel:"Close"},(0,o.__decorate)([f.withResponsiveMode],n)}(i.Component),h={contentLgHeader:"ms-Dialog-lgHeader",close:"ms-Dialog--close",subText:"ms-Dialog-subText",header:"ms-Dialog-header",headerLg:"ms-Dialog--lgHeader",button:"ms-Dialog-button ms-Dialog-button--close",inner:"ms-Dialog-inner",content:"ms-Dialog-content",title:"ms-Dialog-title"},b=(0,s.styled)(_,function(e){var t,n,a,i=e.className,r=e.theme,o=e.isLargeHeader,c=e.isClose,d=e.hidden,l=e.isMultiline,u=e.draggableHeaderClassName,f=r.palette,p=r.fonts,m=r.effects,_=r.semanticColors,b=(0,s.getGlobalClassNames)(h,r);return{content:[o&&[b.contentLgHeader,{borderTop:"4px solid ".concat(f.themePrimary)}],c&&b.close,{flexGrow:1,overflowY:"hidden"},i],subText:[b.subText,p.medium,{margin:"0 0 24px 0",color:_.bodySubtext,lineHeight:"1.5",wordWrap:"break-word",fontWeight:s.FontWeights.regular}],header:[b.header,{position:"relative",width:"100%",boxSizing:"border-box"},c&&b.close,u&&[u,{cursor:"move"}]],button:[b.button,d&&{selectors:{".ms-Icon.ms-Icon--Cancel":{color:_.buttonText,fontSize:s.IconFontSizes.medium}}}],inner:[b.inner,{padding:"0 24px 24px",selectors:(t={},t["@media (min-width: ".concat(s.ScreenWidthMinSmall,"px) and (max-width: ").concat(s.ScreenWidthMaxSmall,"px)")]={padding:"0 16px 16px"},t)}],innerContent:[b.content,{position:"relative",width:"100%"}],title:[b.title,p.xLarge,{color:_.bodyText,margin:"0",minHeight:p.xLarge.fontSize,padding:"16px 46px 20px 24px",lineHeight:"normal",selectors:(n={},n["@media (min-width: ".concat(s.ScreenWidthMinSmall,"px) and (max-width: ").concat(s.ScreenWidthMaxSmall,"px)")]={padding:"16px 46px 16px 16px"},n)},o&&{color:_.menuHeader},l&&{fontSize:p.xxLarge.fontSize}],topButton:[{display:"flex",flexDirection:"row",flexWrap:"nowrap",position:"absolute",top:"0",right:"0",padding:"15px 15px 0 0",selectors:(a={"> *":{flex:"0 0 auto"},".ms-Dialog-button":{color:_.buttonText},".ms-Dialog-button:hover":{color:_.buttonTextHovered,borderRadius:m.roundedCorner2}},a["@media (min-width: ".concat(s.ScreenWidthMinSmall,"px) and (max-width: ").concat(s.ScreenWidthMaxSmall,"px)")]={padding:"15px 8px 0 0"},a)}]}},void 0,{scope:"DialogContent"});b.displayName="DialogContent";var g,S=v(806),D=v(526),I=v(575);!function(e){e[e.New=0]="New",e[e.Pending=1]="Pending",e[e.Rejected=2]="Rejected",e[e.Aborted=3]="Aborted",e[e.Approved=4]="Approved",e[e.Open=5]="Open",e[e.Closed=6]="Closed",e[e.Hidden=7]="Hidden"}(g||(g={}));const x=function(){function e(e){this._config=e||{},this._state=g.New,this._isSecondary=!1,this.close=this.close.bind(this),this.render=this.render.bind(this)}return Object.defineProperty(e.prototype,"_configuration",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSecondary",{get:function(){return this._isSecondary},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._state===g.Open},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHidden",{get:function(){return this._state===g.Hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"secondaryDialogProvider",{get:function(){if(!this.isSecondary)return!this._secondaryDialogProvider&&this._requestId&&(this._secondaryDialogProvider=ae.instance.createSecondaryDialogProvider(this._requestId)),this._secondaryDialogProvider},enumerable:!1,configurable:!0}),e.prototype.show=function(e){return ae.instance?ae.instance.show(this,e):Promise.reject(new Error("This application is not configured to accept dialogs."))},e.prototype.close=function(){if(ae.instance){if(this._isActive)return ae.instance._close(this);ae.instance._abort(this)}return Promise.resolve(void 0)},e.prototype._render=function(e){var t,n,a=this;return this._domElement=e,this._renderPromise||(this._renderPromise=new Promise(function(e,a){n=e,t=a}),this._closedWhileRendering=!1,this.onBeforeOpen().then(function(){a._closedWhileRendering?t():(a.render(),n())}).catch(function(){ae.instance._rejectOnOpen(a),t()})),this._renderPromise},e.prototype._setState=function(t){t===g.Closed&&(this._secondaryDialogProvider=void 0,this._renderPromise&&(this._closedWhileRendering=!0,this._renderPromise=void 0)),a._TraceLogger.logVerboseData({source:e._logSource,message:"Dialog state changed from '".concat(g[this._state],"' to '").concat(g[t],"'.")}),this._state=t},e.prototype._requestAck=function(e,t){this._requestId=e,this._isSecondary=!!t},Object.defineProperty(e.prototype,"domElement",{get:function(){return this._domElement},enumerable:!1,configurable:!0}),e.prototype.onBeforeOpen=function(){return Promise.resolve(void 0)},e.prototype.onAfterClose=function(){},Object.defineProperty(e.prototype,"_isActive",{get:function(){return this._state===g.Approved||this._state===g.Open||this._state===g.Hidden},enumerable:!1,configurable:!0}),e._logSource=a._LogSource.create("BaseDialog"),e}();function C(){return n._SPKillSwitch.isActivated("e0a66e3f-837c-49fb-b318-d783c463abd2")}var O=v(424);O.loadStyles(".d_w39RM_LRPq8{padding-top:24px}.d_ApxCS_LRPq8{padding:0 24px 24px}",!0);const w="d_w39RM_LRPq8",E="d_ApxCS_LRPq8";var A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,o.__extends)(t,e),t.prototype.render=function(){return C()?i.createElement(b,{title:"Alert",subText:this.props.message,subTextId:"sp-dialog-content-message"},i.createElement(u,null,i.createElement(I.PrimaryButton,{"data-automation-id":"sp-alert-dialog-ok-button",onClick:this.props.close,text:"OK"}))):i.createElement(S.DialogBody,{className:E},i.createElement(S.DialogTitle,{className:w},"Alert"),i.createElement(S.DialogContent,{id:"sp-dialog-content-message"},this.props.message),i.createElement(S.DialogActions,null,i.createElement(D.Button,{appearance:"primary","data-automation-id":"sp-alert-dialog-ok-button",onClick:this.props.close},"OK")))},t}(i.Component);const L=function(e){function t(t){var n=e.call(this,{isBlocking:!1})||this;return n._message=t,n}return(0,o.__extends)(t,e),t.prototype.render=function(){r.render(i.createElement(A,{message:this._message,close:this.close}),this.domElement)},t.prototype.onAfterClose=function(){r.unmountComponentAtNode(this.domElement)},t}(x);var k=v(568),M=v(606);const P=(0,M.createLightTheme)({10:"#061724",20:"#082338",30:"#0a2e4a",40:"#0c3b5e",50:"#0e4775",60:"#0f548c",70:"#115ea3",80:"#0f6cbd",90:"#2886de",100:"#479ef5",110:"#62abf5",120:"#77b7f7",130:"#96c6fa",140:"#b4d6fa",150:"#cfe4fa",160:"#ebf3fc"}),T="#333333",U="rgba(255, 255, 255, 0.05)",F="rgba(255, 255, 255, 0.1)",H="rgba(255, 255, 255, 0.4)",R="rgba(255, 255, 255, 0.5)",N="rgba(255, 255, 255, 0.8)",B="rgba(0, 0, 0, 0.05)",j="rgba(0, 0, 0, 0.1)",V=e=>({borderRadiusSmall:e.roundedCorner2,borderRadiusMedium:e.roundedCorner4,borderRadiusLarge:e.roundedCorner6});var z=(0,M.makeStyles)({dialogSurface:(0,o.__assign)({maxHeight:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)",minWidth:"288px",width:"fit-content"},M.shorthands.padding(0))}),G=1e3*parseFloat(s.AnimationVariables.durationValue2),K=function(e){var t=e.isOpen,n=e.onDismissed,a=e.onDismiss,r=e.isBlocking,c=e.popupProps,d=z();i.useEffect(function(){var e;return t||(e=setTimeout(function(){null==n||n()},G)),function(){e&&clearTimeout(e)}},[t,n]);var l,u,f,p,m=(l=(0,s.getTheme)(),{...P,...(f=l.palette,p=l.isInverted,{colorNeutralForeground1:f.neutralPrimary,colorNeutralForeground1Hover:f.neutralPrimary,colorNeutralForeground1Pressed:f.neutralPrimary,colorNeutralForeground1Selected:f.neutralPrimary,colorNeutralForeground2:f.neutralSecondary,colorNeutralForeground2Hover:f.neutralPrimary,colorNeutralForeground2Pressed:f.neutralPrimary,colorNeutralForeground2Selected:f.neutralPrimary,colorNeutralForeground2BrandHover:f.themePrimary,colorNeutralForeground2BrandPressed:f.themeDarkAlt,colorNeutralForeground2BrandSelected:f.themePrimary,colorNeutralForeground3:p?f.neutralSecondaryAlt:f.neutralTertiary,colorNeutralForeground3Hover:f.neutralSecondary,colorNeutralForeground3Pressed:f.neutralSecondary,colorNeutralForeground3Selected:f.neutralSecondary,colorNeutralForeground3BrandHover:f.themePrimary,colorNeutralForeground3BrandPressed:f.themeDarkAlt,colorNeutralForeground3BrandSelected:f.themePrimary,colorNeutralForeground4:p?f.neutralSecondaryAlt:f.neutralQuaternary,colorNeutralForegroundDisabled:f.neutralTertiaryAlt,colorNeutralForegroundInvertedDisabled:H,colorBrandForegroundLink:f.themeDarkAlt,colorBrandForegroundLinkHover:f.themeDark,colorBrandForegroundLinkPressed:f.themeDarker,colorBrandForegroundLinkSelected:f.themeDarkAlt,colorNeutralForeground2Link:f.neutralSecondary,colorNeutralForeground2LinkHover:f.neutralPrimary,colorNeutralForeground2LinkPressed:f.neutralPrimary,colorNeutralForeground2LinkSelected:f.neutralPrimary,colorCompoundBrandForeground1:f.themePrimary,colorCompoundBrandForeground1Hover:f.themeDarkAlt,colorCompoundBrandForeground1Pressed:f.themeDark,colorBrandForeground1:f.themePrimary,colorBrandForeground2:f.themeDarkAlt,colorBrandForeground2Hover:f.themeDarkAlt,colorBrandForeground2Pressed:f.themeDarkAlt,colorNeutralForeground1Static:f.neutralPrimary,colorNeutralForegroundInverted:f.white,colorNeutralForegroundInvertedHover:f.white,colorNeutralForegroundInvertedPressed:f.white,colorNeutralForegroundInvertedSelected:f.white,colorNeutralForegroundOnBrand:f.white,colorNeutralForegroundStaticInverted:f.white,colorNeutralForegroundInvertedLink:f.white,colorNeutralForegroundInvertedLinkHover:f.white,colorNeutralForegroundInvertedLinkPressed:f.white,colorNeutralForegroundInvertedLinkSelected:f.white,colorNeutralForegroundInverted2:f.white,colorBrandForegroundInverted:f.themeSecondary,colorBrandForegroundInvertedHover:f.themeTertiary,colorBrandForegroundInvertedPressed:f.themeSecondary,colorBrandForegroundOnLight:f.themePrimary,colorBrandForegroundOnLightHover:f.themeDarkAlt,colorBrandForegroundOnLightPressed:f.themeDark,colorBrandForegroundOnLightSelected:f.themeDark,colorNeutralBackground1:f.white,colorNeutralBackground1Hover:f.neutralLighter,colorNeutralBackground1Pressed:f.neutralQuaternaryAlt,colorNeutralBackground1Selected:f.neutralLight,colorNeutralBackground2:f.neutralLighterAlt,colorNeutralBackground2Hover:f.neutralLighter,colorNeutralBackground2Pressed:f.neutralQuaternaryAlt,colorNeutralBackground2Selected:f.neutralLight,colorNeutralBackground3:f.neutralLighter,colorNeutralBackground3Hover:f.neutralLight,colorNeutralBackground3Pressed:f.neutralQuaternary,colorNeutralBackground3Selected:f.neutralQuaternaryAlt,colorNeutralBackground4:f.neutralLighter,colorNeutralBackground4Hover:f.neutralLighterAlt,colorNeutralBackground4Pressed:f.neutralLighter,colorNeutralBackground4Selected:f.white,colorNeutralBackground5:f.neutralLight,colorNeutralBackground5Hover:f.neutralLighter,colorNeutralBackground5Pressed:f.neutralLighter,colorNeutralBackground5Selected:f.neutralLighterAlt,colorNeutralBackground6:f.neutralLight,colorNeutralBackgroundStatic:T,colorNeutralBackgroundInverted:f.neutralSecondary,colorNeutralBackgroundAlpha:p?"rgba(26, 26, 26, 0.5)":R,colorNeutralBackgroundAlpha2:p?"rgba(31, 31, 31, 0.7)":N,colorSubtleBackground:"transparent",colorSubtleBackgroundHover:f.neutralLighter,colorSubtleBackgroundPressed:f.neutralQuaternaryAlt,colorSubtleBackgroundSelected:f.neutralLight,colorSubtleBackgroundLightAlphaHover:p?F:N,colorSubtleBackgroundLightAlphaPressed:p?U:R,colorSubtleBackgroundLightAlphaSelected:"transparent",colorSubtleBackgroundInverted:"transparent",colorSubtleBackgroundInvertedHover:j,colorSubtleBackgroundInvertedPressed:"rgba(0, 0, 0, 0.3)",colorSubtleBackgroundInvertedSelected:"rgba(0, 0, 0, 0.2)",colorTransparentBackground:"transparent",colorTransparentBackgroundHover:"transparent",colorTransparentBackgroundPressed:"transparent",colorTransparentBackgroundSelected:"transparent",colorNeutralBackgroundDisabled:f.neutralLighter,colorNeutralBackgroundInvertedDisabled:F,colorNeutralStencil1:f.neutralLight,colorNeutralStencil2:f.neutralLighterAlt,colorNeutralStencil1Alpha:p?F:j,colorNeutralStencil2Alpha:p?U:B,colorBackgroundOverlay:"rgba(0, 0, 0, 0.4)",colorScrollbarOverlay:"rgba(0, 0, 0, 0.5)",colorBrandBackground:f.themePrimary,colorBrandBackgroundHover:f.themeDarkAlt,colorBrandBackgroundPressed:f.themeDarker,colorBrandBackgroundSelected:f.themeDark,colorCompoundBrandBackground:f.themePrimary,colorCompoundBrandBackgroundHover:f.themeDarkAlt,colorCompoundBrandBackgroundPressed:f.themeDark,colorBrandBackgroundStatic:f.themePrimary,colorBrandBackground2:f.themeLighterAlt,colorBrandBackground2Hover:f.themeLighterAlt,colorBrandBackground2Pressed:f.themeLighterAlt,colorBrandBackground3Static:f.themeDark,colorBrandBackground4Static:f.themeDarker,colorBrandBackgroundInverted:f.white,colorBrandBackgroundInvertedHover:f.themeLighterAlt,colorBrandBackgroundInvertedPressed:f.themeLight,colorBrandBackgroundInvertedSelected:f.themeLighter,colorNeutralCardBackground:p?T:"#fafafa",colorNeutralCardBackgroundHover:p?"#3d3d3d":f.white,colorNeutralCardBackgroundPressed:p?"#2e2e2e":"#f5f5f5",colorNeutralCardBackgroundSelected:p?"#383838":"#ebebeb",colorNeutralCardBackgroundDisabled:p?"#141414":"#f0f0f0",colorNeutralStrokeAccessible:f.neutralSecondary,colorNeutralStrokeAccessibleHover:f.neutralSecondary,colorNeutralStrokeAccessiblePressed:f.neutralSecondary,colorNeutralStrokeAccessibleSelected:f.themePrimary,colorNeutralStroke1:f.neutralQuaternary,colorNeutralStroke1Hover:f.neutralTertiaryAlt,colorNeutralStroke1Pressed:f.neutralTertiaryAlt,colorNeutralStroke1Selected:f.neutralTertiaryAlt,colorNeutralStroke2:f.neutralQuaternaryAlt,colorNeutralStroke3:f.neutralLighter,colorNeutralStrokeSubtle:f.neutralQuaternaryAlt,colorNeutralStrokeOnBrand:f.white,colorNeutralStrokeOnBrand2:f.white,colorNeutralStrokeOnBrand2Hover:f.white,colorNeutralStrokeOnBrand2Pressed:f.white,colorNeutralStrokeOnBrand2Selected:f.white,colorBrandStroke1:f.themePrimary,colorBrandStroke2:f.themeLight,colorBrandStroke2Hover:f.themeLight,colorBrandStroke2Pressed:f.themeLight,colorBrandStroke2Contrast:f.themeLight,colorCompoundBrandStroke:f.themePrimary,colorCompoundBrandStrokeHover:f.themeDarkAlt,colorCompoundBrandStrokePressed:f.themeDark,colorNeutralStrokeDisabled:f.neutralQuaternaryAlt,colorNeutralStrokeInvertedDisabled:H,colorTransparentStroke:"transparent",colorTransparentStrokeInteractive:"transparent",colorTransparentStrokeDisabled:"transparent",colorNeutralStrokeAlpha:p?F:B,colorNeutralStrokeAlpha2:"rgba(255, 255, 255, 0.2)",colorStrokeFocus1:f.white,colorStrokeFocus2:f.black,colorNeutralShadowAmbient:"rgba(0,0,0,0.12)",colorNeutralShadowKey:"rgba(0,0,0,0.14)",colorNeutralShadowAmbientLighter:"rgba(0,0,0,0.06)",colorNeutralShadowKeyLighter:"rgba(0,0,0,0.07)",colorNeutralShadowAmbientDarker:"rgba(0,0,0,0.20)",colorNeutralShadowKeyDarker:"rgba(0,0,0,0.24)",colorBrandShadowAmbient:"rgba(0,0,0,0.30)",colorBrandShadowKey:"rgba(0,0,0,0.25)"}),...(u=l.effects,{shadow4:u.elevation4,shadow8:u.elevation8,shadow16:u.elevation16,shadow64:u.elevation64}),...V(l.effects)});return i.createElement(M.IdPrefixProvider,{value:"ms-sp-dialog-"},i.createElement(M.FluentProvider,{theme:m},i.createElement(S.Dialog,{open:t,onOpenChange:function(e,t){!1===t.open&&(null==a||a(e))},modalType:r?"alert":"modal"},i.createElement(S.DialogSurface,(0,o.__assign)({},c,{className:(0,M.mergeClasses)(d.dialogSurface,null==c?void 0:c.className)}),e.children))))},W=v(464),q=v(395);O.loadStyles('.Placeholder{display:flex}.Placeholder .Placeholder-container{align-items:center;background-color:"[theme:neutralLighter, default: #f3f2f1]";color:"[theme:neutralSecondary, default: #605e5c]";padding:80px 0;width:100%}.Placeholder .Placeholder-container .Placeholder-head{color:"[theme:neutralPrimary, default: #323130]"}.Placeholder .Placeholder-container .Placeholder-head .Placeholder-headContainer{height:100%;text-align:center;white-space:nowrap}.Placeholder .Placeholder-container .Placeholder-head .Placeholder-icon{display:inline-block;vertical-align:middle;white-space:normal}.Placeholder .Placeholder-container .Placeholder-head .Placeholder-text{display:inline-block;line-height:normal;vertical-align:middle;white-space:normal}[dir=ltr] .Placeholder .Placeholder-container .Placeholder-head .Placeholder-text{padding-left:20px}[dir=rtl] .Placeholder .Placeholder-container .Placeholder-head .Placeholder-text{padding-right:20px}.Placeholder .Placeholder-container .Placeholder-description{margin:0 auto;text-align:center;vertical-align:middle;width:65%}.Placeholder .Placeholder-container .Placeholder-description .Placeholder-descriptionText{color:"[theme:neutralSecondary, default: #605e5c]";display:inline-block;font-size:17px;font-weight:100;margin:24px 0}.Placeholder-overlay{height:100%;position:relative;z-index:1}.Placeholder-overlay .Placeholder-spinnerContainer{margin:164px 0;position:relative;width:100%}',!0);const Q=function(e){function t(t){var n=e.call(this,t)||this;return n.showSpinner=n.showSpinner.bind(n),n.state={showSpinner:!t.hideSpinner},n}return(0,o.__extends)(t,e),t.prototype.componentDidMount=function(){this._isMounted=!0},t.prototype.render=function(){return this.state.removePlaceholder?null:C()?i.createElement(s.Overlay,{className:"Placeholder-overlay"},i.createElement("div",{className:"Placeholder-spinnerContainer"},this.state.showSpinner&&i.createElement(W.Spinner,{type:s.SpinnerType.large,label:this.props.label}))):i.createElement("div",{className:"Placeholder-overlay"},i.createElement("div",{className:"Placeholder-spinnerContainer"},this.state.showSpinner&&i.createElement(q.Spinner,{size:"small",label:this.props.label})))},t.prototype.componentWillUnmount=function(){this._isMounted=!1},t.prototype.showSpinner=function(e){this._isMounted&&this.setState({showSpinner:e})},t.prototype.clearPlaceholder=function(){this._isMounted&&this.setState({removePlaceholder:!0})},t}(i.Component),Y=function(e){function t(t){var n=e.call(this,t)||this;return n._divRef=i.createRef(),n}return(0,o.__extends)(t,e),t.prototype.render=function(){return i.createElement("div",{"data-automation-id":"sp-dialog-content-div",ref:this._divRef})},t.prototype.componentDidUpdate=function(){this.props.innerElement&&this._divRef.current&&(this._divRef.current.innerHTML="",this._divRef.current.appendChild(this.props.innerElement))},t.prototype.componentWillUnmount=function(){this._divRef.current&&(this._divRef.current.innerHTML="")},t.prototype.componentDidMount=function(){this.props.innerElement&&this._divRef.current&&this._divRef.current.appendChild(this.props.innerElement)},t}(i.Component);var J=v(145);const X=function(e){function t(t){var a=e.call(this,t)||this;return a.open=function(e){return a._openPromise=new Promise(function(e){a._resolveOpenPromise=e}),e=e||a.state.dialog,n._SPKillSwitch.isActivated("e756ee01-c654-4096-aa21-c3b8acb25797")||(0,J.cleanupDefaultLayerHost)(document.body),a.setState({dialog:e,isOpen:!0,isContentReady:!1}),a._openPromise},a.close=function(){return a._closedPromise=new Promise(function(e){a._resolveClosedPromise=e}),a.state.isOpen?a.setState({isOpen:!1}):a._resolveClosedPromise(),a._closedPromise},a._onDismissed=function(){!a.state.isOpen&&a._resolveClosedPromise&&a._resolveClosedPromise()},a._closeCallback=function(){a.props.closeCallback&&a.state.dialog&&a.props.closeCallback(a.state.dialog)},a._onDismissed=a._onDismissed.bind(a),a.state={isOpen:!1,isContentReady:!1},a}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=!this.state.isContentReady&&(C()?i.createElement(b,{},i.createElement(Q,{label:""})):i.createElement(Q,{label:""}));if(this.state.dialog){var t={role:"dialog",ariaDescribedBy:"sp-dialog-content-message","aria-live":this.state.dialog._configuration.isBlocking?"assertive":"polite"};return C()?i.createElement(k.Modal,{isOpen:this.state.isOpen,isBlocking:this.state.dialog._configuration.isBlocking,layerProps:{eventBubblingEnabled:!0},onDismissed:this._onDismissed,onDismiss:this._closeCallback,popupProps:t},!e&&i.createElement(Y,{innerElement:this._detachedElement}),e):i.createElement(K,{isOpen:this.state.isOpen,isBlocking:this.state.dialog._configuration.isBlocking,onDismissed:this._onDismissed,onDismiss:this._closeCallback,popupProps:t},!e&&i.createElement(Y,{innerElement:this._detachedElement}),e)}return i.createElement("div",null)},t.prototype.UNSAFE_componentWillMount=function(){this._detachedElement=document.createElement("DIV")},t.prototype.componentDidUpdate=function(){var e=this;this.state.isOpen&&this.state.dialog&&this._detachedElement&&(this.state.isContentReady?this._resolveOpenPromise&&this._resolveOpenPromise():this.state.dialog._render(this._detachedElement).then(function(){e.setState({isContentReady:!0})}))},t}(i.Component);var Z=v(944),$=function(e){function t(t){var n=e.call(this,t)||this;return n._onKeyDown=function(e){13===e.keyCode&&n._ok(),27===e.keyCode&&n.props.close()},n._ok=function(){n.props.resolve(n._value)},n._onValueChanged=function(e,t){n._value=t},n._textRef=i.createRef(),n}return(0,o.__extends)(t,e),t.prototype.render=function(){return this._value=this.props.defaultValue,C()?i.createElement(b,{title:"Prompt",subText:this.props.message,subTextId:"sp-dialog-content-message"},i.createElement(Z.TextField,{componentRef:this._textRef,onChange:this._onValueChanged,defaultValue:this.props.defaultValue,onKeyDown:this._onKeyDown,autoFocus:!0}),i.createElement(u,null,i.createElement(I.Button,{onClick:this.props.close,text:"Cancel"}),i.createElement(I.PrimaryButton,{onClick:this._ok,text:"OK"}))):i.createElement(S.DialogBody,{className:E},i.createElement(S.DialogTitle,{className:w},"Prompt"),i.createElement(S.DialogContent,{id:"sp-dialog-content-message"},this.props.message,i.createElement(Z.TextField,{componentRef:this._textRef,onChange:this._onValueChanged,defaultValue:this.props.defaultValue,onKeyDown:this._onKeyDown,autoFocus:!0})),i.createElement(S.DialogActions,null,i.createElement(D.Button,{onClick:this.props.close},"Cancel"),i.createElement(D.Button,{appearance:"primary",onClick:this._ok},"OK")))},t.prototype.componentDidUpdate=function(){this._textRef.current&&this._textRef.current.focus()},t}(i.Component);const ee=function(e){function t(t,n,a){void 0===a&&(a="");var i=e.call(this,{isBlocking:!0})||this;return i.resolve=function(e){i.close().then(function(){i._resolve(e)})},i._message=t,i._defaultValue=a,i._resolve=n,i}return(0,o.__extends)(t,e),t.prototype.render=function(){r.render(i.createElement($,{message:this._message,defaultValue:this._defaultValue,close:this.close,resolve:this.resolve}),this.domElement)},t.prototype.onAfterClose=function(){r.unmountComponentAtNode(this.domElement)},t}(x),te=function(){function e(e,t){this._ownerRequestId=t,this._primaryManager=e}return e.prototype.alert=function(e,t){var n=new L(e);return this.show(n,t)},e.prototype.prompt=function(e,t){var n=this;return new Promise(function(a){var i=new ee(e,a,t?t.defaultValue:void 0);n.show(i,t)})},e.prototype.show=function(e,t){return this._primaryManager._showSecondary(e,this._ownerRequestId,t)},e}();var ne=g;const ae=function(){function e(t){var o=this;this.show=function(t,i){n.Validate.isNotNullOrUndefined(t,"dialog");var r=t,s=new a._QosMonitor("DialogManager.show");a._TraceLogger.logVerbose(e._logSource,"New request to show a dialog has been submitted.");try{if(r._isActive){s.writeExpectedFailure("DuplicateRequest");var c=new Error("Cannot accept new requests for active dialogs.");return a._TraceLogger.logError(e._logSource,c),Promise.reject(c)}var d=function(){},l=function(){},u=new Promise(function(e,t){d=e,l=t}).then(function(){s.writeSuccess()},function(e){s.writeExpectedFailure("RequestRejected",e)}),f=n.Guid.newGuid();return o._requests.push({id:f,dialog:t,resolve:d,reject:l,options:i}),r._requestAck(f),r._setState(ne.Pending),Promise.resolve(void 0).then(function(){o._processNextRequest()}),u}catch(e){return s.writeUnexpectedFailure("UnhandledError",e),Promise.reject(e)}},this._abort=function(e){var t=e;e&&!t._isActive&&(t._setState(ne.New),o._removeRequest(t._requestId,!1))},this._rejectOnOpen=function(e){var t=e;e&&o._getUiComponent(e).close().then(function(){t._setState(ne.New),o._removeRequest(t._requestId,!1)})},this._close=function(e){n.Validate.isNotNullOrUndefined(e,"dialog");var t=e,i=new a._QosMonitor("DialogManager.close");if(t._isActive){var r=o._getUiComponent(e).close().then(function(){t.onAfterClose(),t._setState(ne.Closed),o._removeRequest(t._requestId,!0)}).then(function(){i.writeSuccess()},function(e){i.writeExpectedFailure("RequestRejected",e)});return r.then(function(){(o._pendingRequests.length>0||o._hasHiddenDialog)&&o._processNextRequest()}),r}return i.writeSuccess(),Promise.resolve(void 0)},this._processNextRequest=function(){if(!o.isShowingDialog){var t=new a._QosMonitor("DialogManager.processRequest");try{for(var n=0,i=o._requests;n<i.length;n++){var r=i[n],s=r.dialog,c=!1;if(!r.isSecondary&&r.options&&(c=!(!r.options.confirmOpen||r.options.confirmOpen())),c){var d="The request to show the dialog was aborted.";a._TraceLogger.logVerbose(e._logSource,d),r.reject(new Error(d)),o._abort(r.dialog)}else if(s._state===ne.Approved||s._state===ne.Hidden)o._open(r.dialog);else if(s._state===ne.Pending){if(o._config.allowDialogs)s._setState(ne.Approved),o._open(r.dialog);else{var l=new Error("The application cannot accept dialogs at the moment.");a._TraceLogger.logError(e._logSource,l),r.reject(l),s._setState(ne.Rejected),o._removeRequest(r.id,!1)}break}}t.writeSuccess()}catch(n){a._TraceLogger.logErrorData({source:e._logSource,error:n}),t.writeUnexpectedFailure("UnhandledError",n)}}},this._removeRequest=function(e,t){if(e)for(var n=0;n<o._requests.length;n++){var a=o._requests[n];a.id===e&&(t&&a.resolve(),o._requests.splice(n,1))}},this._hide=function(e){var t=e;e&&t._state===ne.Open&&o._getUiComponent(e).close().then(function(){t._setState(ne.Hidden)})},this._unhide=function(e){var t=e;e&&t._state===ne.Hidden&&(o._getUiComponent(e).open(e),t._setState(ne.Open))},this._open=function(e){var t=e;return t._state===ne.Hidden?(o._unhide(e),!0):t._state===ne.Approved&&(o.isShowingDialog&&e.isSecondary?(o._hide(o._currentlyOpenDialogRequest.dialog),!o._childUiComponent&&o._childDialogDiv&&r.render(i.createElement(X,{closeCallback:o._close,ref:function(e){o._childUiComponent=e}}),o._childDialogDiv),o._childUiComponent.open(e).then(function(){t._setState(ne.Open)}),!0):(!o._mainUiComponent&&o._mainDialogDiv&&r.render(i.createElement(X,{closeCallback:o._close,ref:function(e){o._mainUiComponent=e}}),o._mainDialogDiv),o._mainUiComponent.open(e).then(function(){t._setState(ne.Open)}),!0))},n.Validate.isNotNullOrUndefined(t,"DialogManager Configuration"),n.Validate.isNotNullOrUndefined(t.domElement,"Dialog Container"),this._container=t.domElement,this._mainDialogDiv=document.createElement("DIV"),this._childDialogDiv=document.createElement("DIV"),this._container.appendChild(this._mainDialogDiv),this._container.appendChild(this._childDialogDiv),this._requests=[]}return Object.defineProperty(e,"instance",{get:function(){return this._instance||(this._instance=new e(t._DialogManagerConfiguration.instance)),this._instance},enumerable:!1,configurable:!0}),e.prototype.alert=function(e,t){return this.show(new L(e),t)},e.prototype.prompt=function(e,t){var n=this;return new Promise(function(a){n.show(new ee(e,a),t)})},Object.defineProperty(e.prototype,"isShowingDialog",{get:function(){return this._activeDialogs.filter(function(e){return e._state===ne.Open}).length>0},enumerable:!1,configurable:!0}),e.prototype.createSecondaryDialogProvider=function(e){return new te(this,e)},e.prototype._showSecondary=function(t,i,r){n.Validate.isNotNullOrUndefined(t,"dialog"),n.Validate.isNotNullOrUndefined(i,"ownerRequestId");var o=t,s=new a._QosMonitor("DialogManager.showSecondary");a._TraceLogger.logVerbose(e._logSource,"A request to show a secondary dialog has been submitted.");try{if(this._hasPermissionToShow(i)){var c=function(){},d=function(){},l=new Promise(function(e,t){c=e,d=t}).then(function(){s.writeSuccess()},function(e){s.writeExpectedFailure("RequestRejected",e)}),u=n.Guid.newGuid();return this._requests.unshift({id:u,dialog:t,resolve:c,reject:d,isSecondary:!0,options:r}),o._requestAck(u,!0),o._setState(ne.Approved),this._open(t),l}var f=new Error("Only an active dialog can show a secondary dialog.");return a._TraceLogger.logError(e._logSource,f),s.writeExpectedFailure("PermissionDenied"),Promise.reject(f)}catch(t){return a._TraceLogger.logErrorData({source:e._logSource,error:t}),s.writeUnexpectedFailure("UnhandledError",t),Promise.reject(t)}},Object.defineProperty(e.prototype,"_activeDialogs",{get:function(){return this._requests.filter(function(e){return e.dialog._isActive}).map(function(e){return e.dialog})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_pendingRequests",{get:function(){return this._requests.filter(function(e){return e.dialog._state===ne.Pending})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_hasHiddenDialog",{get:function(){return this._requests.filter(function(e){return e.dialog._state===ne.Hidden}).length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_currentlyOpenDialogRequest",{get:function(){return this._requests.filter(function(e){return e.dialog._state===ne.Open})[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_config",{get:function(){return t._DialogManagerConfiguration.instance},enumerable:!1,configurable:!0}),e.prototype._getUiComponent=function(e){return e.isSecondary?this._childUiComponent:this._mainUiComponent},e.prototype._hasPermissionToShow=function(e){var t=this._getRequestById(e);return t&&t.dialog._isActive&&!this._currentlyOpenDialogRequest.isSecondary},e.prototype._getRequestById=function(e){return this._requests.filter(function(t){return t.id.equals(e)})[0]},e._logSource=a._LogSource.create("DialogManager"),e}(),ie=function(){function e(){}return e.alert=function(e,t){var n=ae.instance;return n?n.alert(e,t):Promise.resolve(void 0)},e.prompt=function(e,t){var n=ae.instance;return n?n.prompt(e,t):Promise.resolve(void 0)},e}()})(),y})());