forked from SonjayaJetBrain/Super-Brocoli
-
Notifications
You must be signed in to change notification settings - Fork 1
/
editor.40a1f895.chunk.js
2 lines (2 loc) · 378 KB
/
editor.40a1f895.chunk.js
1
2
(this["webpackJsonpmaker-code-editor"]=this["webpackJsonpmaker-code-editor"]||[]).push([[10,3],{1028:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(2),a=r(0),i=function(e){function t(t){var r=e.call(this,t)||this;return r.state={isRendered:!1},r}return Object(n.c)(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.delay;this._timeoutId=window.setTimeout((function(){e.setState({isRendered:!0})}),t)},t.prototype.componentWillUnmount=function(){this._timeoutId&&clearTimeout(this._timeoutId)},t.prototype.render=function(){return this.state.isRendered?a.Children.only(this.props.children):null},t.defaultProps={delay:0},t}(a.Component)},1055:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(249);var a=Object(n.a)((function(e){return Object(n.a)((function(t){var r=Object(n.a)((function(e){return function(r){return t(r,e)}}));return function(n,a){return e(n,a?r(a):t)}}))}));function i(e,t){return a(e)(t)}},1056:function(e,t,r){},1060:function(e,t,r){e.exports=function(){return new Worker(r.p+"5283465823f0a1d73637.worker.js")}},1342:function(e,t,r){"use strict";r.d(t,"a",(function(){return S}));var n=r(629),a=r(2),i=r(0),o=r(247),s=r(630),c=r(631),u=r(1028),l=Object(s.a)(),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.c)(t,e),t.prototype.render=function(){var e=this.props,t=e.type,r=e.size,n=e.ariaLabel,s=e.ariaLive,d=e.styles,p=e.label,f=e.theme,g=e.className,m=e.labelPosition,h=n,b=Object(c.d)(this.props,c.c,["size"]),v=r;void 0===v&&void 0!==t&&(v=t===o.b.large?o.a.large:o.a.medium);var S=l(d,{theme:f,size:v,className:g,labelPosition:m});return i.createElement("div",Object(a.a)({},b,{className:S.root}),i.createElement("div",{className:S.circle}),p&&i.createElement("div",{className:S.label},p),h&&i.createElement("div",{role:"status","aria-live":s},i.createElement(u.a,null,i.createElement("div",{className:S.screenReaderText},h))))},t.defaultProps={size:o.a.medium,ariaLive:"polite",labelPosition:"bottom"},t}(i.Component),p=r(1369),f=r(632),g=r(948),m=r(1379),h=r(249),b={root:"ms-Spinner",circle:"ms-Spinner-circle",label:"ms-Spinner-label"},v=Object(h.b)((function(){return Object(p.a)({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}})})),S=Object(n.a)(d,(function(e){var t,r=e.theme,n=e.size,a=e.className,i=e.labelPosition,s=r.palette,c=Object(f.a)(b,r);return{root:[c.root,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},"top"===i&&{flexDirection:"column-reverse"},"right"===i&&{flexDirection:"row"},"left"===i&&{flexDirection:"row-reverse"},a],circle:[c.circle,{boxSizing:"border-box",borderRadius:"50%",border:"1.5px solid "+s.themeLight,borderTopColor:s.themePrimary,animationName:v(),animationDuration:"1.3s",animationIterationCount:"infinite",animationTimingFunction:"cubic-bezier(.53,.21,.29,.67)",selectors:(t={},t[g.a]={borderTopColor:"Highlight"},t)},n===o.a.xSmall&&["ms-Spinner--xSmall",{width:12,height:12}],n===o.a.small&&["ms-Spinner--small",{width:16,height:16}],n===o.a.medium&&["ms-Spinner--medium",{width:20,height:20}],n===o.a.large&&["ms-Spinner--large",{width:28,height:28}]],label:[c.label,r.fonts.small,{color:s.themePrimary,margin:"8px 0 0",textAlign:"center"},"top"===i&&{margin:"0 0 8px"},"right"===i&&{margin:"0 0 0 8px"},"left"===i&&{margin:"0 8px 0 0"}],screenReaderText:m.a}}),void 0,{scope:"Spinner"})},1343:function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(2),a=r(0),i=r(1363),o=r(953),s=r(946),c=r(1370),u=r(631),l=r(1367),d=r(832),p=r(1365),f=r(47),g=0,m=1,h=2,b=3,v=r(1055),S={top:-1,bottom:-1,left:-1,right:-1,width:0,height:0},y=function(e){return e.getBoundingClientRect()},O=y,x=y,j=function(e){function t(t){var r=e.call(this,t)||this;return r._root=a.createRef(),r._surface=a.createRef(),r._onRenderRoot=function(e){var t=e.rootRef,r=e.surfaceElement,i=e.divProps;return a.createElement("div",Object(n.a)({ref:t},i),r)},r._onRenderSurface=function(e){var t=e.surfaceRef,r=e.pageElements,i=e.divProps;return a.createElement("div",Object(n.a)({ref:t},i),r)},r._onRenderPage=function(e,t){for(var i=r.props,o=i.onRenderCell,s=i.role,c=e.page,u=c.items,l=void 0===u?[]:u,d=c.startIndex,p=Object(n.d)(e,["page"]),f=void 0===s?"listitem":"presentation",g=[],m=0;m<l.length;m++){var h=d+m,b=l[m],v=r.props.getKey?r.props.getKey(b,h):b&&b.key;null!==v&&void 0!==v||(v=h),g.push(a.createElement("div",{role:f,className:"ms-List-cell",key:v,"data-list-index":h,"data-automationid":"ListCell"},o&&o(b,h,r.props.ignoreScrollingState?void 0:r.state.isScrolling)))}return a.createElement("div",Object(n.a)({},p),g)},Object(i.a)(r),r.state={pages:[],isScrolling:!1},r._async=new o.a(r),r._events=new s.a(r),r._estimatedPageHeight=0,r._totalEstimates=0,r._requiredWindowsAhead=0,r._requiredWindowsBehind=0,r._measureVersion=0,r._onAsyncScroll=r._async.debounce(r._onAsyncScroll,100,{leading:!1,maxWait:500}),r._onAsyncIdle=r._async.debounce(r._onAsyncIdle,200,{leading:!1}),r._onAsyncResize=r._async.debounce(r._onAsyncResize,16,{leading:!1}),r._onScrollingDone=r._async.debounce(r._onScrollingDone,500,{leading:!1}),r._cachedPageHeights={},r._estimatedPageHeight=0,r._focusedIndex=-1,r._pageCache={},r}return Object(n.c)(t,e),t.prototype.scrollToIndex=function(e,t,r){void 0===r&&(r=g);for(var n=this.props.startIndex,a=n+this._getRenderCount(),i=this._allowedRect,o=0,s=1,c=n;c<a;c+=s){var u=this._getPageSpecification(c,i),l=u.height;if(s=u.itemCount,c<=e&&c+s>e){if(t&&this._scrollElement){for(var d=x(this._scrollElement),p={top:this._scrollElement.scrollTop,bottom:this._scrollElement.scrollTop+d.height},f=e-c,v=0;v<f;++v)o+=t(c+v);var S=o+t(e);switch(r){case m:return void(this._scrollElement.scrollTop=o);case h:return void(this._scrollElement.scrollTop=S-d.height);case b:return void(this._scrollElement.scrollTop=(o+S-d.height)/2)}if(o>=p.top&&S<=p.bottom)return;o<p.top||S>p.bottom&&(o=S-d.height)}return void(this._scrollElement.scrollTop=o)}o+=l}},t.prototype.getStartItemIndexInView=function(e){for(var t=0,r=this.state.pages||[];t<r.length;t++){var n=r[t];if(!n.isSpacer&&(this._scrollTop||0)>=n.top&&(this._scrollTop||0)<=n.top+n.height){if(!e){var a=Math.floor(n.height/n.itemCount);return n.startIndex+Math.floor((this._scrollTop-n.top)/a)}for(var i=0,o=n.startIndex;o<n.startIndex+n.itemCount;o++){a=e(o);if(n.top+i<=this._scrollTop&&this._scrollTop<n.top+i+a)return o;i+=a}}}return 0},t.prototype.componentDidMount=function(){this._updatePages(),this._measureVersion++,this._scrollElement=Object(c.e)(this._root.current),this._events.on(window,"resize",this._onAsyncResize),this._root.current&&this._events.on(this._root.current,"focus",this._onFocus,!0),this._scrollElement&&(this._events.on(this._scrollElement,"scroll",this._onScroll),this._events.on(this._scrollElement,"scroll",this._onAsyncScroll))},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose(),delete this._scrollElement},t.prototype.UNSAFE_componentWillReceiveProps=function(e){e.items===this.props.items&&e.renderCount===this.props.renderCount&&e.startIndex===this.props.startIndex&&e.version===this.props.version||(this._resetRequiredWindows(),this._requiredRect=null,this._measureVersion++,this._invalidatePageCache(),this._updatePages(e))},t.prototype.shouldComponentUpdate=function(e,t){var r=this.state.pages,n=t.pages,a=!1;if(!t.isScrolling&&this.state.isScrolling)return!0;if(e.version!==this.props.version)return!0;if(e.items===this.props.items&&r.length===n.length)for(var i=0;i<r.length;i++){var o=r[i],s=n[i];if(o.key!==s.key||o.itemCount!==s.itemCount){a=!0;break}}else a=!0;return a},t.prototype.forceUpdate=function(){this._invalidatePageCache(),this._updateRenderRects(this.props,!0),this._updatePages(),this._measureVersion++,e.prototype.forceUpdate.call(this)},t.prototype.getTotalListHeight=function(){return this._surfaceRect.height},t.prototype.render=function(){for(var e=this.props,t=e.className,r=e.role,a=void 0===r?"list":r,i=e.onRenderSurface,o=e.onRenderRoot,s=this.state.pages,c=void 0===s?[]:s,d=[],p=Object(u.d)(this.props,u.c),f=0,g=c;f<g.length;f++){var m=g[f];d.push(this._renderPage(m))}var h=i?Object(v.a)(i,this._onRenderSurface):this._onRenderSurface;return(o?Object(v.a)(o,this._onRenderRoot):this._onRenderRoot)({rootRef:this._root,pages:c,surfaceElement:h({surfaceRef:this._surface,pages:c,pageElements:d,divProps:{role:"presentation",className:"ms-List-surface"}}),divProps:Object(n.a)(Object(n.a)({},p),{className:Object(l.a)("ms-List",t),role:d.length>0?a:void 0})})},t.prototype._shouldVirtualize=function(e){void 0===e&&(e=this.props);var t=e.onShouldVirtualize;return!t||t(e)},t.prototype._invalidatePageCache=function(){this._pageCache={}},t.prototype._renderPage=function(e){var t,r=this.props.usePageCache;if(r&&(t=this._pageCache[e.key])&&t.pageElement)return t.pageElement;var n=this._getPageStyle(e),a=this.props.onRenderPage,i=(void 0===a?this._onRenderPage:a)({page:e,className:"ms-List-page",key:e.key,ref:e.key,style:n,role:"presentation"},this._onRenderPage);return r&&0===e.startIndex&&(this._pageCache[e.key]={page:e,pageElement:i}),i},t.prototype._getPageStyle=function(e){var t=this.props.getPageStyle;return Object(n.a)(Object(n.a)({},t?t(e):{}),e.items?{}:{height:e.height})},t.prototype._onFocus=function(e){for(var t=e.target;t!==this._surface.current;){var r=t.getAttribute("data-list-index");if(r){this._focusedIndex=Number(r);break}t=Object(d.a)(t)}},t.prototype._onScroll=function(){this.state.isScrolling||this.props.ignoreScrollingState||this.setState({isScrolling:!0}),this._resetRequiredWindows(),this._onScrollingDone()},t.prototype._resetRequiredWindows=function(){this._requiredWindowsAhead=0,this._requiredWindowsBehind=0},t.prototype._onAsyncScroll=function(){var e,t;this._updateRenderRects(),this._materializedRect&&(e=this._requiredRect,t=this._materializedRect,e.top>=t.top&&e.left>=t.left&&e.bottom<=t.bottom&&e.right<=t.right)||this._updatePages()},t.prototype._onAsyncIdle=function(){var e=this.props,t=e.renderedWindowsAhead,r=e.renderedWindowsBehind,n=this._requiredWindowsAhead,a=this._requiredWindowsBehind,i=Math.min(t,n+1),o=Math.min(r,a+1);i===n&&o===a||(this._requiredWindowsAhead=i,this._requiredWindowsBehind=o,this._updateRenderRects(),this._updatePages()),(t>i||r>o)&&this._onAsyncIdle()},t.prototype._onScrollingDone=function(){this.props.ignoreScrollingState||this.setState({isScrolling:!1})},t.prototype._onAsyncResize=function(){this.forceUpdate()},t.prototype._updatePages=function(e){var t=this;void 0===e&&(e=this.props),this._requiredRect||this._updateRenderRects(e);var r=this._buildPages(e),n=this.state.pages;this._notifyPageChanges(n,r.pages),this.setState(r,(function(){var e=t.props,r=t.state;e.getPageHeight?t._onAsyncIdle():t._updatePageMeasurements(r.pages)?(t._materializedRect=null,t._hasCompletedFirstRender?t._onAsyncScroll():(t._hasCompletedFirstRender=!0,t._updatePages(e))):t._onAsyncIdle();e.onPagesUpdated&&e.onPagesUpdated(r.pages)}))},t.prototype._notifyPageChanges=function(e,t,r){void 0===r&&(r=this.props);var n=r.onPageAdded,a=r.onPageRemoved;if(n||a){for(var i={},o=0,s=e;o<s.length;o++){(l=s[o]).items&&(i[l.startIndex]=l)}for(var c=0,u=t;c<u.length;c++){var l;(l=u[c]).items&&(i[l.startIndex]?delete i[l.startIndex]:this._onPageAdded(l))}for(var d in i)i.hasOwnProperty(d)&&this._onPageRemoved(i[d])}},t.prototype._updatePageMeasurements=function(e){var t=!1;if(!this._shouldVirtualize())return t;for(var r=0;r<e.length;r++){var n=e[r];n.items&&(t=this._measurePage(n)||t)}return t},t.prototype._measurePage=function(e){var t=!1,r=this.refs[e.key],n=this._cachedPageHeights[e.startIndex];if(r&&this._shouldVirtualize()&&(!n||n.measureVersion!==this._measureVersion)){var a={width:r.clientWidth,height:r.clientHeight};(a.height||a.width)&&(t=e.height!==a.height,e.height=a.height,this._cachedPageHeights[e.startIndex]={height:a.height,measureVersion:this._measureVersion},this._estimatedPageHeight=Math.round((this._estimatedPageHeight*this._totalEstimates+a.height)/(this._totalEstimates+1)),this._totalEstimates++)}return t},t.prototype._onPageAdded=function(e){var t=this.props.onPageAdded;t&&t(e)},t.prototype._onPageRemoved=function(e){var t=this.props.onPageRemoved;t&&t(e)},t.prototype._buildPages=function(e){var t=e.renderCount,r=e.items,a=e.startIndex,i=e.getPageHeight;t=this._getRenderCount(e);for(var o=Object(n.a)({},S),s=[],c=1,u=0,l=null,d=this._focusedIndex,f=a+t,g=this._shouldVirtualize(e),m=0===this._estimatedPageHeight&&!i,h=this._allowedRect,b=function(e){var t=v._getPageSpecification(e,h),n=t.height,i=t.data,b=t.key;c=t.itemCount;var S,y,O=u+n-1,x=Object(p.b)(v.state.pages,(function(t){return!!t.items&&t.startIndex===e}))>-1,j=!h||O>=h.top&&u<=h.bottom,w=!v._requiredRect||O>=v._requiredRect.top&&u<=v._requiredRect.bottom;if(!m&&(w||j&&x)||!g||d>=e&&d<e+c||e===a){l&&(s.push(l),l=null);var E=Math.min(c,f-e),k=v._createPage(b,r.slice(e,e+E),e,void 0,void 0,i);k.top=u,k.height=n,v._visibleRect&&v._visibleRect.bottom&&(k.isVisible=O>=v._visibleRect.top&&u<=v._visibleRect.bottom),s.push(k),w&&v._allowedRect&&(S=o,y={top:u,bottom:O,height:n,left:h.left,right:h.right,width:h.width},S.top=y.top<S.top||-1===S.top?y.top:S.top,S.left=y.left<S.left||-1===S.left?y.left:S.left,S.bottom=y.bottom>S.bottom||-1===S.bottom?y.bottom:S.bottom,S.right=y.right>S.right||-1===S.right?y.right:S.right,S.width=S.right-S.left+1,S.height=S.bottom-S.top+1)}else l||(l=v._createPage("spacer-"+e,void 0,e,0,void 0,i,!0)),l.height=(l.height||0)+(O-u)+1,l.itemCount+=c;if(u+=O-u+1,m&&g)return"break"},v=this,y=a;y<f;y+=c){if("break"===b(y))break}return l&&(l.key="spacer-end",s.push(l)),this._materializedRect=o,{pages:s,measureVersion:this._measureVersion}},t.prototype._getPageSpecification=function(e,t){var r=this.props.getPageSpecification;if(r){var n=r(e,t),a=n.itemCount,i=void 0===a?this._getItemCountForPage(e,t):a,o=n.height;return{itemCount:i,height:void 0===o?this._getPageHeight(e,t,i):o,data:n.data,key:n.key}}return{itemCount:i=this._getItemCountForPage(e,t),height:this._getPageHeight(e,t,i)}},t.prototype._getPageHeight=function(e,t,r){if(this.props.getPageHeight)return this.props.getPageHeight(e,t,r);var n=this._cachedPageHeights[e];return n?n.height:this._estimatedPageHeight||30},t.prototype._getItemCountForPage=function(e,t){var r=this.props.getItemCountForPage?this.props.getItemCountForPage(e,t):10;return r||10},t.prototype._createPage=function(e,t,r,n,a,i,o){void 0===r&&(r=-1),void 0===n&&(n=t?t.length:0),void 0===a&&(a={}),e=e||"page-"+r;var s=this._pageCache[e];return s&&s.page?s.page:{key:e,startIndex:r,itemCount:n,items:t,style:a,top:0,height:0,data:i,isSpacer:o||!1}},t.prototype._getRenderCount=function(e){var t=e||this.props,r=t.items,n=t.startIndex,a=t.renderCount;return void 0===a?r?r.length-n:0:a},t.prototype._updateRenderRects=function(e,t){var r=(e=e||this.props).renderedWindowsAhead,a=e.renderedWindowsBehind,i=this.state.pages;if(this._shouldVirtualize(e)){var o=this._surfaceRect||Object(n.a)({},S),s=this._scrollElement&&this._scrollElement.scrollHeight,c=this._scrollElement?this._scrollElement.scrollTop:0;this._surface.current&&(t||!i||!this._surfaceRect||!s||s!==this._scrollHeight||Math.abs(this._scrollTop-c)>this._estimatedPageHeight/3)&&(o=this._surfaceRect=O(this._surface.current),this._scrollTop=c),!t&&s&&s===this._scrollHeight||this._measureVersion++,this._scrollHeight=s;var u=Math.max(0,-o.top),l=Object(f.a)(this._root.current),d={top:u,left:o.left,bottom:u+l.innerHeight,right:o.right,width:o.width,height:l.innerHeight};this._requiredRect=w(d,this._requiredWindowsBehind,this._requiredWindowsAhead),this._allowedRect=w(d,a,r),this._visibleRect=d}},t.defaultProps={startIndex:0,onRenderCell:function(e,t,r){return a.createElement(a.Fragment,null,e&&e.name||"")},renderedWindowsAhead:2,renderedWindowsBehind:2},t}(a.Component);function w(e,t,r){var n=e.top-t*e.height,a=e.height+(t+r)*e.height;return{top:n,bottom:n+a,height:a,left:e.left,right:e.right,width:e.width}}},1389:function(e,t,r){"use strict";r.r(t),r.d(t,"showAuthDialog",(function(){return xp}));var n=r(0),a=r.n(n),i=r(650),o=r(964),s=r.n(o),c=r(668),u=r(746),l=r(125),d=r(3),p=r(706),f=r(23),g=r(32),m=r(645),h=r(1392),b=r(1341),v=r(869),S=r(1399),y=r(92),O=r(680),x=r(1340),j=r(1401),w=r(1404);function E(){var e=_(["\n display: flex;\n align-items: center;\n margin: 0 0 ",";\n padding-bottom: ",";\n border-bottom: 1px solid ",";\n"]);return E=function(){return e},e}function k(){var e=_(["\n display: flex;\n align-items: center;\n"]);return k=function(){return e},e}function C(){var e=_(["\n margin-bottom: ",";\n"]);return C=function(){return e},e}function _(e,t){return t||(t=e.slice(0)),e.raw=t,e}var R=Object(l.c)((function(e){var t=e.script,r=e.isOpen,n=e.acceptConsent,i=e.denyConsent,o=e.hideConsentDialog,s=e.theme;if(!t)return null;var c=[{text:strings.Dialog.ConsentViewAndModifyScopeText,infoLink:"https://aka.ms/script-run-permissions"}],u={text:t?t.storageScript.creatorDisplayName:""};return a.a.createElement(h.a,{hidden:!r,onDismiss:o,dialogContentProps:I(s),modalProps:{isBlocking:!0,styles:Object(y.b)()}},a.a.createElement(P,null,a.a.createElement(T,null,a.a.createElement(S.a,{iconName:"OfficeScriptsSharedIcon32"}),a.a.createElement(x.a,{styles:D(s)},t.storageScript.name)),u.text&&a.a.createElement(N,null,a.a.createElement(x.a,{styles:M(s)},a.a.createElement("div",{dangerouslySetInnerHTML:function(e,t){var r=e.storageScript.creatorEmail?'<a\n style="display: inline-block;\n color: '+t.colors.linkText+';\n text-decoration: none;"\n href=mailto:'+e.storageScript.creatorEmail+"\n target='_blank'\n rel='noopener noreferrer'>"+e.storageScript.creatorDisplayName+"</a>":e.storageScript.creatorDisplayName||"";return{__html:strings.substitute(strings.Dialog.ConsentLastModifiedInformation,{ownerName:r})}}(t,s)}))),a.a.createElement(x.a,{styles:{root:{paddingBottom:s.spacing.medium,fontWeight:s.fontWeights.regular}}},strings.Dialog.ConsentScopesListHeader),a.a.createElement("ul",{style:{marginLeft:s.spacing.mediumPlus}},c.map((function(e,t){return a.a.createElement("li",{key:t},a.a.createElement(x.a,{styles:{root:{display:"inline",fontWeight:s.fontWeights.regular}}},e.text),a.a.createElement(w.a,{iconProps:{iconName:"UnknownSolid"},onClick:function(){return window.open(e.infoLink,"_blank")},styles:{root:{marginLeft:0,cursor:"pointer",color:s.colors.neutralSecondary,verticalAlign:"middle",paddingBottom:"0.1rem"}},ariaLabel:strings.substitute(strings.Dialog.ConsentViewScopeDetailAriaLabel,{scope:e.text})}))}))),a.a.createElement(x.a,{styles:{root:{margin:s.spacing.smallPlus+" 0 "+s.spacing.small,fontWeight:s.fontWeights.regular}}},strings.Dialog.ConsentIfYouAllowExplanation),a.a.createElement(j.a,{href:"https://aka.ms/office-scripting-overview",target:"_blank",styles:A(s)},strings.Dialog.ConsentLearnAboutOfficeScriptingLinkText),"."),a.a.createElement(b.a,null,a.a.createElement(O.a,{"data-testid":"update",text:strings.Dialog.ConsentAllowButtonText,ariaLabel:strings.Dialog.ConsentAllowButtonText,ariaDescription:strings.Dialog.ConsentAllowButtonAriaDescription,onClick:function(){n(t),o()},primary:!0}),a.a.createElement(O.a,{"data-testid":"cancel",text:strings.Dialog.ConsentDenyButtonText,ariaLabel:strings.Dialog.ConsentDenyButtonText,ariaDescription:strings.Dialog.ConsentDenyButtonAriaDescription,onClick:function(){i(t),o()}})))})),P=l.b.div(C(),(function(e){return e.theme.spacing.mediumPlus})),T=l.b.div(k()),I=function(e){return{type:v.a.normal,title:strings.Dialog.ConsentRunPermissionHeader,styles:{title:{fontSize:e.fontSizes.large,fontWeight:e.fontWeights.semibold,color:e.colors.primary}}}},D=function(e){return{root:{fontSize:e.fontSizes.medium,fontWeight:e.fontWeights.semibold,marginLeft:e.spacing.smallPlus,paddingTop:0,overflow:"hidden"}}},A=function(e){return{root:{marginTop:e.spacing.smallPlus,display:"inline-block",color:e.colors.linkText,selectors:{":focus":{color:e.colors.linkText},":hover":{color:e.colors.linkTextHovered,textDecoration:"underline"}}}}},M=function(e){return{root:{color:e.colors.neutralSecondaryLight,fontWeight:e.fontWeights.regular,padding:"0 0 5px 0"}}},N=l.b.div(E(),(function(e){return e.theme.spacing.small}),(function(e){return e.theme.spacing.xSmall}),(function(e){return e.theme.colors.neutralLighter})),L=r(663),B=r(669),F=Object(i.b)((function(e){return{isOpen:B.a.consentDialog.getIsVisible(e),script:B.a.scripts.get(e,B.a.editor.getActiveScriptId(e))}}),(function(e){return{dispatch:e,acceptConsent:function(t){return e(L.a.scripts.acceptConsent.request(t))},denyConsent:function(t){return e(L.a.scripts.denyConsent.request(t))},hideConsentDialog:function(){return e(L.a.consentDialog.hide())}}}))(R),W=r(753),U=r(754),H=r(1408),z=r(629),G=r(2),V=r(1369),K=r(632),q=r(948),J=r(1379),Q=r(249),Z=r(245),Y={root:"ms-Shimmer-container",shimmerWrapper:"ms-Shimmer-shimmerWrapper",shimmerGradient:"ms-Shimmer-shimmerGradient",dataWrapper:"ms-Shimmer-dataWrapper"},X=Object(Q.b)((function(){return Object(V.a)({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(100%)"}})})),$=Object(Q.b)((function(){return Object(V.a)({"100%":{transform:"translateX(-100%)"},"0%":{transform:"translateX(100%)"}})}));var ee,te,re=r(630),ne=r(1363),ae=r(953),ie=r(631),oe=r(1028);!function(e){e[e.line=1]="line",e[e.circle=2]="circle",e[e.gap=3]="gap"}(ee||(ee={})),function(e){e[e.line=16]="line",e[e.gap=16]="gap",e[e.circle=24]="circle"}(te||(te={}));var se=Object(re.a)(),ce={root:"ms-ShimmerLine-root",topLeftCorner:"ms-ShimmerLine-topLeftCorner",topRightCorner:"ms-ShimmerLine-topRightCorner",bottomLeftCorner:"ms-ShimmerLine-bottomLeftCorner",bottomRightCorner:"ms-ShimmerLine-bottomRightCorner"};var ue=Object(z.a)((function(e){var t=e.height,r=e.styles,a=e.width,i=void 0===a?"100%":a,o=e.borderStyle,s=e.theme,c=se(r,{theme:s,height:t,borderStyle:o});return n.createElement("div",{style:{width:i,minWidth:"number"===typeof i?i+"px":"auto"},className:c.root},n.createElement("svg",{width:"2",height:"2",className:c.topLeftCorner},n.createElement("path",{d:"M0 2 A 2 2, 0, 0, 1, 2 0 L 0 0 Z"})),n.createElement("svg",{width:"2",height:"2",className:c.topRightCorner},n.createElement("path",{d:"M0 0 A 2 2, 0, 0, 1, 2 2 L 2 0 Z"})),n.createElement("svg",{width:"2",height:"2",className:c.bottomRightCorner},n.createElement("path",{d:"M2 0 A 2 2, 0, 0, 1, 0 2 L 2 2 Z"})),n.createElement("svg",{width:"2",height:"2",className:c.bottomLeftCorner},n.createElement("path",{d:"M2 2 A 2 2, 0, 0, 1, 0 0 L 0 2 Z"})))}),(function(e){var t,r=e.height,n=e.borderStyle,a=e.theme,i=a.semanticColors,o=Object(K.a)(ce,a),s=n||{},c={position:"absolute",fill:i.bodyBackground};return{root:[o.root,a.fonts.medium,{height:r+"px",boxSizing:"content-box",position:"relative",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:i.bodyBackground,borderWidth:0,selectors:(t={},t[q.a]={borderColor:"Window",selectors:{"> *":{fill:"Window"}}},t)},s],topLeftCorner:[o.topLeftCorner,{top:"0",left:"0"},c],topRightCorner:[o.topRightCorner,{top:"0",right:"0"},c],bottomRightCorner:[o.bottomRightCorner,{bottom:"0",right:"0"},c],bottomLeftCorner:[o.bottomLeftCorner,{bottom:"0",left:"0"},c]}}),void 0,{scope:"ShimmerLine"}),le=Object(re.a)(),de={root:"ms-ShimmerGap-root"};var pe=Object(z.a)((function(e){var t=e.height,r=e.styles,a=e.width,i=void 0===a?"10px":a,o=e.borderStyle,s=e.theme,c=le(r,{theme:s,height:t,borderStyle:o});return n.createElement("div",{style:{width:i,minWidth:"number"===typeof i?i+"px":"auto"},className:c.root})}),(function(e){var t,r=e.height,n=e.borderStyle,a=e.theme,i=a.semanticColors,o=n||{};return{root:[Object(K.a)(de,a).root,a.fonts.medium,{backgroundColor:i.bodyBackground,height:r+"px",boxSizing:"content-box",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:i.bodyBackground,selectors:(t={},t[q.a]={backgroundColor:"Window",borderColor:"Window"},t)},o]}}),void 0,{scope:"ShimmerGap"}),fe={root:"ms-ShimmerCircle-root",svg:"ms-ShimmerCircle-svg"};var ge=Object(re.a)(),me=Object(z.a)((function(e){var t=e.height,r=e.styles,a=e.borderStyle,i=e.theme,o=ge(r,{theme:i,height:t,borderStyle:a});return n.createElement("div",{className:o.root},n.createElement("svg",{viewBox:"0 0 10 10",width:t,height:t,className:o.svg},n.createElement("path",{d:"M0,0 L10,0 L10,10 L0,10 L0,0 Z M0,5 C0,7.76142375 2.23857625,10 5,10 C7.76142375,10 10,7.76142375 10,5 C10,2.23857625 7.76142375,2.22044605e-16 5,0 C2.23857625,-2.22044605e-16 0,2.23857625 0,5 L0,5 Z"})))}),(function(e){var t,r,n=e.height,a=e.borderStyle,i=e.theme,o=i.semanticColors,s=Object(K.a)(fe,i),c=a||{};return{root:[s.root,i.fonts.medium,{width:n+"px",height:n+"px",minWidth:n+"px",boxSizing:"content-box",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:o.bodyBackground,selectors:(t={},t[q.a]={borderColor:"Window"},t)},c],svg:[s.svg,{display:"block",fill:o.bodyBackground,selectors:(r={},r[q.a]={fill:"Window"},r)}]}}),void 0,{scope:"ShimmerCircle"}),he=Object(re.a)();var be=Object(Q.b)((function(e,t,r,n,a){var i,o=a&&r?a-r:0;if(e&&"center"!==e?e&&"top"===e?i={borderBottomWidth:o+"px",borderTopWidth:"0px"}:e&&"bottom"===e&&(i={borderBottomWidth:"0px",borderTopWidth:o+"px"}):i={borderBottomWidth:(o?Math.floor(o/2):0)+"px",borderTopWidth:(o?Math.ceil(o/2):0)+"px"},n)switch(t){case ee.circle:return{root:Object(G.a)(Object(G.a)({},i),{borderColor:n}),svg:{fill:n}};case ee.gap:return{root:Object(G.a)(Object(G.a)({},i),{borderColor:n,backgroundColor:n})};case ee.line:return{root:Object(G.a)(Object(G.a)({},i),{borderColor:n}),topLeftCorner:{fill:n},topRightCorner:{fill:n},bottomLeftCorner:{fill:n},bottomRightCorner:{fill:n}}}return{root:i}}));var ve={root:"ms-ShimmerElementsGroup-root"};var Se=Object(z.a)((function(e){var t=e.styles,r=e.width,a=void 0===r?"auto":r,i=e.shimmerElements,o=e.rowHeight,s=void 0===o?function(e){return e.map((function(e){switch(e.type){case ee.circle:e.height||(e.height=te.circle);case ee.line:e.height||(e.height=te.line);case ee.gap:e.height||(e.height=te.gap)}return e})).reduce((function(e,t){return t.height&&t.height>e?t.height:e}),0)}(i||[]):o,c=e.flexWrap,u=void 0!==c&&c,l=e.theme,d=e.backgroundColor,p=he(t,{theme:l,flexWrap:u});return n.createElement("div",{style:{width:a},className:p.root},function(e,t,r){return e?e.map((function(e,a){var i=e.type,o=Object(G.d)(e,["type"]),s=o.verticalAlign,c=o.height,u=be(s,i,c,t,r);switch(e.type){case ee.circle:return n.createElement(me,Object(G.a)({key:a},o,{styles:u}));case ee.gap:return n.createElement(pe,Object(G.a)({key:a},o,{styles:u}));case ee.line:return n.createElement(ue,Object(G.a)({key:a},o,{styles:u}))}})):n.createElement(ue,{height:te.line})}(i,d,s))}),(function(e){var t=e.flexWrap,r=e.theme;return{root:[Object(K.a)(ve,r).root,r.fonts.medium,{display:"flex",alignItems:"center",flexWrap:t?"wrap":"nowrap",position:"relative"}]}}),void 0,{scope:"ShimmerElementsGroup"}),ye=Object(re.a)(),Oe=function(e){function t(t){var r=e.call(this,t)||this;return Object(ne.a)(r),r.state={contentLoaded:t.isDataLoaded},r._async=new ae.a(r),r}return Object(G.c)(t,e),t.prototype.componentDidUpdate=function(e){var t=this,r=this.props.isDataLoaded;r!==e.isDataLoaded&&(this._async.clearTimeout(this._lastTimeoutId),r?this._lastTimeoutId=this._async.setTimeout((function(){t.setState({contentLoaded:r})}),200):this.setState({contentLoaded:r}))},t.prototype.componentWillUnmount=function(){this._async.dispose()},t.prototype.render=function(){var e=this.props,t=e.styles,r=e.shimmerElements,a=e.children,i=e.isDataLoaded,o=e.width,s=e.className,c=e.customElementsGroup,u=e.theme,l=e.ariaLabel,d=e.shimmerColors,p=this.state.contentLoaded;this._classNames=ye(t,{theme:u,isDataLoaded:i,className:s,transitionAnimationInterval:200,shimmerColor:d&&d.shimmer,shimmerWaveColor:d&&d.shimmerWave});var f=Object(ie.d)(this.props,ie.c);return n.createElement("div",Object(G.a)({},f,{className:this._classNames.root}),!p&&n.createElement("div",{style:{width:o||"100%"},className:this._classNames.shimmerWrapper},n.createElement("div",{className:this._classNames.shimmerGradient}),c||n.createElement(Se,{shimmerElements:r,backgroundColor:d&&d.background})),a&&n.createElement("div",{className:this._classNames.dataWrapper},a),l&&!i&&n.createElement("div",{role:"status","aria-live":"polite"},n.createElement(oe.a,null,n.createElement("div",{className:this._classNames.screenReaderText},l))))},t.defaultProps={isDataLoaded:!1},t}(n.Component),xe=Object(z.a)(Oe,(function(e){var t,r=e.isDataLoaded,n=e.className,a=e.theme,i=e.transitionAnimationInterval,o=e.shimmerColor,s=e.shimmerWaveColor,c=a.semanticColors,u=Object(K.a)(Y,a),l=Object(Z.a)(a);return{root:[u.root,a.fonts.medium,{position:"relative",height:"auto"},n],shimmerWrapper:[u.shimmerWrapper,{position:"relative",overflow:"hidden",transform:"translateZ(0)",backgroundColor:o||c.disabledBackground,transition:"opacity "+i+"ms",selectors:Object(G.a)((t={"> *":{transform:"translateZ(0)"}},t[q.a]={background:"WindowText\n linear-gradient(\n to right,\n transparent 0%,\n Window 50%,\n transparent 100%)\n 0 0 / 90% 100%\n no-repeat"},t),Object(q.l)())},r&&{opacity:"0",position:"absolute",top:"0",bottom:"0",left:"0",right:"0"}],shimmerGradient:[u.shimmerGradient,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:(o||c.disabledBackground)+"\n linear-gradient(\n to right,\n "+(o||c.disabledBackground)+" 0%,\n "+(s||c.bodyDivider)+" 50%,\n "+(o||c.disabledBackground)+" 100%)\n 0 0 / 90% 100%\n no-repeat",transform:"translateX(-100%)",animationDuration:"2s",animationTimingFunction:"ease-in-out",animationDirection:"normal",animationIterationCount:"infinite",animationName:l?$():X()}],dataWrapper:[u.dataWrapper,{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",opacity:"0",background:"none",backgroundColor:"transparent",border:"none",transition:"opacity "+i+"ms"},r&&{opacity:"1",position:"static"}],screenReaderText:J.a}}),void 0,{scope:"Shimmer"});function je(){var e=function(e,t){t||(t=e.slice(0));return e.raw=t,e}(["\n padding: 0.6rem ",";\n margin-bottom: ",";\n display: flex;\n align-items: center;\n"]);return je=function(){return e},e}var we=Object(l.c)((function(e){return a.a.createElement(Ee,null,a.a.createElement(xe,{key:e.key,shimmerColors:ke(e.alpha,e.theme),shimmerElements:[{type:ee.line,height:32,width:32},{type:ee.gap,width:16},{type:ee.line,height:32,width:e.titleLength}]}))})),Ee=l.b.div(je(),(function(e){return e.theme.spacing.small}),(function(e){return e.theme.spacing.xSmall})),ke=function(e,t){return void 0===e&&(e=1),{shimmer:"rgba(225,223,221,"+e+")",shimmerWave:"rgba(210,208,206,"+e+")",background:t.colors.neutralLight}},Ce=[142,156,110,134,157,101,147,152,108,114,121,122,153,125,140,156,155,142,151,100,157,127,110,135,121,151,145,156,144,130];function _e(){var e=function(e,t){t||(t=e.slice(0));return e.raw=t,e}(["\n height: 100%;\n overflow-y: hidden;\n"]);return _e=function(){return e},e}var Re=function(){return a.a.createElement(Pe,null,Ce.map((function(e,t){return a.a.createElement(we,{key:t,alpha:1-t/Ce.length,titleLength:e})})))},Pe=l.b.div(_e()),Te=r(1394),Ie=r(1029),De=r(674),Ae=r(716),Me=function(e,t,r){return!!e&&!r&&!t},Ne=r(670),Le=r(656),Be=function(e,t,r,n){return void 0===n&&(n=!1),!!e&&(n||Object(Ne.a)(e))&&Object(Le.a)(e)&&!r&&!t},Fe=r(951),We=r(958),Ue=r(1403),He=r(952),ze=r(843),Ge=Object(re.a)(),Ve=function(e){function t(t){var r=e.call(this,t)||this;return r._focusZone=n.createRef(),r._persistedKeytips={},r._keytipManager=ze.a.getInstance(),r._divContainer=n.createRef(),r._onRenderItems=function(e){return e.map((function(e,t){return n.createElement("div",{key:e.key,className:r._classNames.item},r.props.onRenderItem(e))}))},r._onRenderOverflowButtonWrapper=function(e){var t={className:r._classNames.overflowButton},a=r.props.keytipSequences,i=[];return a?e.forEach((function(e){var t=e.keytipProps;if(t){var n={content:t.content,keySequences:t.keySequences,disabled:t.disabled||!(!e.disabled&&!e.isDisabled),hasDynamicChildren:t.hasDynamicChildren,hasMenu:t.hasMenu};t.hasDynamicChildren||r._getSubMenuForItem(e)?n.onExecute=r._keytipManager.menuExecute.bind(r._keytipManager,a,e.keytipProps.keySequences):n.onExecute=t.onExecute,r._persistedKeytips[n.content]=n;var o=Object(G.a)(Object(G.a)({},e),{keytipProps:Object(G.a)(Object(G.a)({},t),{overflowSetSequence:a})});i.push(o)}else i.push(e)})):i=e,n.createElement("div",Object(G.a)({},t),r.props.onRenderOverflowButton(i))},Object(ne.a)(r),Object(We.a)("OverflowSet",t,{doNotContainWithinFocusZone:"focusZoneProps"}),r}return Object(G.c)(t,e),t.prototype.render=function(){var e,t,r=this.props,a=r.items,i=r.overflowItems,o=r.className,s=r.focusZoneProps,c=r.styles,u=r.vertical,l=r.doNotContainWithinFocusZone,d=r.role,p=r.overflowSide,f=void 0===p?"end":p;this._classNames=Ge(c,{className:o,vertical:u}),l?(e="div",t=Object(G.a)(Object(G.a)({},Object(ie.d)(this.props,ie.c)),{ref:this._divContainer})):(e=H.a,t=Object(G.a)(Object(G.a)(Object(G.a)({},Object(ie.d)(this.props,ie.c)),s),{componentRef:this._focusZone,direction:u?Fe.a.vertical:Fe.a.horizontal}));var g=i&&i.length>0;return n.createElement(e,Object(G.a)({role:d||"group","aria-orientation":"menubar"===d?!0===u?"vertical":"horizontal":void 0},t,{className:this._classNames.root}),"start"===f&&g&&this._onRenderOverflowButtonWrapper(i),a&&this._onRenderItems(a),"end"===f&&g&&this._onRenderOverflowButtonWrapper(i))},t.prototype.focus=function(e){var t=!1;return this.props.doNotContainWithinFocusZone?this._divContainer.current&&(t=Object(Ue.c)(this._divContainer.current)):this._focusZone.current&&(t=this._focusZone.current.focus(e)),t},t.prototype.focusElement=function(e){var t=!1;return!!e&&(this.props.doNotContainWithinFocusZone?this._divContainer.current&&Object(He.a)(this._divContainer.current,e)&&(e.focus(),t=document.activeElement===e):this._focusZone.current&&(t=this._focusZone.current.focusElement(e)),t)},t.prototype.componentDidMount=function(){this._registerPersistedKeytips()},t.prototype.componentWillUnmount=function(){this._unregisterPersistedKeytips()},t.prototype.UNSAFE_componentWillUpdate=function(){this._unregisterPersistedKeytips()},t.prototype.componentDidUpdate=function(){this._registerPersistedKeytips()},t.prototype._registerPersistedKeytips=function(){var e=this;Object.keys(this._persistedKeytips).forEach((function(t){var r=e._persistedKeytips[t],n=e._keytipManager.register(r,!0);e._persistedKeytips[n]=r,delete e._persistedKeytips[t]}))},t.prototype._unregisterPersistedKeytips=function(){var e=this;Object.keys(this._persistedKeytips).forEach((function(t){e._keytipManager.unregister(e._persistedKeytips[t],t,!0)})),this._persistedKeytips={}},t.prototype._getSubMenuForItem=function(e){return this.props.itemSubMenuProvider?this.props.itemSubMenuProvider(e):e.subMenuProps?e.subMenuProps.items:void 0},t}(n.Component),Ke={flexShrink:0,display:"inherit"},qe=Object(z.a)(Ve,(function(e){var t=e.className;return{root:["ms-OverflowSet",{position:"relative",display:"flex",flexWrap:"nowrap"},e.vertical&&{flexDirection:"column"},t],item:["ms-OverflowSet-item",Ke],overflowButton:["ms-OverflowSet-overflowButton",Ke]}}),void 0,{scope:"OverflowSet"}),Je=r(1405);function Qe(){return(Qe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Ze=function(e,t){return{root:{height:"100%",padding:"0 "+e.spacing.xSmall,backgroundColor:"transparent",fontSize:e.fontSizes.small,selectors:{".ms-Button-menuIcon":{fontSize:e.fontSizes.icon},".ms-Icon":{marginTop:".1rem",opacity:t?.5:1}}},rootHovered:{backgroundColor:e.colors.neutralQuaternary},rootPressed:{backgroundColor:e.colors.neutralTertiaryAlt}}},Ye=Object(l.c)((function(e){var t=e.buttonProps,r=e.testId,i=e.theme,o=e.additionalStyles,s=e.tooltipText,c=e.dismissTooltipOnFirstShow,u=e.isMenuOpened,l=e.setIsMenuOpened,d=void 0!==r&&void 0!==s,p=Object(n.useRef)(null),f=Object(n.useState)(!d||c?"":s),g=f[0],m=f[1];return a.a.createElement(Te.a,{content:g,id:r+"-tooltip",componentRef:p},a.a.createElement(Je.a,Qe({"data-testid":r,styles:Qe({},Ze(i,!!t.disabled),o)},t,{"aria-describedby":d?r+"-tooltip":void 0,onMouseEnter:function(e){c&&!g&&(m(s||""),p.current&&p.current.show())},onMenuClick:function(){l&&l(!u)},onAfterMenuDismiss:function(){l&&l(!1)},onKeyDown:function(e){"ArrowDown"===e.key&&e.altKey&&l&&!u&&l(!0)}})))}));function Xe(){return(Xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var $e={root:{height:"100%",selectors:{":focus":{outline:0}}}},et=function(e){return e.onRender?e.onRender(e):a.a.createElement(Ye,{buttonProps:e,additionalStyles:e.additionalStyles,tooltipText:e.tooltipText,dismissTooltipOnFirstShow:e.dismissTooltipOnFirstShow,testId:e.key})},tt=function(e){var t=0===e.length,r=null==e?void 0:e.pop();return a.a.createElement(Ye,{testId:Object(m.a)("ScriptItemOverflowButton"),buttonProps:{ariaLabel:strings.Editor.MoreAriaLabel,menuIconProps:{iconName:"VerticalMore"},menuProps:{items:e.map((function(e){return Xe({},e,{"data-testid":e.key})})),isBeakVisible:!1}},tooltipText:strings.Editor.OverflowMenuTooltipText,additionalStyles:t?{root:{display:"none"}}:{},isMenuOpened:r.isMenuOpened,setIsMenuOpened:r.setIsMenuOpened})},rt=Object(l.c)((function(e){var t=e.primaryCommands,r=e.overflowCommands;return a.a.createElement(qe,{items:t,overflowItems:r,onRenderOverflowButton:tt,onRenderItem:et,styles:$e})})),nt=function(e){return!!e&&!!e.localUpdates.shareId},at=Object(l.c)((function(e){var t=e.theme,r=e.scriptHasUnsavedChanges,n=e.rootFolder,i=e.isPointerCursor;return a.a.createElement(a.a.Fragment,null,r?a.a.createElement(x.a,{styles:gt(t,i,r),"aria-hidden":"true"},strings.Backstage.ScriptItemUnsavedChangesText):a.a.createElement(it,null,a.a.createElement(x.a,{styles:gt(t,i,r),"aria-hidden":"true"},n),a.a.createElement(S.a,{iconName:"ChevronRight8",styles:ot(t),"aria-hidden":"true"}),a.a.createElement(x.a,{styles:gt(t,i,r),"aria-hidden":"true"},"..."),a.a.createElement(S.a,{iconName:"ChevronRight8",styles:ot(t),"aria-hidden":"true"}),a.a.createElement(x.a,{styles:gt(t,i,r),"aria-hidden":"true"},"OfficeScripts")))})),it=l.b.div.withConfig({displayName:"FolderPath__FlexWrapper",componentId:"sc-1v3v844-0"})(["display:flex;"]),ot=function(e){return{root:{padding:e.spacing.xSmall,fontSize:"0.8rem"}}},st=r(679);function ct(){return(ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var ut=Object(i.b)((function(e){return{isScriptRunning:Ae.b.run.getIsRunning(e)}}),{showDialog:Ae.a.dialog.show,copyScript:Ae.a.editor.makeACopyOfScript})(Object(l.c)((function(e){var t=Object(n.useState)(!1),r=t[0],i=t[1],o=Object(n.useState)(!1),s=o[0],c=o[1],u=Object(n.useState)(!1),l=u[0],d=u[1],p=nt(e.script),f=Object(Le.a)(e.script),g=Object(st.a)(e.script),h=p&&!f?strings.substitute(strings.Backstage.ScriptItemUserOwnedOneDriveRootFolderText,{creator:e.script.storageScript.creatorDisplayName}):g?strings.Backstage.ScriptItemSamplesRootFolderText:strings.Backstage.ScriptItemMyFilesRootFolderText,b={marginTop:".2rem"},v={marginTop:".2rem",opacity:"50%"},y=Object(De.a)(e.script),O=Me(e.script,e.isScriptRunning,e.isAnyStorageCallInProgress),j=Be(e.script,e.isScriptRunning,e.isAnyStorageCallInProgress,!0),w=!!e.script,E=e.script.localUpdates.shareId?"OfficeScriptsSharedIcon32":"OfficeScriptsIcon32",k=s||r;return Object(n.useEffect)((function(){k||d(!1)}),[k]),a.a.createElement(lt,{isMenuOpened:l,"data-is-focusable":"true",onClick:function(){e.openScript(e.script,"Details")},"data-testid":"testId-scriptItem_"+e.script.storageScript.id,"aria-label":Object(De.a)(e.script)?strings.substitute(strings.Backstage.UnsavedScriptAriaLabel,{name:e.script.storageScript.name}):e.script.storageScript.name,role:"button",onFocus:function(e){i(!0)},onBlur:function(e){i(!1)},onMouseEnter:function(e){c(!0)},onMouseLeave:function(e){c(!1)}},a.a.createElement(dt,null,a.a.createElement(S.a,{iconName:E,styles:bt(e.theme),"aria-hidden":"true"}),a.a.createElement(pt,null,a.a.createElement(x.a,{styles:ft(e.theme),"aria-hidden":"true"},e.script.storageScript.name),a.a.createElement(at,{scriptHasUnsavedChanges:y,rootFolder:h,isPointerCursor:!0}))),a.a.createElement(rt,{primaryCommands:[{key:Object(m.a)("BackstageScriptEditButton")+"_"+e.script.storageScript.id,iconProps:{iconName:"EditGeneric16"},onClick:function(t){t.stopPropagation(),e.setNavigationSourcePage("BackStage"),e.openScript(e.script,"Editor")},tooltipText:strings.Backstage.EditScriptButtonTooltip,additionalStyles:!k&&{root:{display:"none"}}}],overflowCommands:k?[{key:Object(m.a)("BackstageOverflowCopyButton"),iconProps:{iconName:"CopyIcon",style:O?b:v},onClick:function(){e.copyScript({scriptId:e.script.storageScript.id,originalPage:"Backstage"})},disabled:!O,text:strings.Editor.MakeCopyButtonText},{key:Object(m.a)("BackstageOverflowDetailsButton"),text:strings.Editor.DetailsButtonText,ariaLabel:strings.Editor.DetailsButtonText,disabled:!w,onClick:function(){e.openScript(e.script,"Details")}},{key:Object(m.a)("BackstageOverflowDeleteButton"),iconProps:{iconName:"AfterDeleteIcon",style:j?b:v},onClick:function(){e.showDialog({title:strings.Dialog.ConfirmDeleteDialogLabel,subText:strings.Dialog.DeleteWarningText,buttons:[{key:Object(m.a)("DeleteDialogDeleteButton"),text:strings.Dialog.DeleteButtonText,action:Ae.a.scripts.remove.request(e.script),isPrimary:!0},{key:Object(m.a)("DeleteDialogCancelButton"),text:strings.General.CancelButtonText,action:Ae.a.dialog.dismiss(),isPrimary:!1}]})},disabled:!j,text:strings.Details.DeleteScriptButtonText},{key:"Overflow extra properties carrier",isMenuOpened:l,setIsMenuOpened:d}]:[]}))}))),lt=l.b.div.withConfig({displayName:"ScriptItemDetailView__ScriptItemWrapper",componentId:"d79rhv-0"})(["padding:",";display:inline-flex;align-items:center;justify-content:space-between;cursor:pointer;min-width:100%;max-width:101%;background:",";&:hover{background:",";}&:focus{background:",";outline:none;}"],(function(e){return e.theme.spacing.xSmall}),(function(e){return e.isMenuOpened&&e.theme.colors.neutralQuaternaryAlt}),(function(e){return e.theme.colors.neutralQuaternaryAlt}),(function(e){return e.theme.colors.neutralTertiaryAlt})),dt=l.b.div.withConfig({displayName:"ScriptItemDetailView__PullLeftWrapper",componentId:"d79rhv-1"})(["display:inline-flex;align-items:center;"]),pt=l.b.div.withConfig({displayName:"ScriptItemDetailView__ItemBodyWrapper",componentId:"d79rhv-2"})(["padding-left:",";"],(function(e){return e.theme.spacing.smallPlus})),ft=function(e){return{root:[ct({},ht,{fontSize:e.fontSizes.medium,fontWeight:e.fontWeights.regular,color:e.colors.neutralDark,paddingBottom:0,selectors:{":hover":{textDecoration:"underline"}}})]}},gt=function(e,t,r){return t?{root:[ct({},ht,{paddingTop:0,fontWeight:r?e.fontWeights.bold:e.fontWeights.regular,fontSize:e.fontSizes.small,color:e.colors.neutralSecondary})]}:{root:[ct({},mt,{paddingTop:0,fontWeight:r?e.fontWeights.bold:e.fontWeights.regular,fontSize:e.fontSizes.small,color:e.colors.neutralSecondary})]}},mt={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",selectors:{"@media screen and (-ms-high-contrast: active)":{selectors:{":focus":{backgroundColor:"highlight",color:"highlighttext",MsHighContrastAdjust:"none"}}}}},ht=ct({},mt,{cursor:"pointer"}),bt=function(e){return{root:{padding:e.spacing.xSmall,fontSize:e.fontSizes.icon,marginTop:".6rem"}}},vt=r(20);function St(){return(St=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var yt=function(e){var t=e.items,r=e.openScript,i=e.setNavigationSourcePage,o=e.isAnyStorageCallInProgress,s=e.shouldShowShimmer,c=void 0!==s&&s,u=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,["items","openScript","setNavigationSourcePage","isAnyStorageCallInProgress","shouldShowShimmer"]);Object(n.useEffect)((function(){window.document.title=strings.PageTitles.ScriptsList}));var l=Object(n.useMemo)((function(){return t}),[t]);return c?a.a.createElement(Re,null):a.a.createElement(Ot,null,a.a.createElement(H.a,St({shouldEnterInnerZone:xt,isCircularNavigation:!0},u),l.map((function(e){return a.a.createElement(Te.a,{key:"script_item_"+e.storageScript.id,content:e.storageScript.name,overflowMode:Ie.a.Self,styles:{root:{minWidth:"100%",maxWidth:"100%",display:"inline-flex"}}},a.a.createElement(ut,{script:e,openScript:r,setNavigationSourcePage:i,isAnyStorageCallInProgress:o}))}))))},Ot=l.b.div.withConfig({displayName:"ScriptList__ScriptListWrapper",componentId:"sc-1n5g9n9-0"})(["overflow-y:auto;overflow-x:hidden;"]),xt=function(e){return e.which===Object(Z.b)(vt.a.right)},jt=r(728);function wt(){var e=kt(["\n flex-grow: 1;\n height: 3.2rem;\n"]);return wt=function(){return e},e}function Et(){var e=kt(["\n display: flex;\n height: 3.2rem;\n"]);return Et=function(){return e},e}function kt(e,t){return t||(t=e.slice(0)),e.raw=t,e}function Ct(){return(Ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var _t={root:{selectors:{":focus":{outline:0}}}},Rt=function(e){return e.onRender?e.onRender(e):a.a.createElement(jt.a,{buttonProps:e,additionalStyles:e.additionalStyles,tooltipText:e.tooltipText,dismissTooltipOnFirstShow:e.dismissTooltipOnFirstShow,testId:e.key})},Pt=function(e){return a.a.createElement(jt.a,{testId:Object(m.a)("MainHeaderOverflowButton"),buttonProps:{ariaLabel:strings.Editor.MoreAriaLabel,menuIconProps:{iconName:"OverflowIcon"},menuProps:{items:e.map((function(e){return Ct({},e,{"data-testid":e.key})})),isBeakVisible:!1}},tooltipText:strings.Editor.OverflowMenuTooltipText})},Tt=function(e){var t=null==e?void 0:e.pop();return a.a.createElement(jt.a,{testId:Object(m.a)("MainHeaderOverflowButton"),buttonProps:{ariaLabel:strings.Editor.MoreAriaLabel,menuIconProps:{iconName:"OverflowIcon"},menuProps:{items:e.map((function(e){return Ct({},e,{"data-testid":e.key})})),isBeakVisible:!1},componentRef:t.overflowButtonRef},tooltipText:strings.Editor.OverflowMenuTooltipText,additionalStyles:t.additionalStyles,isMenuOpened:t.isMenuOpened,setIsMenuOpened:t.setIsMenuOpened})},It=l.b.div(Et()),Dt=l.b.div(wt()),At=Object(l.c)((function(e){var t=e.primaryCommands,r=e.overflowCommands,n=e.disabled;return a.a.createElement(It,null,a.a.createElement(Dt,null,a.a.createElement(qe,{items:t.map((function(e){return Ct({disabled:n},e)})),onRenderOverflowButton:function(){return null},onRenderItem:Rt,styles:_t})),a.a.createElement(qe,{overflowItems:r,onRenderOverflowButton:e.isDetailsPage?Tt:Pt,onRenderItem:function(){return null},styles:_t}))})),Mt=r(168);function Nt(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function Lt(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){Nt(i,n,a,o,s,"next",e)}function s(e){Nt(i,n,a,o,s,"throw",e)}o(void 0)}))}}function Bt(e){return Ft.apply(this,arguments)}function Ft(){return(Ft=Lt(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var n=document.getElementsByTagName("script"),a=n[n.length-1],i=document.createElement("script");i.setAttribute("src",t),i.onload=function(){return e()},i.onerror=function(e,n,a,i,o){return r(o||new Error("failed to load "+t))},a.parentNode.insertBefore(i,a.nextSibling)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Wt=r(783),Ut=r.n(Wt),Ht=r(1342),zt=r(247),Gt={"monaco-editor-latest":"0.20.0","monaco-editor-ie11":"0.18.1","office-ui-fabric-core":"10.0.0"},Vt=function(){var e={};for(var t in Gt)e[t]=Gt[t].replace(/\./g,"-");return e}();var Kt=r(57),qt=function(){return!("undefined"===typeof window||!window.navigator||!window.navigator.userAgent)&&window.navigator.userAgent.indexOf("rv:11.0")>-1};function Jt(){var e=qt()?"monaco-editor-ie11":"monaco-editor-latest";return"external/monaco-editor-"+Vt[e]+"/"+(Kt.a?"dev":"min")+"/vs"}function Qt(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function Zt(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){Qt(i,n,a,o,s,"next",e)}function s(e){Qt(i,n,a,o,s,"throw",e)}o(void 0)}))}}function Yt(e){return Xt.apply(this,arguments)}function Xt(){return(Xt=Zt(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.require){e.next=2;break}throw new Error("window.require is not defined");case 2:return e.abrupt("return",new Promise((function(e){return window.require(t,(function(){return e()}))})));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $t,er=r(41),tr=r(755);!function(e){e.batch="batch",e.synchronous="synchronous"}($t||($t={}));var rr=r(665);function nr(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function ar(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){nr(i,n,a,o,s,"next",e)}function s(e){nr(i,n,a,o,s,"throw",e)}o(void 0)}))}}function ir(){return or.apply(this,arguments)}function or(){return(or=ar(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(rr.a)("office.script.synchronous.intellisense.batch",(function(){return Promise.all([r.e(24),r.e(15)]).then(r.bind(null,1383))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sr(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function cr(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){sr(i,n,a,o,s,"next",e)}function s(e){sr(i,n,a,o,s,"throw",e)}o(void 0)}))}}function ur(){return lr.apply(this,arguments)}function lr(){return(lr=cr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(rr.a)("office.script.synchronous.intellisense.synchronous",(function(){return Promise.all([r.e(6),r.e(16)]).then(r.bind(null,1384))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dr(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function pr(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){dr(i,n,a,o,s,"next",e)}function s(e){dr(i,n,a,o,s,"throw",e)}o(void 0)}))}}function fr(){return gr.apply(this,arguments)}function gr(){return(gr=pr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(rr.a)("office.script.synchronous.intellisense.types",(function(){return Promise.all([r.e(7),r.e(17)]).then(r.bind(null,1385))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mr(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function hr(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){mr(i,n,a,o,s,"next",e)}function s(e){mr(i,n,a,o,s,"throw",e)}o(void 0)}))}}function br(e){return vr.apply(this,arguments)}function vr(){return(vr=hr(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next=e.t0===$t.synchronous?3:e.t0===$t.batch?4:5;break;case 3:return e.abrupt("return",Promise.all([Or(),Sr()]));case 4:return e.abrupt("return",Promise.all([jr(),Sr()]));case 5:throw"Unknown Office Script Variant "+t;case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sr(){return yr.apply(this,arguments)}function yr(){return(yr=hr(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fr();case 2:return t=e.sent,r=t.officeScriptIntellisenseTypes,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Or(){return xr.apply(this,arguments)}function xr(){return(xr=hr(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ur();case 2:return t=e.sent,r=t.officeScriptIntellisenseSynchronous,e.next=6,Object(tr.a)();case 6:return n=e.sent,e.abrupt("return",n.intellisenseOverride||r);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jr(){return wr.apply(this,arguments)}function wr(){return(wr=hr(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ir();case 2:return t=e.sent,r=t.officeScriptIntellisenseBatch,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Er(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function kr(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){Er(i,n,a,o,s,"next",e)}function s(e){Er(i,n,a,o,s,"throw",e)}o(void 0)}))}}function Cr(e){return _r.apply(this,arguments)}function _r(){return(_r=kr(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=[],e.prev=1,e.next=4,br(t);case 4:r=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),Object(d.g)(new Error("Failed to load intellisense in Monaco: "+Object(er.a)(e.t0)),"Unexpected",d.a.Warning,"Monaco");case 10:return e.abrupt("return",r);case 11:case"end":return e.stop()}}),e,null,[[1,7]])})))).apply(this,arguments)}var Rr,Pr=r(235),Tr=r(170);function Ir(e){return Object(Tr.a)(e)?$t.synchronous:$t.batch}function Dr(e){return"office-scripts-"+e}!function(e){e.FunctionArgument="MarkFunctionArgumentError",e.SyncAPI="MarkLinter"}(Rr||(Rr={}));var Ar=function(e,t){return!!e&&Object(Ne.a)(e)&&Object(Le.a)(e)&&!t&&Object(De.a)(e)};function Mr(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function Nr(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){Mr(i,n,a,o,s,"next",e)}function s(e){Mr(i,n,a,o,s,"throw",e)}o(void 0)}))}}function Lr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Br=function(e){var t,r;function n(){for(var t,r,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return t=r=e.call.apply(e,[this].concat(a))||this,Object.defineProperty(Lr(r),"editor",{configurable:!0,enumerable:!0,writable:!0,value:void 0}),Object.defineProperty(Lr(r),"container",{configurable:!0,enumerable:!0,writable:!0,value:null}),Object.defineProperty(Lr(r),"isKeyboardListenerAlreadyAttached",{configurable:!0,enumerable:!0,writable:!0,value:!1}),Object.defineProperty(Lr(r),"isUndoInProgress",{configurable:!0,enumerable:!0,writable:!0,value:!1}),Object.defineProperty(Lr(r),"undoCount",{configurable:!0,enumerable:!0,writable:!0,value:0}),Object.defineProperty(Lr(r),"isRedoInProgress",{configurable:!0,enumerable:!0,writable:!0,value:!1}),Object.defineProperty(Lr(r),"redoCount",{configurable:!0,enumerable:!0,writable:!0,value:0}),Object.defineProperty(Lr(r),"debounceTime",{configurable:!0,enumerable:!0,writable:!0,value:100}),Object.defineProperty(Lr(r),"language",{configurable:!0,enumerable:!0,writable:!0,value:"typescript"}),Object.defineProperty(Lr(r),"isTabFocusModeOnIE11",{configurable:!0,enumerable:!0,writable:!0,value:!1}),Object.defineProperty(Lr(r),"setMonacoContainerRef",{configurable:!0,enumerable:!0,writable:!0,value:function(e){r.container=e}}),Object.defineProperty(Lr(r),"onValueChange",{configurable:!0,enumerable:!0,writable:!0,value:Ut()((function(e){var t=e.getModel();t&&r.props.script&&r.props.onValueChange({id:r.props.script.storageScript.id,updatedBody:t.getValue()})}),r.debounceTime)}),Object.defineProperty(Lr(r),"onKeyDown",{configurable:!0,enumerable:!0,writable:!0,value:function(e){Object(Pr.c)(e)&&(r.isUndoInProgress=!0),Object(Pr.a)(e)&&(r.isRedoInProgress=!0)}}),Object.defineProperty(Lr(r),"onKeyDownIE11",{configurable:!0,enumerable:!0,writable:!0,value:function(e){r.onKeyDown(e),r.isTabFocusModeOnIE11||e.keyCode===vt.a.tab&&"textarea"===e.target.type&&"inputarea"===e.target.className&&e.stopPropagation()}}),t||Lr(r)}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i=n.prototype;return i.initializeMonacoIfReady=function(){this.container&&this.initializeMonaco(this.container)},i.componentDidMount=function(){var e=Nr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:void 0!==window.monaco&&this.initializeMonacoIfReady();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),i.componentDidUpdate=function(e){if(void 0===this.editor)this.props.isReactMonacoLoaded&&this.initializeMonacoIfReady();else{var t=this.props.script.storageScript.id,r=e.script.storageScript.id,n=this.props.script.localUpdates.body,a=e.script.localUpdates.body,i=Ir(this.props.script),o=Ir(e.script),s=void 0!==n&&null!==n,c=void 0!==a&&null!==a;if(!s)return;if(i!=o&&this.initializeIntellisense(),t&&r&&t!==r||this.props.script.storageScript.name&&e.script.storageScript.name&&this.props.script.storageScript.name!==e.script.storageScript.name){var u=monaco.Uri.file(e.script.storageScript.name),l=monaco.editor.getModel(u);l&&l.dispose()}if(t&&t!==r||s&&!c||this.props.externalContentUpdateCounter!==e.externalContentUpdateCounter||this.props.isReadOnly!==e.isReadOnly){this.editor.updateOptions({readOnly:this.props.isReadOnly});var d=this.getModel();d&&(this.editor.setModel(d),this.editor.getValue()!==n&&(this.editor.pushUndoStop(),this.editor.executeEdits("ReactMonaco",[{range:d.getFullModelRange(),text:n}]))),this.handleResize()}}},i.componentWillUnmount=function(){this.editor&&(this.editor.dispose(),this.editor=void 0),window.removeEventListener("resize",this.handleResize)},i.render=function(){return a.a.createElement(a.a.Fragment,null,a.a.createElement(p.a,{when:void 0===this.props.script.localUpdates.body||this.props.isMonacoLoading},a.a.createElement(Wr,{"data-testid":Object(m.a)("MainEditorScriptLoadingSpinner")},a.a.createElement(Ht.a,{size:zt.a.large,styles:Object(y.c)(zt.a.large)}))),a.a.createElement(Wr,{style:{display:void 0!==this.props.script.localUpdates.body?"block":"none"},ref:this.setMonacoContainerRef,"data-testid":Object(m.a)("MainEditor"),role:"textbox","aria-label":strings.Editor.EditorAriaLabel,"aria-roledescription":strings.Editor.EditorAriaRoleDescription,dir:"ltr"}))},n.attemptToLoadMonaco=function(){var e=Nr(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new d.b("LoadMonaco","System"),e.prev=1,n=Jt(),e.next=5,Bt(n+"/loader.js");case 5:return window.require.config({baseUrl:".",paths:{vs:n}}),e.next=8,Yt(["vs/editor/editor.main"]);case 8:r.end(!0,d.a.Information,{loadedFrom:t}),e.next=15;break;case 11:throw e.prev=11,e.t0=e.catch(1),r.end(!1,d.a.Error,{loadedFrom:t,ErrorText:Object(er.a)(e.t0)}),e.t0;case 15:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t){return e.apply(this,arguments)}}(),i.initializeIntellisense=function(){var e=Nr(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props.script,e.next=3,Cr(Ir(t));case 3:r=e.sent,(n=monaco.languages.typescript.typescriptDefaults).setExtraLibs&&n.setExtraLibs([]),r.forEach((function(e){return monaco.languages.typescript.typescriptDefaults.addExtraLib(e)}));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),i.initializeMonaco=function(e){var t=new d.b("InitializeMonaco","System");try{this.setCustomKeyHandler(e),monaco.languages.typescript.typescriptDefaults.setCompilerOptions({target:monaco.languages.typescript.ScriptTarget.ES5,allowNonTsExtensions:!0,lib:["dom","es2015"]}),this.initializeIntellisense();monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({diagnosticCodesToIgnore:[6133]}),window.addEventListener("resize",this.handleResize),this.editor=this.createEditor(e),this.props.editorDidMount(this.editor),t.end(!0,d.a.Information,{})}catch(r){throw t.end(!1,d.a.Error,{ErrorText:Object(er.a)(r)}),r}},i.getModel=function(){var e=monaco.Uri.file(this.props.script.storageScript.name),t=monaco.editor.getModel(e);if(!t){var r=this.props.script.localUpdates.body;void 0!==r&&null!==r?(t=monaco.editor.createModel(r,this.language.toLowerCase(),e)).onWillDispose((function(){monaco.editor.setModelMarkers(t,Dr(Rr.FunctionArgument),[]),monaco.editor.setModelMarkers(t,Dr(Rr.SyncAPI),[])})):t=null}return t},i.clearAllModels=function(){monaco.editor.getModels().forEach((function(e){return e.dispose()}))},i.createEditor=function(e){var t=this;this.clearAllModels();var r=this.getModel(),n=monaco.editor.create(e,{model:r,language:this.language,automaticLayout:!0});return n.onDidChangeModelContent((function(){t.onValueChange(n)})),n.onDidPaste&&n.onDidPaste((function(){Object(d.h)(Object(Mt.a)({eventName:"EditorOperation",eventType:"User",data:{logLevel:d.a.Information,operation:"Paste",storageId:t.props.script.storageScript.id}}))})),n.onDidChangeCursorPosition((function(e){switch(e.reason){case monaco.editor.CursorChangeReason.Undo:t.isUndoInProgress&&t.undoCount++;break;case monaco.editor.CursorChangeReason.Redo:t.isRedoInProgress&&t.redoCount++}})),qt()&&n.onDidChangeConfiguration((function(e){e.tabFocusMode&&(t.isTabFocusModeOnIE11=!t.isTabFocusModeOnIE11)})),n.getAction("editor.action.clipboardCopyAction")&&n.addCommand(monaco.KeyMod.CtrlCmd|monaco.KeyCode.KEY_C,(function(){n.trigger("ReactMonaco","editor.action.clipboardCopyAction",null),Object(d.h)(Object(Mt.a)({eventName:"EditorOperation",eventType:"User",data:{logLevel:d.a.Information,operation:"Copy",storageId:t.props.script.storageScript.id,isOwner:t.props.script.storageScript.isCreator}}))})),n.getAction("editor.action.clipboardCutAction")&&n.addCommand(monaco.KeyMod.CtrlCmd|monaco.KeyCode.KEY_X,(function(){n.trigger("ReactMonaco","editor.action.clipboardCutAction",null),Object(d.h)(Object(Mt.a)({eventName:"EditorOperation",eventType:"User",data:{logLevel:d.a.Information,operation:"Cut",storageId:t.props.script.storageScript.id}}))})),n.updateOptions({readOnly:this.props.isReadOnly}),this.props.monacoEditorOnWindowName&&(window[this.props.monacoEditorOnWindowName]=n),n},i.handleResize=function(){this.editor&&this.editor.layout()},i.setCustomKeyHandler=function(e){var t=this;this.isKeyboardListenerAlreadyAttached||(this.isKeyboardListenerAlreadyAttached=!0,e.onkeydown=qt()?this.onKeyDownIE11:this.onKeyDown,e.onkeyup=function(e){if(Object(Pr.c)(e)&&(t.isUndoInProgress=!1,0===t.undoCount&&Object(d.h)(Object(Mt.a)({eventName:"EditorOperation",eventType:"User",data:{logLevel:d.a.Information,operation:"Undo",storageId:t.props.script.storageScript.id,success:!1}})),t.undoCount=0),Object(Pr.a)(e)&&(t.isRedoInProgress=!1,0===t.redoCount&&Object(d.h)(Object(Mt.a)({eventName:"EditorOperation",eventType:"User",data:{logLevel:d.a.Information,operation:"Redo",storageId:t.props.script.storageScript.id,success:!1}})),t.redoCount=0),Object(Pr.b)(e))return e.stopPropagation(),void(t.props.script&&Ar(t.props.script,t.props.isStorageCallInProgress)&&(Object(d.h)({eventName:"ControlAction",eventType:"User",data:{control:"ReactMonacoSaveEvent",location:"Editor",storageId:t.props.script.storageScript.id,navigationSourcePage:t.props.navigationSourcePageName}}),t.props.saveScript({script:t.props.script,updatedMetadata:{}})));e.keyCode===vt.a.tab&&t.editor&&t.editor.getOption&&!t.editor.getOption(monaco.editor.EditorOption.tabFocusMode)&&e.stopPropagation()})},n}(n.Component),Fr=Br,Wr=l.b.div.withConfig({displayName:"ReactMonaco__EditorArea",componentId:"mxa0lf-0"})(["width:100%;height:calc(100% - 3.4rem);background:",";display:flex;align-items:center;justify-content:center;"],(function(e){return e.theme.colors.neutralLighterAlt})),Ur=r(93),Hr=r(26),zr=r(46),Gr=r(700),Vr=r(684),Kr=r(6),qr=r(167);function Jr(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function Qr(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){Jr(i,n,a,o,s,"next",e)}function s(e){Jr(i,n,a,o,s,"throw",e)}o(void 0)}))}}var Zr=function(){Object.defineProperty(this,"getUserPermissions",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Qr(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new d.b("GetUserPermissions","User"),e.prev=1,e.next=4,Object(Vr.b)(Kr.getUserPermissions,t,qr.h);case 4:return r=e.sent,n=r.OfficeScriptingEnabled?d.a.Information:d.a.Warning,t.end(!0,n,{OfficeScriptingEnabled:r.OfficeScriptingEnabled,SharingEnabled:r.SharingEnabled}),e.abrupt("return",r);case 10:throw e.prev=10,e.t0=e.catch(1),t.end(!1,d.a.Warning,{ErrorText:Object(er.a)(e.t0)},e.t0),e.t0;case 14:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(){return e.apply(this,arguments)}}()}),Object.defineProperty(this,"getOrganization",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Qr(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new d.b("GetOrganization","System"),e.prev=1,e.next=4,Object(Vr.b)((function(e){return Object(Kr.getOrganization)(e)}),t,qr.e);case 4:return r=e.sent,t.end(!0,d.a.Information,{}),e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(1),t.end(!1,d.a.Warning,{ErrorText:Object(er.a)(e.t0)},e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(){return e.apply(this,arguments)}}()})},Yr=function(){function e(){}return e.instance=function(){if(!e._instance)switch(Object(g.c)()){case g.b.makerserviceprodnew:case g.b.makerserviceint:case g.b.makerservicetest:case g.b.makerservicelocal:case g.b.localstorage:e._instance=new Zr;break;default:throw new Error(g.a)}return e._instance},e}();function Xr(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function $r(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){Xr(i,n,a,o,s,"next",e)}function s(e){Xr(i,n,a,o,s,"throw",e)}o(void 0)}))}}Object.defineProperty(Yr,"_instance",{configurable:!0,enumerable:!0,writable:!0,value:void 0});var en=new Gr.a($r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Yr.instance().getUserPermissions());case 1:case"end":return e.stop()}}),e)}))));function tn(){return rn.apply(this,arguments)}function rn(){return(rn=$r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",en.promise());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nn(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function an(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){nn(i,n,a,o,s,"next",e)}function s(e){nn(i,n,a,o,s,"throw",e)}o(void 0)}))}}var on=new Gr.a(an(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Object(Hr.a)()&&Object(zr.k)()!=g.b.makerservicelocal){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,tn();case 4:return e.abrupt("return",e.sent.SharingEnabled);case 5:case"end":return e.stop()}}),e)})))),sn=function(){var e=an(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",on.promise());case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function cn(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function un(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){cn(i,n,a,o,s,"next",e)}function s(e){cn(i,n,a,o,s,"throw",e)}o(void 0)}))}}var ln,dn=function(e){return a.a.createElement("svg",e,a.a.createElement("title",null,"ExcelMyScripts_B (1) (1)"),a.a.createElement("defs",null,a.a.createElement("radialGradient",{cx:"108.994%",cy:"19.759%",fx:"108.994%",fy:"19.759%",r:"323.462%",gradientTransform:"matrix(.83914 0 0 1 .175 0)",id:"a"},a.a.createElement("stop",{stopColor:"#4E9668",offset:".063%"}),a.a.createElement("stop",{stopColor:"#64A57C",offset:"6.21%"}),a.a.createElement("stop",{stopColor:"#7AB490",offset:"14.45%"}),a.a.createElement("stop",{stopColor:"#8BBFA0",offset:"24.18%"}),a.a.createElement("stop",{stopColor:"#96C7AB",offset:"36.22%"}),a.a.createElement("stop",{stopColor:"#9DCCB1",offset:"53.11%"}),a.a.createElement("stop",{stopColor:"#9FCDB3",offset:"100%"})),a.a.createElement("radialGradient",{cx:"58.266%",cy:"64.37%",fx:"58.266%",fy:"64.37%",r:"73.563%",gradientTransform:"matrix(-1 0 0 -.59535 1.165 1.027)",id:"b"},a.a.createElement("stop",{stopColor:"#4E9668",offset:"0%"}),a.a.createElement("stop",{stopColor:"#5B9F74",offset:"4.87%"}),a.a.createElement("stop",{stopColor:"#73AF8B",offset:"16.8%"}),a.a.createElement("stop",{stopColor:"#87BD9D",offset:"30.17%"}),a.a.createElement("stop",{stopColor:"#95C6A9",offset:"45.57%"}),a.a.createElement("stop",{stopColor:"#9DCBB1",offset:"64.83%"}),a.a.createElement("stop",{stopColor:"#9FCDB3",offset:"100%"})),a.a.createElement("radialGradient",{cx:"71.624%",cy:"25.648%",fx:"71.624%",fy:"25.648%",r:"54.323%",gradientTransform:"scale(1 .9361) rotate(2.358 .291 .265)",id:"c"},a.a.createElement("stop",{stopColor:"#9B643D",offset:"0%"}),a.a.createElement("stop",{stopColor:"#BF8F68",offset:"100%"})),a.a.createElement("radialGradient",{cx:"10.077%",cy:"53.232%",fx:"10.077%",fy:"53.232%",r:"75.991%",gradientTransform:"scale(1 .58715) rotate(3.128 -6.754 .72)",id:"d"},a.a.createElement("stop",{stopColor:"#9B643D",offset:"0%"}),a.a.createElement("stop",{stopColor:"#BF8F68",offset:"100%"})),a.a.createElement("radialGradient",{cx:"61.106%",cy:"117.264%",fx:"61.106%",fy:"117.264%",r:"104.552%",gradientTransform:"scale(.87234 1) rotate(.251 .656 21.586)",id:"e"},a.a.createElement("stop",{stopColor:"#4E9668",offset:"0%"}),a.a.createElement("stop",{stopColor:"#5EA177",offset:"5.69%"}),a.a.createElement("stop",{stopColor:"#76B18D",offset:"16.24%"}),a.a.createElement("stop",{stopColor:"#88BE9E",offset:"28.3%"}),a.a.createElement("stop",{stopColor:"#95C6AA",offset:"42.56%"}),a.a.createElement("stop",{stopColor:"#9DCCB1",offset:"61.12%"}),a.a.createElement("stop",{stopColor:"#9FCDB3",offset:"100%"}))),a.a.createElement("g",{fillRule:"nonzero",fill:"none"},a.a.createElement("g",{transform:"translate(0 .5)"},a.a.createElement("path",{d:"M37.754 93.58a15.19 15.19 0 0 0-.074-4.536c-1.688-9.927-5.057-18.94-13.655-18.94-8.599 0-16.833 9.911-16.833 19.65 0 1.31.132 2.589.38 3.825h30.182z",fill:"#605D5A"}),a.a.createElement("path",{d:"M61.274 71.67l4.908-2.234.977-.453c.438-.033.869.156 1.142.503l.927 1.17 1.547-1.277-.844-1.798a1.808 1.808 0 0 0-1.266-.998l-1.945-.412 2.069-.223 1.622.973 1.332-.156-2.995-2.086-3.236.478-5.47 4.024 1.232 2.49z",fill:"#BF8F68"}),a.a.createElement("path",{d:"M62.78 67.194s-16.303 2.918-23.006-5.335c-4.403-5.426-5.28-13.342-5.446-16.648-.132-2.614-1.713-4.552-4.005-4.66-1.25-.057-2.54.388-3.46 1.403-4.775 5.277-3.525 20.44 7.482 27.754 9.045 6.02 26.276 2.969 28.94 1.83l-.504-4.344z",fill:"url(#a)"}),a.a.createElement("path",{d:"M55.432 75.159l4.907-2.235.977-.453c.438-.033.869.156 1.142.503l.927 1.17 1.547-1.278-.844-1.797a1.808 1.808 0 0 0-1.266-.998l-1.945-.412 2.07-.223 1.621.973 1.333-.156-2.996-2.087-3.236.479-5.47 4.024 1.233 2.49z",fill:"#BF8F68"}),a.a.createElement("path",{d:"M5.917 16.22l19.449-1.93V66.64l-25.217.074s4.279-25.75 5.768-50.496z",fill:"#3A312E"}),a.a.createElement("path",{d:"M5.652 17.967C5.057 28.052 16.03 37.575 25.366 38.021c9.922.437 7.812-25.57 7.911-33.626C30.63 2.119 27.31.693 23.644.51 14.301.066 6.248 7.883 5.652 17.967z",fill:"#3A312E"}),a.a.createElement("ellipse",{fill:"#8B8CC7",cx:"19.606",cy:"47.074",rx:"8.35",ry:"8.32"}),a.a.createElement("path",{d:"M6.306 86.043h31.697s-2.152-9.573-1.78-18.182c.373-8.608 1.432-14.034-.471-20.787-1.598-5.648-4.337-9.565-8.061-12.632-1.49-1.229-3.708-1.336-6.074-1.583-2.367-.248-4.51.338-6.331 1.6-4.66 3.215-6.43 13.2-5.67 22.823.845 10.72-3.31 28.761-3.31 28.761z",fill:"url(#b)"}),a.a.createElement("path",{d:"M55.564 71.67s-17.86.306-24.753-9.317c-4.535-6.324-5.114-14.636-5.148-18.066-.024-2.713-1.646-4.972-4.137-5.467-1.358-.272-2.781-.016-3.824.874-5.437 4.65-4.783 20.49 6.836 29.858 9.55 7.701 28.42 7.42 31.365 6.695l-.339-4.576z",fill:"#9FCDB3"}),a.a.createElement("path",{d:"M15.757 33.741s2.152 1.97 6.298 1.995c4.072-.28 5.628-1.294 5.628-1.294-2.607-1.163-2.218-2.894-2.317-3.95l.19-6.027-8.392-1.468s1.655 4.741.646 8.922c-.224.932-2.053 1.822-2.053 1.822z",fill:"url(#c)"}),a.a.createElement("path",{d:"M26.135 29.198l-.712-.05c-5.453-.396-9.55-5.129-9.153-10.562l.24-3.257c.39-5.294 5.016-9.277 10.329-8.89l1.671.125c4.486.33 7.846 4.213 7.523 8.674l-.43 5.813c-.348 4.848-4.593 8.501-9.468 8.147z",fill:"#BF8F68"}),a.a.createElement("path",{fill:"url(#d)",d:"M34.734 14.908l-.927 9.895-4.883-.61.795-8.88z"}),a.a.createElement("path",{d:"M16.651 15.015c-1.788-.206-3.41 1.064-3.617 2.845a3.249 3.249 0 0 0 2.856 3.603l1.092.124-.331-6.572zM28.163 20.647c.016.602.993 2.053.993 2.053s.083-.495.521-.66c.712-.263 1.167-1.22 1.026-2.086-.107-.643-.355-.832-.753-1.154-.356-.289-.918-2.045-.918-2.045s-.919 2.309-.87 3.892z",fill:"#BF8F68"}),a.a.createElement("ellipse",{fill:"#3A312E",transform:"rotate(-88.659 24.365 17.469)",cx:"24.365",cy:"17.469",rx:"1.435",ry:"1"}),a.a.createElement("ellipse",{fill:"#3A312E",transform:"rotate(-88.298 32.43 17.861)",cx:"32.43",cy:"17.861",rx:"1.352",ry:"1"}),a.a.createElement("path",{d:"M28.229 25.182c-.248.445-.77.684-1.25.734-.496.066-.976-.05-1.407-.256a2.435 2.435 0 0 1-1.042-.98c-.249-.421-.34-.982-.133-1.436.075-.165.273-.239.439-.165.041.017.083.05.116.083l.041.05c.248.28.455.428.67.577.216.14.43.272.663.387.223.124.463.223.711.322.249.082.489.173.844.198l.083.008a.33.33 0 0 1 .306.346.808.808 0 0 1-.041.132z",fill:"#9B643D"}),a.a.createElement("path",{d:"M30.513 13.68l1.25-2.35.918 2.514 5.504.85s1.614-11.313-10.46-12.13C22.7 2.226 16.807 9.433 16.476 14.29c-.008-.009 8.897-.924 14.036-.61z",fill:"#3A312E"}),a.a.createElement("path",{d:"M21.343 12.542l-.993 13.044c.1 4.016-1.928 7.108-5.321 9.623-1.324.981-2.74 2.168-4.047 3.554l.72-26.081 9.641-.14z",fill:"#3A312E"})),a.a.createElement("path",{d:"M200.769 95.5H86l.231-77.834c0-3.956 3.197-7.166 7.137-7.166h100.496c3.94 0 7.136 3.21 7.136 7.166l-.231 77.834z",fill:"#B3AFAB"}),a.a.createElement("path",{d:"M161 17.194c0-3.7-2.988-6.694-6.68-6.694H87.5c-3.693 0-6.68 2.994-6.68 6.694V59.41l-.059-.008L55 82.08l.34 13.42h105.536L161 17.194z",fill:"#DBDBDB"}),a.a.createElement("g",{transform:"translate(125 25.5)"},a.a.createElement("ellipse",{fill:"#9FCDB3",cx:"4.538",cy:"23.517",rx:"3.78",ry:"3.852"}),a.a.createElement("ellipse",{fill:"#4E9668",cx:"4.538",cy:"4.104",rx:"3.78",ry:"3.852"}),a.a.createElement("ellipse",{fill:"#FFF",cx:"4.538",cy:"42.921",rx:"3.78",ry:"3.852"}),a.a.createElement("ellipse",{fill:"#FFF",cx:"23.66",cy:"4.104",rx:"3.78",ry:"3.852"}),a.a.createElement("ellipse",{fill:"#4E9668",cx:"23.66",cy:"23.517",rx:"3.78",ry:"3.852"}),a.a.createElement("ellipse",{fill:"#9FCDB3",cx:"23.66",cy:"42.921",rx:"3.78",ry:"3.852"})),a.a.createElement("path",{d:"M197.297 29.5h-31.594c-1.49 0-2.703-1.115-2.703-2.5 0-1.377 1.206-2.5 2.703-2.5h31.594c1.49 0 2.703 1.115 2.703 2.5-.008 1.377-1.214 2.5-2.703 2.5z",fill:"#A19F9D"}),a.a.createElement("path",{d:"M164 26.5s3.76 5.562 4.078 13.708c.423 10.612-.562 25.93 9.5 27.043 6.837.751 33.422-.437 33.422-.437s-8.8-3.59-7.896-21.358c.7-13.724-5.022-18.675-5.022-18.675L164 26.5z",fill:"url(#e)"}),a.a.createElement("path",{d:"M224.831 56.5l-36.313 1.133S186.17 65.985 178 67.557c8.83 2.373 40.177-.48 40.177-.48s8.08-1.174 6.654-10.577z",fill:"#BCDCCA"}),a.a.createElement("g",{transform:"translate(86 25.5)"},a.a.createElement("circle",{fill:"#FFF",cx:"13.008",cy:"13.05",r:"12.782"}),a.a.createElement("path",{d:"M13.008.176c-4.83 0-9.04 2.692-11.222 6.66A12.76 12.76 0 0 0 .201 13H.185c0 3.254 1.207 6.357 3.413 8.74l2.835-2.617a9.002 9.002 0 0 1-2.39-6.098h.008c0-1.392.319-2.709.88-3.891 1.443-3.02 4.521-5.117 8.077-5.117 1.024 0 2.013.177 2.927.495a9.024 9.024 0 0 1 6.03 8.513h3.85c0-5.695-3.707-10.534-8.831-12.22a12.896 12.896 0 0 0-3.976-.629z",fill:"#9FCDB3"}),a.a.createElement("path",{d:"M22.578 9.1l-9.897 1.241c-1.962.244-3.17 2.282-2.457 4.127a3.04 3.04 0 0 0 4.596 1.367l8.119-5.787c.453-.319.184-1.015-.36-.948zm-10.09 5.46a1.362 1.362 0 1 1 1.191-2.449c.671.327.956 1.149.63 1.82-.328.68-1.141.964-1.82.629z",fill:"#217346"}),a.a.createElement("path",{d:"M13.034.176c-4.815 0-9.025 2.692-11.197 6.651.05.067 3.044 2.273 3.137 2.298 1.442-3.02 4.512-5.108 8.06-5.108 1.023 0 2.004.177 2.918.495.05.009.998-3.698 1.049-3.707a12.842 12.842 0 0 0-3.967-.629z",fill:"#4E9668"}),a.a.createElement("path",{d:"M1.786 6.844a12.76 12.76 0 0 0-1.585 6.164H.185c0 3.255 1.207 6.358 3.413 8.74l2.835-2.617a9.002 9.002 0 0 1-2.39-6.097h.008c0-1.393.478-2.961 1.04-4.144-.076-.033-3.288-2.096-3.305-2.046z",fill:"#9FCDB3"})),a.a.createElement("path",{fill:"#B3AFAB",d:"M91.285 81.155v-3.432h21.43v3.432z"}),a.a.createElement("path",{d:"M108.698 73.644v11.592c0 1.016-.84 1.832-1.866 1.832h-2.738c-1.035 0-1.866-.824-1.866-1.832V73.644c0-1.016.84-1.832 1.866-1.832h2.738c1.027 0 1.866.824 1.866 1.832z",fill:"#4E9668"})))};dn.defaultProps={width:"225",height:"96",viewBox:"0 0 225 96",xmlns:"http://www.w3.org/2000/svg"},function(e){e.Recent="Recent",e.Attached="Attached",e.Samples="Samples"}(ln||(ln={}));var pn={Recent:strings.Editor.MyScriptsLabel,Attached:strings.Editor.ThisWorkbookLabel,Samples:strings.Editor.SamplesLabel},fn=Object(l.c)((function(e){var t,r=Object(n.useRef)(0),i=Object(n.useRef)(!1);Object(n.useEffect)((function(){function t(){return(t=un(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.current++,n=r.current,t.next=4,Object(Ur.a)(3e3);case 4:if(i.current||r.current!==n){t.next=9;break}return t.next=7,Br.attemptToLoadMonaco("Backstage");case 7:i.current=!0,e.setIsReactMonacoLoaded();case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}void 0===window.monaco&&function(){t.apply(this,arguments)}()}),[e]);var o=Object(n.useState)(!0),s=o[0],c=o[1];sn().then((function(e){c(e)}));for(var u=[],l=0,p=Object.values(ln);l<p.length;l++){var f=p[l];u.push({key:f,testId:Object(m.a)("Backstage"+f+"Pivot"),text:pn[f],ariaLabel:pn[f]})}var g=((t={})[ln.Recent]=!e.hasReceivedMetadata||e.recentScripts.length>0?a.a.createElement(yt,{"data-testid":Object(m.a)("BackstageMainRecentScriptsList"),items:e.recentScripts,shouldShowShimmer:!e.hasReceivedMetadata,isAnyStorageCallInProgress:e.isAnyStorageCallInProgress,openScript:On(e,"Backstage My Scripts"),setNavigationSourcePage:e.setNavigationSourcePage}):a.a.createElement(vn,{"data-testid":Object(m.a)("BackstageNoScriptsMessage")},a.a.createElement(dn,null),a.a.createElement(Sn,null,a.a.createElement(x.a,{styles:yn(e.theme,!0,!0)},strings.Backstage.NoScriptsMessageHeader),a.a.createElement(x.a,{styles:yn(e.theme,!1,!1)},a.a.createElement("div",{dangerouslySetInnerHTML:{__html:strings.substitute(strings.Backstage.NoScriptsMessageText,{recordActions:strings.MacroRecorder.RecordActionsButtonText,newScript:strings.Editor.NewScriptButtonText},!0)}})),a.a.createElement(j.a,{href:"https://docs.microsoft.com/office/dev/scripts/tutorials/excel-office-scripts-tutorial",target:"_blank"},strings.Backstage.LearnMoreLink))),t[ln.Attached]=!e.hasLoadedAttachedScripts||e.hasLoadedAttachedScripts&&e.docAttachedScripts.length>0?a.a.createElement(yt,{"data-testid":Object(m.a)("BackstageMainDocAttachedScriptsList"),items:e.docAttachedScripts,shouldShowShimmer:!e.hasLoadedAttachedScripts,isAnyStorageCallInProgress:e.isAnyStorageCallInProgress,openScript:On(e,"Backstage This Workbook"),setNavigationSourcePage:e.setNavigationSourcePage}):a.a.createElement(vn,{"data-testid":Object(m.a)("BackstageNoAttachedScriptsMessage")},a.a.createElement(Sn,null,a.a.createElement(x.a,{styles:yn(e.theme,!0,!1)},strings.Backstage.NoAttachedScriptsMessageText),s&&a.a.createElement(j.a,{href:"https://go.microsoft.com/fwlink/?linkid=2157324",target:"_blank",onClick:function(){return Object(d.h)({eventName:"FollowLink",eventType:"User",data:{id:"ThisWorkbookEmptyStateLink",hasReceivedMetadata:e.hasReceivedMetadata,recentScriptsNum:e.recentScripts.length}})}},strings.Backstage.NoAttachedScriptsLinkText))),t[ln.Samples]=e.sampleScripts.length>0?a.a.createElement(hn,null,a.a.createElement(yt,{"data-testid":Object(m.a)("BackstageMainSampleScriptsList"),items:e.sampleScripts,isAnyStorageCallInProgress:e.isAnyStorageCallInProgress,openScript:On(e,"Backstage Samples"),setNavigationSourcePage:e.setNavigationSourcePage}),a.a.createElement(bn,null,a.a.createElement(j.a,{href:"https://docs.microsoft.com/office/dev/scripts/resources/excel-samples",target:"_blank"},strings.Backstage.MoreSamplesLink))):a.a.createElement(vn,null,a.a.createElement(Sn,null,a.a.createElement(x.a,{styles:yn(e.theme,!0,!0)},strings.Backstage.ComingSoonText),a.a.createElement(j.a,{href:"https://docs.microsoft.com/office/dev/scripts/tutorials/excel-office-scripts-tutorial",target:"_blank"},strings.Backstage.ComingSoonLink))),t),h=Object.keys(g)[0],b=e.currentPivotKey||h,v=g[b];return a.a.createElement(gn,{"data-testid":Object(m.a)("Backstage")},a.a.createElement(W.a,{header:e.hasHeader?a.a.createElement(At,{primaryCommands:[{key:Object(m.a)("BackstageHeaderCreateNewButton"),text:strings.Editor.NewScriptButtonText,iconProps:{iconName:"AddIcon"},onClick:e.createNewScript}],isDetailsPage:!1}):null,main:a.a.createElement(mn,null,a.a.createElement(U.a,{selectedKey:Object.keys(g).includes(b)?b:null,onSelect:function(t){e.setCurrentPivotKey&&e.setCurrentPivotKey(t),Object(d.c)("Backstage","Backstage",t)},shouldFocus:!0,items:u}),v)}))})),gn=l.b.div.withConfig({displayName:"Backstage__BackstageWrapper",componentId:"sc-1hwwlmr-0"})(["padding:0 ",";background:",";height:100%;"],(function(e){return e.theme.spacing.small}),(function(e){return e.theme.colors.neutralLight})),mn=l.b.div.withConfig({displayName:"Backstage__MainWrapper",componentId:"sc-1hwwlmr-1"})(["display:flex;flex-direction:column;height:100%;"]),hn=l.b.div.withConfig({displayName:"Backstage__SamplesPivotWrapper",componentId:"sc-1hwwlmr-2"})(["width:100%;height:100%;display:flex;flex-direction:column;align-items:stretch;"]),bn=l.b.div.withConfig({displayName:"Backstage__MoreSamplesLinkWrapper",componentId:"sc-1hwwlmr-3"})(["display:flex;justify-content:center;padding-left:0.8rem;padding-top:1rem;"]),vn=l.b.div.withConfig({displayName:"Backstage__PivotWrapper",componentId:"sc-1hwwlmr-4"})(["width:100%;height:100%;margin-top:",";display:flex;flex-direction:column;align-items:center;"],(function(e){return e.theme.spacing.large})),Sn=l.b.div.withConfig({displayName:"Backstage__PivotMessageWrapper",componentId:"sc-1hwwlmr-5"})(["width:60%;display:flex;flex-direction:column;justify-content:stretch;padding:",";font-size:",";text-align:center;"],(function(e){return e.theme.spacing.small}),(function(e){return e.theme.fontSizes.small})),yn=function(e,t,r){return{root:{padding:e.spacing.small,fontSize:t?e.fontSizes.medium:e.fontSizes.small,fontWeight:r?e.fontWeights.semibold:e.fontWeights.regular}}};function On(e,t){return function(r,n){e.openScript({id:r.storageScript.id,destination:n}),Object(d.h)(Object(Mt.a)({eventName:"OpenScript",eventType:"User",data:{logLevel:d.a.Information,storageId:r.storageScript.id,entryPoint:t,hasDescription:!!r.storageScript.description,isOwner:r.storageScript.isCreator}}))}}var xn=Object(i.b)((function(e){return{hasHeader:!0,recentScripts:c.b.scripts.getAllMyScriptsInLastModifiedOrder(e),docAttachedScripts:c.b.scripts.getAllDocAttachedScripts(e),hasLoadedAttachedScripts:c.b.scripts.getHasLoadedAttachedScripts(e),sampleScripts:c.b.scripts.getAllSampleScriptsInSortIndexOrder(e),activeScriptId:c.b.editor.getActiveScriptId(e),currentPivotKey:c.b.backstage.getCurrentPivot(e),hasReceivedMetadata:c.b.scripts.getHasReceivedMetadata(e),isAnyStorageCallInProgress:c.b.scripts.getIsAnyStorageCallInProgress(e)}}),{createNewScript:function(){return c.a.editor.createNewScript()},openScript:c.a.editor.openScript,hideBackstage:function(){return c.a.backstage.hide()},setCurrentPivotKey:c.a.backstage.setCurrentPivot,setIsReactMonacoLoaded:c.a.backstage.setIsReactMonacoLoaded,setNavigationSourcePage:c.a.editor.setNavigationSourcePage})(fn),jn=r(742),wn=r(779),En=r(936),kn=r(688);function Cn(){var e=Rn(["\n display: flex;\n"]);return Cn=function(){return e},e}function _n(){var e=Rn(["\n height: 100%;\n width: 100%;\n padding: 0 ",";\n overflow: auto;\n"]);return _n=function(){return e},e}function Rn(e,t){return t||(t=e.slice(0)),e.raw=t,e}function Pn(){return(Pn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Tn=Object(i.b)((function(e){return{settings:c.b.settings.getAll(e)}}),{editSetting:c.a.settings.edit.request})(Object(l.c)((function(e){Object(n.useEffect)((function(){window.document.title=strings.PageTitles.CodeEditorSettings}));var t=a.a.createRef();return Object(n.useEffect)((function(){t.current&&t.current.focus()}),[t]),a.a.createElement(In,{"data-testid":Object(m.a)("MainEditorSettingsPane")},a.a.createElement(Dn,null,a.a.createElement(En.a,{"data-testid":Object(m.a)("SettingsPaneBackButton"),iconProps:{iconName:Object(Z.a)()?"BackArrowRtl":"BackArrow"},ariaLabel:strings.General.BackButtonText,allowDisabledFocus:!0,componentRef:t,onClick:function(){e.hideSettingsPage()},styles:Pn({},An(e.theme),Object(y.a)(e.theme))}),a.a.createElement(x.a,{styles:Mn(e.theme)},strings.Editor.EditorSettingsLabel)),Object.keys(kn.a).map((function(t){var r=kn.a[t];if(r.enum)return a.a.createElement(wn.a,{key:t+"_key","data-testid":"testId-"+t,settingTitle:r.userFacingName,currentValue:e.settings[t],possibleValues:r.enum,displayValues:r.displayText,onChange:function(r){var n;return e.editSetting(((n={})[t]=r,n))}});if("boolean"===typeof r.defaultValue)return"ShowContextualHelpByDefault"!==r.userFacingName&&a.a.createElement(jn.a,{key:t+"_key","data-testid":"testId-"+t,settingTitle:r.userFacingName,checked:e.settings[t],onChange:function(r){var n;return e.editSetting(((n={})[t]=r,n))}});throw new Error('Unsupported type for default setting setting "'+t+'"')})),a.a.createElement(Dn,null,a.a.createElement(j.a,{"data-testid":Object(m.a)("SettingsPaneLearnMoreLink"),href:"https://docs.microsoft.com/office/dev/scripts",target:"_blank",styles:Nn(e.theme)},strings.Editor.LearnMoreLink)))}))),In=l.b.div(_n(),(function(e){return e.theme.spacing.medium})),Dn=l.b.div(Cn()),An=function(e){return{root:{fontWeight:e.fontWeights.semibold,fontSize:e.fontSizes.mediumPlus,paddingLeft:e.spacing.xSmall,paddingRight:e.spacing.xSmall,marginRight:e.spacing.small},icon:{fontSize:e.fontSizes.icon}}},Mn=function(e){return{root:{fontWeight:e.fontWeights.semibold,fontSize:e.fontSizes.mediumPlus,margin:"auto 0"}}},Nn=function(e){return{root:{margin:".8rem"}}};function Ln(){var e=Un(["\n padding: 0.6rem 0;\n"]);return Ln=function(){return e},e}function Bn(){var e=Un(["\n padding: 1rem 0;\n"]);return Bn=function(){return e},e}function Fn(){var e=Un(["\n padding: 0.8rem 0;\n"]);return Fn=function(){return e},e}function Wn(){var e=Un(["\n padding: 0.6rem 0;\n"]);return Wn=function(){return e},e}function Un(e,t){return t||(t=e.slice(0)),e.raw=t,e}var Hn=Object(l.c)((function(e){return a.a.createElement(a.a.Fragment,null,a.a.createElement(Gn,null,a.a.createElement(xe,{shimmerColors:zn(e.theme),shimmerElements:[{type:ee.line,height:20,width:"50%"},{type:ee.gap,width:"50%"}]})),a.a.createElement(Vn,null,a.a.createElement(xe,{shimmerColors:zn(e.theme),shimmerElements:[{type:ee.line,height:20,width:"10%"},{type:ee.gap,width:"2%"},{type:ee.line,height:20,width:"10%"},{type:ee.gap,width:"2%"},{type:ee.line,height:20,width:"10%"},{type:ee.gap,width:"66%"}]})),a.a.createElement(Kn,null,a.a.createElement(qn,null,a.a.createElement(xe,{shimmerColors:zn(e.theme),shimmerElements:[{type:ee.line,height:16,width:"70%"},{type:ee.gap,width:"30%"}]}))),a.a.createElement(Kn,null,a.a.createElement(qn,null,a.a.createElement(xe,{shimmerColors:zn(e.theme),shimmerElements:[{type:ee.line,height:16,width:"30%"},{type:ee.gap,width:"70%"}]})),a.a.createElement(qn,null,a.a.createElement(xe,{shimmerColors:zn(e.theme),shimmerElements:[{type:ee.line,height:16,width:"50%"},{type:ee.gap,width:"50%"}]}))))})),zn=function(e){return{shimmer:e.colors.neutralQuaternaryAlt,shimmerWave:e.colors.neutralQuaternary,background:e.colors.neutralLight}},Gn=l.b.div(Wn()),Vn=l.b.div(Fn()),Kn=l.b.div(Bn()),qn=l.b.div(Ln());function Jn(){var e=function(e,t){t||(t=e.slice(0));return e.raw=t,e}(["\n display: flex;\n"]);return Jn=function(){return e},e}function Qn(){return(Qn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Zn,Yn,Xn=Object(l.c)((function(e){var t=e.theme,r=e.returnToPreviousPage,i=a.a.createRef();return Object(n.useEffect)((function(){i.current&&i.current.focus()}),[]),a.a.createElement($n,null,a.a.createElement(En.a,{"data-testid":Object(m.a)("DetailsPageBackButton"),iconProps:{iconName:Object(Z.a)()?"BackArrowRtl":"BackArrow"},ariaLabel:strings.General.BackButtonText,allowDisabledFocus:!0,componentRef:i,onClick:function(){r()},styles:Qn({},ea(t),Object(y.a)(t))}),a.a.createElement(x.a,{styles:ta(t)},e.buttonText))})),$n=l.b.div(Jn()),ea=function(e){return{root:{fontSize:e.fontSizes.mediumPlus},icon:{fontSize:e.fontSizes.icon,paddingTop:"0.2rem"}}},ta=function(e){return{root:{fontWeight:e.fontWeights.regular,fontSize:e.fontSizes.mediumPlus,paddingLeft:e.spacing.small,margin:"auto 0"}}},ra=r(1368),na={root:"ms-GroupedList",compact:"ms-GroupedList--Compact",group:"ms-GroupedList-group",link:"ms-Link",listCell:"ms-List-cell"},aa="cubic-bezier(0.445, 0.050, 0.550, 0.950)",ia=r(636),oa=r(1364),sa=r(946),ca=r(1367);!function(e){e[e.none=0]="none",e[e.single=1]="single",e[e.multiple=2]="multiple"}(Zn||(Zn={})),function(e){e[e.horizontal=0]="horizontal",e[e.vertical=1]="vertical"}(Yn||(Yn={}));var ua=r(1371),la=r(15),da=r(124),pa=r(1407),fa={cellLeftPadding:12,cellRightPadding:8,cellExtraRightPadding:24},ga={rowHeight:42,compactRowHeight:32},ma=(Object(G.a)(Object(G.a)({},ga),{rowVerticalPadding:11,compactRowVerticalPadding:6}),function(e){var t=e.count,r=e.indentWidth,a=t*(void 0===r?36:r);return t>0?n.createElement("span",{className:"ms-GroupSpacer",style:{display:"inline-block",width:a}}):null}),ha={root:"ms-Check",circle:"ms-Check-circle",check:"ms-Check-check",checkHost:"ms-Check-checkHost"},ba={root:"ms-GroupHeader",compact:"ms-GroupHeader--compact",check:"ms-GroupHeader-check",dropIcon:"ms-GroupHeader-dropIcon",expand:"ms-GroupHeader-expand",isCollapsed:"is-collapsed",title:"ms-GroupHeader-title",isSelected:"is-selected",iconTag:"ms-Icon--Tag",group:"ms-GroupedList-group",isDropping:"is-dropping"},va="cubic-bezier(0.075, 0.820, 0.165, 1.000)",Sa="cubic-bezier(0.390, 0.575, 0.565, 1.000)",ya="cubic-bezier(0.600, -0.280, 0.735, 0.045)",Oa=r(1055),xa=r(947),ja=Object(re.a)(),wa=Object(z.a)((function(e){var t=e.checked,r=void 0!==t&&t,a=e.className,i=e.theme,o=e.styles,s=e.useFastIcons,c=void 0===s||s,u=ja(o,{theme:i,className:a,checked:r}),l=c?xa.a:S.a;return n.createElement("div",{className:u.root},n.createElement(l,{iconName:"CircleRing",className:u.circle}),n.createElement(l,{iconName:"StatusCircleCheckmark",className:u.check}))}),(function(e){var t,r,n,a,i,o=e.height,s=void 0===o?e.checkBoxHeight||"18px":o,c=e.checked,u=e.className,l=e.theme,d=l.palette,p=l.semanticColors,f=l.fonts,g=Object(Z.a)(l),m=Object(K.a)(ha,l),h={fontSize:s,position:"absolute",left:0,top:0,width:s,height:s,textAlign:"center",verticalAlign:"middle"};return{root:[m.root,f.medium,{lineHeight:"1",width:s,height:s,verticalAlign:"top",position:"relative",userSelect:"none",selectors:(t={":before":{content:'""',position:"absolute",top:"1px",right:"1px",bottom:"1px",left:"1px",borderRadius:"50%",opacity:1,background:p.bodyBackground}},t["."+m.checkHost+":hover &, ."+m.checkHost+":focus &, &:hover, &:focus"]={opacity:1},t)},c&&["is-checked",{selectors:{":before":{background:d.themePrimary,opacity:1,selectors:(r={},r[q.a]={background:"Window"},r)}}}],u],circle:[m.circle,h,{color:d.neutralSecondary,selectors:(n={},n[q.a]={color:"WindowText"},n)},c&&{color:d.white}],check:[m.check,h,{opacity:0,color:d.neutralSecondary,fontSize:la.c.medium,left:g?"-0.5px":".5px",selectors:(a={":hover":{opacity:1}},a[q.a]={MsHighContrastAdjust:"none"},a)},c&&{opacity:1,color:d.white,fontWeight:900,selectors:(i={},i[q.a]={border:"none",color:"WindowText"},i)}],checkHost:m.checkHost}}),void 0,{scope:"Check"},!0),Ea=Object(re.a)(),ka=function(e){function t(t){var r=e.call(this,t)||this;return r._onToggleCollapse=function(e){var t=r.props,n=t.group,a=t.onToggleCollapse,i=t.isGroupLoading,o=!r.state.isCollapsed,s=!o&&i&&i(n);r.setState({isCollapsed:o,isLoadingVisible:s}),a&&a(n),e.stopPropagation(),e.preventDefault()},r._onToggleSelectGroupClick=function(e){var t=r.props,n=t.onToggleSelectGroup,a=t.group;n&&n(a),e.preventDefault(),e.stopPropagation()},r._onHeaderClick=function(){var e=r.props,t=e.group,n=e.onGroupHeaderClick,a=e.onToggleSelectGroup;n?n(t):a&&a(t)},r._onRenderTitle=function(e){var t=e.group;return t?n.createElement("div",{className:r._classNames.title},n.createElement("span",null,t.name),n.createElement("span",{className:r._classNames.headerCount},"(",t.count,t.hasMoreData&&"+",")")):null},r.state={isCollapsed:r.props.group&&r.props.group.isCollapsed,isLoadingVisible:!1},r}return Object(G.c)(t,e),t.prototype.UNSAFE_componentWillReceiveProps=function(e){if(e.group){var t=e.group.isCollapsed,r=e.isGroupLoading,n=!t&&r&&r(e.group);this.setState({isCollapsed:t||!1,isLoadingVisible:n||!1})}},t.prototype.render=function(){var e=this.props,t=e.group,r=e.groupLevel,a=e.viewport,i=e.selectionMode,o=e.loadingText,s=e.isSelected,c=void 0!==s&&s,u=e.selected,l=void 0!==u&&u,d=e.indentWidth,p=e.onRenderTitle,f=void 0===p?this._onRenderTitle:p,g=e.onRenderGroupHeaderCheckbox,m=e.isCollapsedGroupSelectVisible,h=void 0===m||m,b=e.expandButtonProps,v=e.expandButtonIcon,y=e.selectAllButtonProps,O=e.theme,x=e.styles,j=e.className,w=e.groupedListId,E=e.compact,k=e.ariaPosInSet,C=e.ariaSetSize,_=e.useFastIcons?this._fastDefaultCheckboxRender:this._defaultCheckboxRender,R=g?Object(Oa.a)(g,_):_,P=this.state,T=P.isCollapsed,I=P.isLoadingVisible,D=i===Zn.multiple&&(h||!(t&&t.isCollapsed)),A=l||c,M=Object(Z.a)(O);return this._classNames=Ea(x,{theme:O,className:j,selected:A,isCollapsed:T,compact:E}),t?n.createElement("div",{className:this._classNames.root,style:a?{minWidth:a.width}:{},onClick:this._onHeaderClick,"aria-expanded":!t.isCollapsed,"aria-label":t.ariaLabel||t.name,"aria-level":void 0!==r?r+1:void 0,"aria-setsize":C,"aria-posinset":k,"data-is-focusable":!0},n.createElement(H.a,{className:this._classNames.groupHeaderContainer,direction:Fe.a.horizontal},D?n.createElement("button",Object(G.a)({type:"button",className:this._classNames.check,role:"checkbox","aria-checked":A,"data-selection-toggle":!0,onClick:this._onToggleSelectGroupClick},y),R({checked:A,theme:O},R)):i!==Zn.none&&n.createElement(ma,{indentWidth:d,count:1}),n.createElement(ma,{indentWidth:d,count:r}),n.createElement("div",{className:this._classNames.dropIcon},n.createElement(S.a,{iconName:"Tag"})),n.createElement("button",Object(G.a)({type:"button",className:this._classNames.expand,onClick:this._onToggleCollapse,"aria-expanded":!t.isCollapsed,"aria-controls":t&&!t.isCollapsed?w:void 0},b),n.createElement(S.a,{className:this._classNames.expandIsCollapsed,iconName:v||(M?"ChevronLeftMed":"ChevronRightMed")})),f(this.props,this._onRenderTitle),I&&n.createElement(Ht.a,{label:o}))):null},t.prototype._defaultCheckboxRender=function(e){return n.createElement(wa,{checked:e.checked})},t.prototype._fastDefaultCheckboxRender=function(e){return n.createElement(Ca,{theme:e.theme,checked:e.checked})},t.defaultProps={expandButtonProps:{"aria-label":"expand collapse group"}},t}(n.Component),Ca=n.memo((function(e){return n.createElement(wa,{theme:e.theme,checked:e.checked,className:e.className,useFastIcons:!0})})),_a=Object(z.a)(ka,(function(e){var t,r,n,a,i,o=e.theme,s=e.className,c=e.selected,u=e.isCollapsed,l=e.compact,d=fa.cellLeftPadding,p=l?40:48,f=o.semanticColors,g=o.palette,m=o.fonts,h=Object(K.a)(ba,o),b=[Object(ua.b)(o),{cursor:"default",background:"none",backgroundColor:"transparent",border:"none",padding:0}];return{root:[h.root,Object(ua.b)(o),o.fonts.medium,{borderBottom:"1px solid "+f.listBackground,cursor:"default",userSelect:"none",selectors:(t={":hover":{background:f.listItemBackgroundHovered,color:f.actionLinkHovered}},t["&:hover ."+h.check]={opacity:1},t["."+da.a+" &:focus ."+h.check]={opacity:1},t[":global(."+h.group+"."+h.isDropping+")"]={selectors:(r={},r["& > ."+h.root+" ."+h.dropIcon]={transition:"transform "+ra.b.durationValue4+" "+va+" opacity "+ra.b.durationValue1+" "+Sa,transitionDelay:ra.b.durationValue3,opacity:1,transform:"rotate(0.2deg) scale(1);"},r["."+h.check]={opacity:0},r)},t)},c&&[h.isSelected,{background:f.listItemBackgroundChecked,selectors:(n={":hover":{background:f.listItemBackgroundCheckedHovered}},n[""+h.check]={opacity:1},n)}],l&&[h.compact,{border:"none"}],s],groupHeaderContainer:[{display:"flex",alignItems:"center",height:p}],headerCount:[{padding:"0px 4px"}],check:[h.check,b,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:1,marginTop:-1,opacity:0,width:48,height:p,selectors:(a={},a["."+da.a+" &:focus"]={opacity:1},a)}],expand:[h.expand,b,{display:"flex",alignItems:"center",justifyContent:"center",fontSize:m.small.fontSize,width:36,height:p,color:c?g.neutralPrimary:g.neutralSecondary,selectors:{":hover":{backgroundColor:c?g.neutralQuaternary:g.neutralLight},":active":{backgroundColor:c?g.neutralTertiaryAlt:g.neutralQuaternaryAlt}}}],expandIsCollapsed:[u?[h.isCollapsed,{transform:"rotate(0deg)",transformOrigin:"50% 50%",transition:"transform .1s linear"}]:{transform:"rotate(90deg)",transformOrigin:"50% 50%",transition:"transform .1s linear"}],title:[h.title,{paddingLeft:d,fontSize:l?m.medium.fontSize:m.mediumPlus.fontSize,fontWeight:u?la.b.regular:la.b.semibold,cursor:"pointer",outline:0,whiteSpace:"nowrap",textOverflow:"ellipsis"}],dropIcon:[h.dropIcon,{position:"absolute",left:-26,fontSize:la.c.large,color:g.neutralSecondary,transition:"transform "+ra.b.durationValue2+" "+ya+", opacity "+ra.b.durationValue4+" "+Sa,opacity:0,transform:"rotate(0.2deg) scale(0.65)",transformOrigin:"10px 10px",selectors:(i={},i[":global(."+h.iconTag+")"]={position:"absolute"},i)}]}}),void 0,{scope:"GroupHeader"}),Ra={root:"ms-GroupShowAll",link:"ms-Link"},Pa=Object(re.a)(),Ta=Object(z.a)((function(e){var t=e.group,r=e.groupLevel,a=e.showAllLinkText,i=void 0===a?"Show All":a,o=e.styles,s=e.theme,c=e.onToggleSummarize,u=Pa(o,{theme:s}),l=Object(n.useCallback)((function(e){c(t),e.stopPropagation(),e.preventDefault()}),[c,t]);return t?n.createElement("div",{className:u.root},n.createElement(ma,{count:r}),n.createElement(j.a,{onClick:l},i)):null}),(function(e){var t,r=e.theme,n=r.fonts,a=Object(K.a)(Ra,r);return{root:[a.root,{position:"relative",padding:"10px 84px",cursor:"pointer",selectors:(t={},t["."+a.link]={fontSize:n.small.fontSize},t)}]}}),void 0,{scope:"GroupShowAll"}),Ia={root:"ms-groupFooter"},Da=Object(re.a)(),Aa=Object(z.a)((function(e){var t=e.group,r=e.groupLevel,a=e.footerText,i=e.indentWidth,o=e.styles,s=e.theme,c=Da(o,{theme:s});return t&&a?n.createElement("div",{className:c.root},n.createElement(ma,{indentWidth:i,count:r}),a):null}),(function(e){var t=e.theme,r=e.className,n=Object(K.a)(Ia,t);return{root:[t.fonts.medium,n.root,{position:"relative",padding:"5px 38px"},r]}}),void 0,{scope:"GroupFooter"}),Ma=r(1343),Na=function(e){function t(r){var a=e.call(this,r)||this;a._root=n.createRef(),a._list=n.createRef(),a._droppingClassName="",a._onRenderGroupHeader=function(e){return n.createElement(_a,Object(G.a)({},e))},a._onRenderGroupShowAll=function(e){return n.createElement(Ta,Object(G.a)({},e))},a._onRenderGroupFooter=function(e){return n.createElement(Aa,Object(G.a)({},e))},a._renderSubGroup=function(e,r){var i=a.props,o=i.dragDropEvents,s=i.dragDropHelper,c=i.eventsToRegister,u=i.getGroupItemLimit,l=i.groupNestingDepth,d=i.groupProps,p=i.items,f=i.headerProps,g=i.showAllProps,m=i.footerProps,h=i.listProps,b=i.onRenderCell,v=i.selection,S=i.selectionMode,y=i.viewport,O=i.onRenderGroupHeader,x=i.onRenderGroupShowAll,j=i.onRenderGroupFooter,w=i.onShouldVirtualize,E=i.group,k=i.compact,C=e.level?e.level+1:l;return!e||e.count>0||d&&d.showEmptyGroups?n.createElement(t,{ref:"subGroup_"+r,key:a._getGroupKey(e,r),dragDropEvents:o,dragDropHelper:s,eventsToRegister:c,footerProps:m,getGroupItemLimit:u,group:e,groupIndex:r,groupNestingDepth:C,groupProps:d,headerProps:f,items:p,listProps:h,onRenderCell:b,selection:v,selectionMode:S,showAllProps:g,viewport:y,onRenderGroupHeader:O,onRenderGroupShowAll:x,onRenderGroupFooter:j,onShouldVirtualize:w,groups:E?E.children:[],compact:k}):null},a._getGroupDragDropOptions=function(){var e=a.props,t=e.group,r=e.groupIndex,n=e.dragDropEvents;return{eventMap:e.eventsToRegister,selectionIndex:-1,context:{data:t,index:r,isGroup:!0},updateDropState:a._updateDroppingState,canDrag:n.canDrag,canDrop:n.canDrop,onDrop:n.onDrop,onDragStart:n.onDragStart,onDragEnter:n.onDragEnter,onDragLeave:n.onDragLeave,onDragEnd:n.onDragEnd,onDragOver:n.onDragOver}},a._updateDroppingState=function(e,t){var r=a.state.isDropping,n=a.props,i=n.dragDropEvents,o=n.group;r!==e&&(r?i&&i.onDragLeave&&i.onDragLeave(o,t):i&&i.onDragEnter&&(a._droppingClassName=i.onDragEnter(o,t)),a.setState({isDropping:e}))};var i=r.selection,o=r.group;return Object(ne.a)(a),a._id=Object(oa.a)("GroupedListSection"),a.state={isDropping:!1,isSelected:!(!i||!o)&&i.isRangeSelected(o.startIndex,o.count)},a._events=new sa.a(a),a}return Object(G.c)(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.dragDropHelper,r=e.selection;t&&this._root.current&&(this._dragDropSubscription=t.subscribe(this._root.current,this._events,this._getGroupDragDropOptions())),r&&this._events.on(r,"change",this._onSelectionChange)},t.prototype.componentWillUnmount=function(){this._events.dispose(),this._dragDropSubscription&&this._dragDropSubscription.dispose()},t.prototype.componentDidUpdate=function(e){this.props.group===e.group&&this.props.groupIndex===e.groupIndex&&this.props.dragDropHelper===e.dragDropHelper||(this._dragDropSubscription&&(this._dragDropSubscription.dispose(),delete this._dragDropSubscription),this.props.dragDropHelper&&this._root.current&&(this._dragDropSubscription=this.props.dragDropHelper.subscribe(this._root.current,this._events,this._getGroupDragDropOptions())))},t.prototype.render=function(){var e=this.props,t=e.getGroupItemLimit,r=e.group,a=e.groupIndex,i=e.headerProps,o=e.showAllProps,s=e.footerProps,c=e.viewport,u=e.selectionMode,l=e.onRenderGroupHeader,d=void 0===l?this._onRenderGroupHeader:l,p=e.onRenderGroupShowAll,f=void 0===p?this._onRenderGroupShowAll:p,g=e.onRenderGroupFooter,m=void 0===g?this._onRenderGroupFooter:g,h=e.onShouldVirtualize,b=e.groupedListClassNames,v=e.groups,S=e.compact,y=e.listProps,O=void 0===y?{}:y,x=this.state.isSelected,j=r&&t?t(r):1/0,w=r&&!r.children&&!r.isCollapsed&&!r.isShowingAll&&(r.count>j||r.hasMoreData),E=r&&r.children&&r.children.length>0,k=O.version,C={group:r,groupIndex:a,groupLevel:r?r.level:0,isSelected:x,selected:x,viewport:c,selectionMode:u,groups:v,compact:S},_={groupedListId:this._id,ariaSetSize:v?v.length:void 0,ariaPosInSet:void 0!==a?a+1:void 0},R=Object(G.a)(Object(G.a)(Object(G.a)({},i),C),_),P=Object(G.a)(Object(G.a)({},o),C),T=Object(G.a)(Object(G.a)({},s),C),I=!!this.props.dragDropHelper&&this._getGroupDragDropOptions().canDrag(r)&&!!this.props.dragDropEvents.canDragGroups;return n.createElement("div",Object(G.a)({ref:this._root},I&&{draggable:!0},{className:Object(ca.a)(b&&b.group,this._getDroppingClassName()),role:"presentation"}),d(R,this._onRenderGroupHeader),r&&r.isCollapsed?null:E?n.createElement(Ma.a,{role:"presentation",ref:this._list,items:r?r.children:[],onRenderCell:this._renderSubGroup,getItemCountForPage:this._returnOne,onShouldVirtualize:h,version:k,id:this._id}):this._onRenderGroup(j),r&&r.isCollapsed?null:w&&f(P,this._onRenderGroupShowAll),m(T,this._onRenderGroupFooter))},t.prototype.forceUpdate=function(){e.prototype.forceUpdate.call(this),this.forceListUpdate()},t.prototype.forceListUpdate=function(){var e=this.props.group;if(this._list.current){if(this._list.current.forceUpdate(),e&&e.children&&e.children.length>0)for(var t=e.children.length,r=0;r<t;r++){var n;(n=this._list.current.refs["subGroup_"+String(r)])&&n.forceListUpdate()}}else(n=this.refs["subGroup_"+String(0)])&&n.forceListUpdate()},t.prototype._onSelectionChange=function(){var e=this.props,t=e.group,r=e.selection;if(r&&t){var n=r.isRangeSelected(t.startIndex,t.count);n!==this.state.isSelected&&this.setState({isSelected:n})}},t.prototype._onRenderGroupCell=function(e,t){return function(r,n){return e(t,r,n)}},t.prototype._onRenderGroup=function(e){var t=this.props,r=t.group,a=t.items,i=t.onRenderCell,o=t.listProps,s=t.groupNestingDepth,c=t.onShouldVirtualize,u=t.groupProps,l=r&&!r.isShowingAll?r.count:a.length,d=r?r.startIndex:0;return n.createElement(Ma.a,Object(G.a)({role:u&&u.role?u.role:"grid",items:a,onRenderCell:this._onRenderGroupCell(i,s),ref:this._list,renderCount:Math.min(l,e),startIndex:d,onShouldVirtualize:c,id:this._id},o))},t.prototype._returnOne=function(){return 1},t.prototype._getGroupKey=function(e,t){return"group-"+(e&&e.key?e.key:String(e.level)+String(t))},t.prototype._getDroppingClassName=function(){var e=this.state.isDropping,t=this.props,r=t.group,n=t.groupedListClassNames;return e=!(!r||!e),Object(ca.a)(e&&this._droppingClassName,e&&"is-dropping",e&&n&&n.groupIsDropping)},t}(n.Component),La=Object(re.a)(),Ba=ga.rowHeight,Fa=ga.compactRowHeight,Wa=function(e){function t(t){var r=e.call(this,t)||this;return r._list=n.createRef(),r._renderGroup=function(e,t){var a=r.props,i=a.dragDropEvents,o=a.dragDropHelper,s=a.eventsToRegister,c=a.groupProps,u=a.items,l=a.listProps,d=a.onRenderCell,p=a.selectionMode,f=a.selection,g=a.viewport,m=a.onShouldVirtualize,h=a.groups,b=a.compact,v={onToggleSelectGroup:r._onToggleSelectGroup,onToggleCollapse:r._onToggleCollapse,onToggleSummarize:r._onToggleSummarize},S=Object(G.a)(Object(G.a)({},c.headerProps),v),y=Object(G.a)(Object(G.a)({},c.showAllProps),v),O=Object(G.a)(Object(G.a)({},c.footerProps),v),x=r._getGroupNestingDepth();return!c.showEmptyGroups&&e&&0===e.count?null:n.createElement(Na,{ref:"group_"+t,key:r._getGroupKey(e,t),dragDropEvents:i,dragDropHelper:o,eventsToRegister:s,footerProps:O,getGroupItemLimit:c&&c.getGroupItemLimit,group:e,groupIndex:t,groupNestingDepth:x,groupProps:c,headerProps:S,listProps:l,items:u,onRenderCell:d,onRenderGroupHeader:c.onRenderHeader,onRenderGroupShowAll:c.onRenderShowAll,onRenderGroupFooter:c.onRenderFooter,selectionMode:p,selection:f,showAllProps:y,viewport:g,onShouldVirtualize:m,groupedListClassNames:r._classNames,groups:h,compact:b})},r._getDefaultGroupItemLimit=function(e){return e.count},r._getGroupItemLimit=function(e){var t=r.props.groupProps;return(t&&t.getGroupItemLimit?t.getGroupItemLimit:r._getDefaultGroupItemLimit)(e)},r._getGroupHeight=function(e){var t=r.props.compact?Fa:Ba;return t+(e.isCollapsed?0:t*r._getGroupItemLimit(e))},r._getPageHeight=function(e){var t=r.state.groups,n=r.props.getGroupHeight,a=void 0===n?r._getGroupHeight:n,i=t&&t[e];return i?a(i,e):0},r._onToggleCollapse=function(e){var t=r.props.groupProps,n=t&&t.headerProps&&t.headerProps.onToggleCollapse;e&&(n&&n(e),e.isCollapsed=!e.isCollapsed,r._updateIsSomeGroupExpanded(),r.forceUpdate())},r._onToggleSelectGroup=function(e){var t=r.props,n=t.selection,a=t.selectionMode;e&&n&&a===Zn.multiple&&n.toggleRangeSelected(e.startIndex,e.count)},r._onToggleSummarize=function(e){var t=r.props.groupProps,n=t&&t.showAllProps&&t.showAllProps.onToggleSummarize;n?n(e):(e&&(e.isShowingAll=!e.isShowingAll),r.forceUpdate())},r._getPageSpecification=function(e){var t=r.state.groups,n=t&&t[e];return{key:n&&n.key}},Object(ne.a)(r),r._isSomeGroupExpanded=r._computeIsSomeGroupExpanded(t.groups),r.state={lastWidth:0,groups:t.groups},r}return Object(G.c)(t,e),t.prototype.scrollToIndex=function(e,t,r){this._list.current&&this._list.current.scrollToIndex(e,t,r)},t.prototype.getStartItemIndexInView=function(){return this._list.current.getStartItemIndexInView()||0},t.prototype.UNSAFE_componentWillReceiveProps=function(e){var t=this.props,r=t.groups,n=t.selectionMode,a=t.compact,i=!1;e.groups!==r&&(this.setState({groups:e.groups}),i=!0),e.selectionMode===n&&e.compact===a||(i=!0),i&&this._forceListUpdates()},t.prototype.componentDidMount=function(){var e=this.props,t=e.groupProps,r=e.groups,n=void 0===r?[]:r;t&&t.isAllGroupsCollapsed&&this._setGroupsCollapsedState(n,t.isAllGroupsCollapsed)},t.prototype.render=function(){var e=this.props,t=e.className,r=e.usePageCache,a=e.onShouldVirtualize,i=e.theme,o=e.styles,s=e.compact,c=e.listProps,u=void 0===c?{}:c,l=this.state.groups;this._classNames=La(o,{theme:i,className:t,compact:s});var d=u.version;return n.createElement("div",{className:this._classNames.root,"data-automationid":"GroupedList","data-is-scrollable":"false",role:"presentation"},n.createElement(ia.a,null),l?n.createElement(Ma.a,{ref:this._list,role:"presentation",items:l,onRenderCell:this._renderGroup,getItemCountForPage:this._returnOne,getPageHeight:this._getPageHeight,getPageSpecification:this._getPageSpecification,usePageCache:r,onShouldVirtualize:a,version:d}):this._renderGroup(void 0,0))},t.prototype.forceUpdate=function(){e.prototype.forceUpdate.call(this),this._forceListUpdates()},t.prototype.toggleCollapseAll=function(e){var t=this.state.groups,r=void 0===t?[]:t,n=this.props.groupProps,a=n&&n.onToggleCollapseAll;r.length>0&&(a&&a(e),this._setGroupsCollapsedState(r,e),this._updateIsSomeGroupExpanded(),this.forceUpdate())},t.prototype._setGroupsCollapsedState=function(e,t){for(var r=0;r<e.length;r++)e[r].isCollapsed=t},t.prototype._returnOne=function(){return 1},t.prototype._getGroupKey=function(e,t){return"group-"+(e&&e.key?e.key:String(t))},t.prototype._getGroupNestingDepth=function(){for(var e=0,t=this.state.groups;t&&t.length>0;)e++,t=t[0].children;return e},t.prototype._forceListUpdates=function(e){var t=(e=e||this.state.groups)?e.length:1;if(this._list.current){this._list.current.forceUpdate();for(var r=0;r<t;r++){(n=this._list.current.refs["group_"+String(r)])&&n.forceListUpdate()}}else{var n;(n=this.refs["group_"+String(0)])&&n.forceListUpdate()}},t.prototype._computeIsSomeGroupExpanded=function(e){var t=this;return!(!e||!e.some((function(e){return e.children?t._computeIsSomeGroupExpanded(e.children):!e.isCollapsed})))},t.prototype._updateIsSomeGroupExpanded=function(){var e=this.state.groups,t=this.props.onGroupExpandStateChanged,r=this._computeIsSomeGroupExpanded(e);this._isSomeGroupExpanded!==r&&(t&&t(r),this._isSomeGroupExpanded=r)},t.defaultProps={selectionMode:Zn.multiple,isHeaderVisible:!0,groupProps:{},compact:!1},t}(n.Component),Ua=Object(z.a)(Wa,(function(e){var t,r,n=e.theme,a=e.className,i=e.compact,o=n.palette,s=Object(K.a)(na,n);return{root:[s.root,n.fonts.small,{position:"relative",selectors:(t={},t["."+s.listCell]={minHeight:38},t)},i&&[s.compact,{selectors:(r={},r["."+s.listCell]={minHeight:32},r)}],a],group:[s.group,{transition:"background-color "+ra.b.durationValue2+" "+aa}],groupIsDropping:{backgroundColor:o.neutralLight}}}),void 0,{scope:"GroupedList"}),Ha=r(777);var za=r(129);var Ga=Object(re.a)(),Va=function(e){function t(t){var r=e.call(this,t)||this;r._textElement=n.createRef(),r._onFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({isFocused:!0},(function(){r.props.validateOnFocusIn&&r._validate(r.value)}))},r._onBlur=function(e){r.props.onBlur&&r.props.onBlur(e),r.setState({isFocused:!1},(function(){r.props.validateOnFocusOut&&r._validate(r.value)}))},r._onRenderLabel=function(e){var t=e.label,a=e.required,i=r._classNames.subComponentStyles?r._classNames.subComponentStyles.label:void 0;return t?n.createElement(x.a,{required:a,htmlFor:r._id,styles:i,disabled:e.disabled,id:r._labelId},e.label):null},r._onRenderDescription=function(e){return e.description?n.createElement("span",{className:r._classNames.description},e.description):null},r._onInputChange=function(e){var t,n=e.target.value;void 0!==n&&n!==r._lastChangeValue&&(r._lastChangeValue=n,e.persist(),r.setState((function(e,a){var i=Ka(a,e)||"";return(t=n===i)||r._isControlled?null:{uncontrolledValue:n}}),(function(){var a=r.props.onChange;!t&&a&&a(e,n)})))},Object(ne.a)(r),r._async=new ae.a(r),r._fallbackId=Object(oa.a)("TextField"),r._descriptionId=Object(oa.a)("TextFieldDescription"),r._labelId=Object(oa.a)("TextFieldLabel"),r._warnControlledUsage();var a=t.defaultValue,i=void 0===a?"":a;return"number"===typeof i&&(i=String(i)),r.state={uncontrolledValue:r._isControlled?void 0:i,isFocused:!1,errorMessage:""},r._delayedValidate=r._async.debounce(r._validate,r.props.deferredValidationTime),r._lastValidation=0,r}return Object(G.c)(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return Ka(this.props,this.state)},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){this._adjustInputHeight(),this.props.validateOnLoad&&this._validate(this.value)},t.prototype.componentWillUnmount=function(){this._async.dispose()},t.prototype.getSnapshotBeforeUpdate=function(e,t){return{selection:[this.selectionStart,this.selectionEnd]}},t.prototype.componentDidUpdate=function(e,t,r){var n=this.props,a=(r||{}).selection,i=void 0===a?[null,null]:a,o=i[0],s=i[1];!!e.multiline!==!!n.multiline&&t.isFocused&&(this.focus(),null!==o&&null!==s&&o>=0&&s>=0&&this.setSelectionRange(o,s));var c=Ka(e,t),u=this.value;c!==u&&(this._warnControlledUsage(e),this.state.errorMessage&&!n.errorMessage&&this.setState({errorMessage:""}),this._adjustInputHeight(),this._lastChangeValue=void 0,qa(n)&&this._delayedValidate(u))},t.prototype.render=function(){var e=this.props,t=e.borderless,r=e.className,a=e.disabled,i=e.iconProps,o=e.inputClassName,s=e.label,c=e.multiline,u=e.required,l=e.underlined,d=e.prefix,p=e.resizable,f=e.suffix,g=e.theme,m=e.styles,h=e.autoAdjustHeight,b=e.onRenderPrefix,v=void 0===b?this._onRenderPrefix:b,y=e.onRenderSuffix,O=void 0===y?this._onRenderSuffix:y,x=e.onRenderLabel,j=void 0===x?this._onRenderLabel:x,w=e.onRenderDescription,E=void 0===w?this._onRenderDescription:w,k=this.state.isFocused,C=this._errorMessage;return this._classNames=Ga(m,{theme:g,className:r,disabled:a,focused:k,required:u,multiline:c,hasLabel:!!s,hasErrorMessage:!!C,borderless:t,resizable:p,hasIcon:!!i,underlined:l,inputClassName:o,autoAdjustHeight:h}),n.createElement("div",{className:this._classNames.root},n.createElement("div",{className:this._classNames.wrapper},j(this.props,this._onRenderLabel),n.createElement("div",{className:this._classNames.fieldGroup},(void 0!==d||this.props.onRenderPrefix)&&n.createElement("div",{className:this._classNames.prefix},v(this.props,this._onRenderPrefix)),c?this._renderTextArea():this._renderInput(),i&&n.createElement(S.a,Object(G.a)({className:this._classNames.icon},i)),(void 0!==f||this.props.onRenderSuffix)&&n.createElement("div",{className:this._classNames.suffix},O(this.props,this._onRenderSuffix)))),this._isDescriptionAvailable&&n.createElement("span",{id:this._descriptionId},E(this.props,this._onRenderDescription),C&&n.createElement("div",{role:"alert"},n.createElement(oe.a,null,n.createElement("p",{className:this._classNames.errorMessage},n.createElement("span",{"data-automation-id":"error-message"},C))))))},t.prototype.focus=function(){this._textElement.current&&this._textElement.current.focus()},t.prototype.blur=function(){this._textElement.current&&this._textElement.current.blur()},t.prototype.select=function(){this._textElement.current&&this._textElement.current.select()},t.prototype.setSelectionStart=function(e){this._textElement.current&&(this._textElement.current.selectionStart=e)},t.prototype.setSelectionEnd=function(e){this._textElement.current&&(this._textElement.current.selectionEnd=e)},Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._textElement.current?this._textElement.current.selectionStart:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._textElement.current?this._textElement.current.selectionEnd:-1},enumerable:!0,configurable:!0}),t.prototype.setSelectionRange=function(e,t){this._textElement.current&&this._textElement.current.setSelectionRange(e,t)},t.prototype._warnControlledUsage=function(e){this._id,this.props,null!==this.props.value||this._hasWarnedNullValue||(this._hasWarnedNullValue=!0,Object(za.a)("Warning: 'value' prop on 'TextField' should not be null. Consider using an empty string to clear the component or undefined to indicate an uncontrolled component."))},Object.defineProperty(t.prototype,"_id",{get:function(){return this.props.id||this._fallbackId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_isControlled",{get:function(){return void 0!==(e=this.props)[t="value"]&&null!==e[t];var e,t},enumerable:!0,configurable:!0}),t.prototype._onRenderPrefix=function(e){var t=e.prefix;return n.createElement("span",{style:{paddingBottom:"1px"}},t)},t.prototype._onRenderSuffix=function(e){var t=e.suffix;return n.createElement("span",{style:{paddingBottom:"1px"}},t)},Object.defineProperty(t.prototype,"_errorMessage",{get:function(){var e=this.props.errorMessage;return(void 0===e?this.state.errorMessage:e)||""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_isDescriptionAvailable",{get:function(){var e=this.props;return!!(e.onRenderDescription||e.description||this._errorMessage)},enumerable:!0,configurable:!0}),t.prototype._renderTextArea=function(){var e=Object(ie.d)(this.props,ie.h,["defaultValue"]),t=this.props["aria-labelledby"]||(this.props.label?this._labelId:void 0);return n.createElement("textarea",Object(G.a)({id:this._id},e,{ref:this._textElement,value:this.value||"",onInput:this._onInputChange,onChange:this._onInputChange,className:this._classNames.field,"aria-labelledby":t,"aria-describedby":this._isDescriptionAvailable?this._descriptionId:this.props["aria-describedby"],"aria-invalid":!!this._errorMessage,"aria-label":this.props.ariaLabel,readOnly:this.props.readOnly,onFocus:this._onFocus,onBlur:this._onBlur}))},t.prototype._renderInput=function(){var e=Object(ie.d)(this.props,ie.g,["defaultValue"]),t=this.props["aria-labelledby"]||(this.props.label?this._labelId:void 0);return n.createElement("input",Object(G.a)({type:"text",id:this._id,"aria-labelledby":t},e,{ref:this._textElement,value:this.value||"",onInput:this._onInputChange,onChange:this._onInputChange,className:this._classNames.field,"aria-label":this.props.ariaLabel,"aria-describedby":this._isDescriptionAvailable?this._descriptionId:this.props["aria-describedby"],"aria-invalid":!!this._errorMessage,readOnly:this.props.readOnly,onFocus:this._onFocus,onBlur:this._onBlur}))},t.prototype._validate=function(e){var t=this;if(this._latestValidateValue!==e||!qa(this.props)){this._latestValidateValue=e;var r=this.props.onGetErrorMessage,n=r&&r(e||"");if(void 0!==n)if("string"!==typeof n&&"then"in n){var a=++this._lastValidation;n.then((function(r){a===t._lastValidation&&t.setState({errorMessage:r}),t._notifyAfterValidate(e,r)}))}else this.setState({errorMessage:n}),this._notifyAfterValidate(e,n);else this._notifyAfterValidate(e,"")}},t.prototype._notifyAfterValidate=function(e,t){e===this.value&&this.props.onNotifyValidationResult&&this.props.onNotifyValidationResult(t,e)},t.prototype._adjustInputHeight=function(){if(this._textElement.current&&this.props.autoAdjustHeight&&this.props.multiline){var e=this._textElement.current;e.style.height="",e.style.height=e.scrollHeight+"px"}},t.defaultProps={resizable:!0,deferredValidationTime:200,validateOnLoad:!0},t}(n.Component);function Ka(e,t){var r=e.value,n=void 0===r?t.uncontrolledValue:r;return"number"===typeof n?String(n):n}function qa(e){return!(e.validateOnFocusIn||e.validateOnFocusOut)}var Ja=r(960);function Qa(e){return{selectors:{"::placeholder":e,":-ms-input-placeholder":e,"::-ms-input-placeholder":e}}}var Za={root:"ms-TextField",description:"ms-TextField-description",errorMessage:"ms-TextField-errorMessage",field:"ms-TextField-field",fieldGroup:"ms-TextField-fieldGroup",prefix:"ms-TextField-prefix",suffix:"ms-TextField-suffix",wrapper:"ms-TextField-wrapper",multiline:"ms-TextField--multiline",borderless:"ms-TextField--borderless",underlined:"ms-TextField--underlined",unresizable:"ms-TextField--unresizable",required:"is-required",disabled:"is-disabled",active:"is-active"};function Ya(e){var t=e.underlined,r=e.disabled,n=e.focused,a=e.theme,i=a.palette,o=a.fonts;return function(){var e;return{root:[t&&r&&{color:i.neutralTertiary},t&&{fontSize:o.medium.fontSize,marginRight:8,paddingLeft:12,paddingRight:0,lineHeight:"22px",height:32},t&&n&&{selectors:(e={},e[q.a]={height:31},e)}]}}}var Xa=Object(z.a)(Va,(function(e){var t,r,n,a,i,o,s,c=e.theme,u=e.className,l=e.disabled,d=e.focused,p=e.required,f=e.multiline,g=e.hasLabel,m=e.borderless,h=e.underlined,b=e.hasIcon,v=e.resizable,S=e.hasErrorMessage,y=e.inputClassName,O=e.autoAdjustHeight,x=c.semanticColors,j=c.effects,w=c.fonts,E=Object(K.a)(Za,c),k={background:x.disabledBackground,color:l?x.disabledText:x.inputPlaceholderText,display:"flex",alignItems:"center",padding:"0 10px",lineHeight:1,whiteSpace:"nowrap",flexShrink:0},C=[w.medium,{color:x.inputPlaceholderText,opacity:1}],_={color:x.disabledText};return{root:[E.root,w.medium,p&&E.required,l&&E.disabled,d&&E.active,f&&E.multiline,m&&E.borderless,h&&E.underlined,Ja.a,{position:"relative"},u],wrapper:[E.wrapper,h&&[{display:"flex",borderBottom:"1px solid "+(S?x.errorText:x.inputBorder),width:"100%"},l&&{borderBottomColor:x.disabledBackground,selectors:(t={},t[q.a]={borderColor:"GrayText"},t)},!l&&{selectors:{":hover":{borderBottomColor:S?x.errorText:x.inputBorderHovered,selectors:(r={},r[q.a]={borderBottomColor:"Highlight"},r)}}},d&&[{position:"relative"},Object(ua.c)(S?x.errorText:x.inputFocusBorderAlt,0,"borderBottom")]]],fieldGroup:[E.fieldGroup,Ja.a,{border:"1px solid "+x.inputBorder,borderRadius:j.roundedCorner2,background:x.inputBackground,cursor:"text",height:32,display:"flex",flexDirection:"row",alignItems:"stretch",position:"relative"},f&&{minHeight:"60px",height:"auto",display:"flex"},!d&&!l&&{selectors:{":hover":{borderColor:x.inputBorderHovered,selectors:(n={},n[q.a]={borderColor:"Highlight"},n)}}},d&&!h&&Object(ua.c)(S?x.errorText:x.inputFocusBorderAlt,j.roundedCorner2),l&&{borderColor:x.disabledBackground,selectors:(a={},a[q.a]={borderColor:"GrayText"},a),cursor:"default"},m&&{border:"none"},m&&d&&{border:"none",selectors:{":after":{border:"none"}}},h&&{flex:"1 1 0px",border:"none",textAlign:"left"},h&&l&&{backgroundColor:"transparent"},S&&!h&&{borderColor:x.errorText,selectors:{"&:hover":{borderColor:x.errorText}}},!g&&p&&{selectors:(i={":before":{content:"'*'",color:x.errorText,position:"absolute",top:-5,right:-10}},i[q.a]={selectors:{":before":{right:-14}}},i)}],field:[w.medium,E.field,Ja.a,{borderRadius:0,border:"none",background:"none",backgroundColor:"transparent",color:x.inputText,padding:"0 8px",width:"100%",minWidth:0,textOverflow:"ellipsis",outline:0,selectors:{"&:active, &:focus, &:hover":{outline:0},"::-ms-clear":{display:"none"}}},Qa(C),f&&!v&&[E.unresizable,{resize:"none"}],f&&{minHeight:"inherit",lineHeight:17,flexGrow:1,paddingTop:6,paddingBottom:6,overflow:"auto",width:"100%"},f&&O&&{overflow:"hidden"},b&&{paddingRight:24},f&&b&&{paddingRight:40},l&&[{backgroundColor:x.disabledBackground,color:x.disabledText,borderColor:x.disabledBackground},Qa(_)],h&&{textAlign:"left"},d&&!m&&{selectors:(o={},o[q.a]={paddingLeft:11,paddingRight:11},o)},d&&f&&!m&&{selectors:(s={},s[q.a]={paddingTop:4},s)},y],icon:[f&&{paddingRight:24,alignItems:"flex-end"},{pointerEvents:"none",position:"absolute",bottom:6,right:8,top:"auto",fontSize:la.c.medium,lineHeight:18},l&&{color:x.disabledText}],description:[E.description,{color:x.bodySubtext,fontSize:w.xSmall.fontSize}],errorMessage:[E.errorMessage,pa.a.slideDownIn20,w.small,{color:x.errorText,margin:0,paddingTop:5,display:"flex",alignItems:"center"}],prefix:[E.prefix,k],suffix:[E.suffix,k],subComponentStyles:{label:Ya(e)}}}),void 0,{scope:"TextField"});function $a(){return($a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var ei=Object(l.c)((function(e){var t=e.text,r=e.makeEdit,i=e.onBlurAction,o=e.readOnly,s=e.fontWeight,c=e.fontSize,u=e.multilineTextfield,l=e.placeholderText,p=e.takerLabelRole,f=e.theme,g=e.getErrorMessage,m=e.errorDeferredValidationTime,h=e.buttonTestId,b=e.originalPage,v=e.editMode,S=e.setEditMode,y=e.shouldFocus,O=e.setShouldFocus,j=e.sendButtonClickTelemetry,w=e.setButtonHasFocus,E=e.onEscapeAction,k=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,["text","makeEdit","onBlurAction","readOnly","fontWeight","fontSize","multilineTextfield","placeholderText","takerLabelRole","theme","getErrorMessage","errorDeferredValidationTime","buttonTestId","originalPage","editMode","setEditMode","shouldFocus","setShouldFocus","sendButtonClickTelemetry","setButtonHasFocus","onEscapeAction"]);if(!t&&!l)return null;var C=a.a.createRef();return Object(n.useEffect)((function(){C.current&&!v&&y&&C.current.focus(),O(!1)}),[v,y]),a.a.createElement("div",$a({},k,{style:"Editor"===b?{width:"100%",minWidth:"0",display:"flex",alignItems:"center",wordBreak:"break-word"}:{width:"100%",display:"flex",alignItems:"center",wordBreak:"break-word"}}),o?t?a.a.createElement(x.a,{role:p||"heading",styles:ni(f,s,c,b)},t):null:v?a.a.createElement(Xa,{onKeyDown:function(e){if("Enter"===e.key)if(u&&e.shiftKey)t.split("\n").length<6?t+="\n":e.preventDefault();else{e.preventDefault();try{i(),O(!0),S(!1)}catch(r){}}else"Escape"===e.key&&(E(),O(!0),S(!1))},onChange:function(e,t){void 0!==t&&null!==t?r(t):Object(d.g)(new Error("Unexpected null or undefined TextField value"),"Unexpected",d.a.Error)},onBlur:function(){try{i(),void 0!==w&&w(!1),S(!1)}catch(e){}},autoFocus:!0,contentEditable:!0,deferredValidationTime:m,onGetErrorMessage:g,defaultValue:t,styles:ii(f,s,c,b),multiline:u,autoAdjustHeight:u}):a.a.createElement(Te.a,{content:t||l,overflowMode:Ie.a.Self,styles:ti(b)},a.a.createElement(Ha.a,{"data-testid":h,onClick:function(){S(!o),void 0!=j&&j()},text:t||l,styles:ri({theme:f,textFontWeight:s,textFontSize:c,readOnly:o,multilineTextfield:u,placeholderOnly:!t,originalPage:b}),ariaLabel:strings.substitute(strings.Details.EditableLabelAriaLabel,{editableLabelContents:t}),componentRef:C})))})),ti=function(e){return"Editor"===e?{root:{width:"100%",margin:"0 0.7rem",minWidth:"0"}}:{root:{width:"100%"}}},ri=function(e){var t=e.theme,r=e.textFontWeight,n=e.multilineTextfield,a=e.placeholderOnly,i=e.textFontSize,o=e.originalPage;return{root:{padding:"Details"===o?"0.2rem 0":"0.6rem 0",background:"none",border:"none",width:"100%",maxWidth:"101%",cursor:"pointer",textAlign:"left",margin:"Editor"===o?"0 0.1rem 0.2rem 0.1rem":"0.1rem",selectors:{"&:focus":{outline:"none"}},textOverflow:n?"inherit":"ellipsis",whiteSpace:n?"pre-wrap":"nowrap",overflow:n?"visible":"hidden"},textContainer:{padding:"0.6rem 0",fontSize:i||t.fontSizes.medium,fontWeight:r||t.fontWeights.semibold,color:t.colors.neutralPrimary,textAlign:"left"},label:{color:a?t.colors.neutralSecondary:t.colors.neutralPrimary,textAlign:"left"}}},ni=function(e,t,r,n){return"Editor"===n?{root:{fontSize:r||e.fontSizes.medium,fontWeight:t||e.fontWeights.semibold,margin:"0 0.7rem"}}:{root:{fontSize:r||e.fontSizes.medium,fontWeight:t||e.fontWeights.semibold}}},ai=function(e,t,r){return{field:{fontSize:r||e.fontSizes.medium,fontWeight:t||e.fontWeights.semibold,color:e.colors.neutralPrimary},fieldGroup:{borderWidth:"1px",selectors:{"::after":{borderWidth:"1px"}}},errorMessage:{fontSize:e.fontSizes.small,color:e.colors.redText}}},ii=function(e,t,r,n){return $a({},ai(e,t,r),"Editor"===n?{root:{width:"100%",minWidth:"0",margin:"0 0.3rem 0.2rem"}}:{root:{width:"100%",margin:"0rem 0 0.1rem"}})},oi=r(236);function si(){var e=ui(["\n padding: ",";\n"]);return si=function(){return e},e}function ci(){var e=ui(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding-top: ",";\n"]);return ci=function(){return e},e}function ui(e,t){return t||(t=e.slice(0)),e.raw=t,e}var li=Object(l.c)((function(e){var t=e.theme,r=e.isScriptShared,n=r?strings.Details.CurrentOrgHasAccessText:strings.Details.OnlyCurrentUserHasAccessText;return a.a.createElement(a.a.Fragment,null,a.a.createElement(di,null,r?a.a.createElement(pi,null,a.a.createElement(xa.a,{iconName:"WorkbookSharingToken24"})):a.a.createElement(pi,null,a.a.createElement(xa.a,{iconName:"ProtectForm"})),a.a.createElement(x.a,{styles:fi(t),"data-testid":Object(m.a)("AccessInThisWorkbookText")},n)))})),di=l.b.div(ci(),(function(e){return e.theme.spacing.xSmall})),pi=l.b.div(si(),(function(e){return Object(Z.a)()?"0 0 0 "+e.theme.spacing.medium:"0 "+e.theme.spacing.medium+" 0 0"})),fi=function(e){return{root:{fontSize:e.fontSizes.small,color:e.colors.neutralPrimary,fontWeight:e.fontWeights.regular}}},gi=Object(l.c)((function(e){var t=e.showConsentDialog,r=e.isScriptRunning,n=e.isStorageCallInProgress,i=e.script,o=e.theme,s=function(e,t,r){return!!e&&Object(Ne.a)(e)&&!Object(Le.a)(e)&&!r&&!t}(i,r,n);return a.a.createElement(a.a.Fragment,null,a.a.createElement(j.a,{onClick:t,styles:mi(o,s),disabled:!s},strings.Details.RunPermissionLinkText))})),mi=function(e,t){return{root:{fontSize:e.fontSizes.small,color:t?e.colors.linkText:e.colors.neutralSecondary,selectors:{":focus":{color:e.colors.linkText},":hover":{color:t?e.colors.linkTextHovered:e.colors.neutralSecondary,textDecoration:t?"underline":"none"}},cursor:t?"pointer":"not-allowed"}}},hi=r(698),bi=r(729),vi=r.n(bi),Si=r(757),yi="all",Oi=new Si.a("EditorSettings",5e3,0,{canPurge:function(){return!1},compare:function(){return 0}}),xi=!1,ji=new Si.a("PerScriptSettings",5e3,0,{canPurge:function(){return!1},compare:function(){return 0}}),wi=function(e){return ji.read(e)||Object(kn.c)()},Ei=function(e){ji.purge(e)};function ki(){var e=Ti(["\n padding-top: 5px;\n"]);return ki=function(){return e},e}function Ci(){var e=Ti(["\n padding: ",";\n"]);return Ci=function(){return e},e}function _i(){var e=Ti(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n"]);return _i=function(){return e},e}function Ri(){var e=Ti(["\n padding: 10px 20px 14px 20px;\n"]);return Ri=function(){return e},e}function Pi(){var e=Ti(["\n padding: 0.8rem 2rem 1.2rem;\n"]);return Pi=function(){return e},e}function Ti(e,t){return t||(t=e.slice(0)),e.raw=t,e}function Ii(){return(Ii=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Di=Object(l.c)((function(e){var t=e.theme,r=e.script,i=e.saveScript,o=e.isScriptOwner,s=e.showConsentDialog,c=e.isScriptRunning,u=e.isStorageCallInProgress,l=r&&r.storageScript.description?r.storageScript.description:"",d=Object(n.useState)(l),p=d[0],f=d[1],g=Object(n.useState)(Object(Kr.isScriptDescriptionValid)(p)),m=g[0],h=g[1],b=Object(n.useState)(!1),v=b[0],S=b[1],y=Object(n.useState)(!1),O=y[0],x=y[1];return Object(n.useEffect)((function(){r.storageScript.description&&f(r.storageScript.description)}),[r.storageScript.description]),a.a.createElement(Fi,null,a.a.createElement(Ua,{items:Li(r,l,p,f,m,h,t,i,v,S,O,x,o,s,c,u,o),onRenderCell:Ai,groups:Bi(r,o),groupProps:Ni(t),selectionMode:Zn.none}))})),Ai=function(e,t,r){return t&&"number"===typeof r&&r>-1?t:null},Mi=function(e){var t=function(){(null==e?void 0:e.onToggleCollapse)&&e.group&&(null==e||e.onToggleCollapse(e.group));var t,r,n=null==e?void 0:e.group;if(n&&n.data){var a=wi(n.data.storageId);a.storageId=n.data.storageId,a.isOwner=n.data.isOwner;var i=n.key;a.groupSectionStatus[i]=!a.groupSectionStatus[i],t=n.data.storageId,r=a,ji.write(t,r)||Object(d.g)(new Error("Failed to write per script settings"),"Unexpected",d.a.Warning)}};return a.a.createElement(_a,Ii({},e,{onToggleCollapse:t,onToggleSelectGroup:t}))},Ni=function(e){return{headerProps:{styles:{groupHeaderContainer:{display:"block",height:"32px",width:"auto",border:"1px solid transparent",boxSizing:"border-box",whiteSpace:"nowrap"},headerCount:{display:"none"},title:{display:"inline-block",fontSize:"14px",cursor:"default",padding:"3px 0 3px 0",lineHeight:"24px",whiteSpace:"nowrap",verticalAlign:"middle"},root:{border:"none",selectors:{":hover":{backgroundColor:e.colors.neutralQuaternaryAlt}}}},expandButtonIcon:"ChevronRight",expandButtonProps:{style:{display:"inline-block",height:"32px",width:"auto",margin:Object(Z.a)()?"0 0 0 8px":"0 8px 0 0",backgroundColor:"transparent",verticalAlign:"middle"}}},onRenderHeader:Mi}},Li=function(e,t,r,n,i,o,s,c,u,l,p,f,g,h,b,v,S){var y=[a.a.createElement(Wi,{key:"DescriptionWrapper"},a.a.createElement(ei,{"data-testid":Object(m.a)("DetailsPageDescriptionInput"),buttonTestId:Object(m.a)("DetailsPageDescriptionInputButton"),text:S?r:r||strings.Editor.EmptyDescriptionTaker,readOnly:!S,makeEdit:function(e){n(e),o(Object(Kr.isScriptDescriptionValid)(e))},fontSize:s.fontSizes.small,fontWeight:s.fontWeights.regular,multilineTextfield:!0,placeholderText:strings.Details.ScriptDescriptionPlaceholderText,onEscapeAction:function(){n(t)},onBlurAction:function(){i&&r!==t&&(c({script:e,updatedMetadata:{description:r}}),Object(d.h)(Object(Mt.a)({eventName:"EditScriptProperties",eventType:"User",data:{logLevel:d.a.Information,storageId:e.storageScript.id,entryPoint:"Group Sections",propertyName:"Description"}})))},takerLabelRole:"complementary",editMode:u,setEditMode:l,shouldFocus:p,setShouldFocus:f})),a.a.createElement(Wi,{key:"ScriptAccessWrapper"},a.a.createElement(li,{isScriptShared:nt(e)})),a.a.createElement("div",{key:"ScriptActivityWrapper"},e&&e.storageScript.dateLastPublished&&a.a.createElement(Wi,null,a.a.createElement(Ui,null,a.a.createElement(Hi,null,a.a.createElement(xa.a,{iconName:"EditGeneric24"})),a.a.createElement("div",null,a.a.createElement(x.a,{id:"last-saved-date-label",styles:{root:{fontSize:s.fontSizes.small,fontWeight:s.fontWeights.regular,padding:"5px 0 0"}}},g?strings.Details.MakerLastEditedLabel:strings.substitute(strings.Details.TakerLastEditedLabel,{ScriptOwner:e.storageScript.creatorDisplayName||strings.Details.ScriptOwnerLabel})),a.a.createElement(x.a,{"aria-labelledby":"last-saved-date-label",styles:{root:{fontSize:s.fontSizes.small,fontWeight:s.fontWeights.regular,padding:"0 0 5px"}}},new Date(e.storageScript.dateLastPublished).toLocaleString(Object(oi.a)()))))))];return Object(st.a)(e)||g||y.push(a.a.createElement("div",{key:"SecurityWrapper"},a.a.createElement(Wi,null,a.a.createElement(zi,null,a.a.createElement(gi,{showConsentDialog:h,isScriptRunning:b,isStorageCallInProgress:v,script:e}))))),y},Bi=function(e,t){var r=wi(e.storageScript.id),n=[{key:"descriptionGroup",isCollapsed:r.groupSectionStatus.descriptionGroup,name:strings.Details.DescriptionSection,startIndex:0,count:1,data:{storageId:e.storageScript.id,isOwner:t}},{key:"scriptAccessGroup",isCollapsed:r.groupSectionStatus.scriptAccessGroup,name:strings.Details.ScriptAccessSection,startIndex:1,count:1,data:{storageId:e.storageScript.id,isOwner:t}},{key:"scriptActivityGroup",isCollapsed:r.groupSectionStatus.scriptActivityGroup,name:strings.Details.ScriptActivitySection,startIndex:2,count:1,data:{storageId:e.storageScript.id,isOwner:t}}];return Object(st.a)(e)||t||n.push({key:"securityGroup",isCollapsed:r.groupSectionStatus.securityGroup,name:strings.Details.SecuritySection,startIndex:3,count:1,data:{storageId:e.storageScript.id,isOwner:t}}),n},Fi=l.b.div(Pi()),Wi=l.b.div(Ri()),Ui=l.b.div(_i()),Hi=l.b.div(Ci(),(function(e){return Object(Z.a)()?"0 0 0 "+e.theme.spacing.medium:"0 "+e.theme.spacing.medium+" 0 0"})),zi=l.b.div(ki()),Gi=r(678);var Vi=r(717),Ki=function(e,t,r){return!!e&&Object(Ne.a)(e)&&!(""===e.localUpdates.body)&&!t&&!Object(Vi.a)(r)},qi=function(e,t){return!!e&&Object(Ne.a)(e)&&Object(Le.a)(e)&&!t},Ji=r(39),Qi=r(794);function Zi(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}var Yi=Object(l.c)((function(e){var t=Ki(e.script,e.isScriptRunning,e.mostRecentRecorderHeartbeatReceived),r=!t&&Object(Vi.a)(e.mostRecentRecorderHeartbeatReceived),n=Object(jt.b)(e.theme.fontSizes.medium,e.theme,!t),i=[{key:Object(m.a)("DetailsPageRunButton"),iconProps:{iconName:"PlayIcon"},onClick:function(t){e.runScript({script:e.script,version:"lastModified"}),t.stopPropagation()},disabled:!t,text:strings.General.RunButtonText,tooltipText:r?strings.Details.RunButtonDisabledTooltipText:void 0,additionalStyles:n},{key:Object(m.a)("DetailsPageEditButton"),onClick:function(){e.setNavigationSourcePage("Details"),e.openScriptInEditor()},iconProps:{iconName:e.hasElevatedPrivileges?"EditGeneric16":"ShapeBracePair"},text:e.hasElevatedPrivileges?strings.Details.EditButtonText:strings.Details.ViewButtonText,additionalStyles:n}],o=io(e);return a.a.createElement(Xi,null,a.a.createElement($i,null,a.a.createElement(At,{primaryCommands:i,overflowCommands:o,isDetailsPage:!0})))})),Xi=l.b.div.withConfig({displayName:"ActionsSection__Wrapper",componentId:"sc-1u52cw9-0"})(["display:flex;"]),$i=l.b.div.withConfig({displayName:"ActionsSection__CommandBarWrapper",componentId:"sc-1u52cw9-1"})(["padding:0.6rem 0.5rem 0.7rem;width:100%;"]),eo=function(e){var t=qi(e.script,e.isStorageCallInProgress);return{key:Object(m.a)("DetailsPageRenameButton"),onClick:function(){e.editMode||e.setEditMode(!0),Object(d.h)({eventName:"ControlAction",eventType:"User",data:{control:"RenameButton",location:"Overflow"}})},disabled:!t,text:strings.Editor.RenameButtonText,background:"transparent"}},to=function(e){var t=Me(e.script,e.isScriptRunning,!1);return{key:Object(m.a)("DetailsPageCopyButton"),onClick:function(){e.copyScript({originalPage:"Details"})},disabled:!t,text:strings.Editor.MakeCopyButtonText}},ro=function(e){var t=e.hasElevatedPrivileges&&Object(Gi.a)(e.script);return{key:Object(m.a)("DetailsPageFlowButton"),onClick:function(){window.open("https://go.microsoft.com/fwlink/?linkid=2114609","_blank"),Object(d.h)({eventName:"CreateFlowClicked",eventType:"User"})},disabled:!t,text:strings.Details.CreateFlowButtonText}},no=function(e){var t=Be(e.script,e.isScriptRunning,e.isStorageCallInProgress);return{key:Object(m.a)("DetailsPageDeleteButton"),onClick:function(){e.deleteScript(e.script)},disabled:!t,text:strings.Details.DeleteButtonText}},ao=function(e){return{key:"Overflow styles carrier",additionalStyles:Object(jt.d)(e.theme),isMenuOpened:e.isMenuOpened,setIsMenuOpened:e.setIsMenuOpened,overflowButtonRef:e.overflowButtonRef}},io=function(e){var t=Object(Le.a)(e.script),r=nt(e.script),n=!r&&t&&e.isSharingEnabled,a=[eo(e),to(e)];return n&&a.push(function(e){var t="";return nt(e.script)?t=strings.Details.ShareButtonAlreadySharedTooltipText:e.isSharingEnabled||(t=strings.Details.ShareButtonSharingDisabledTooltipText),{key:Object(m.a)("DetailsPageShareButton"),onClick:function(){e.showShareDialog()},text:strings.Details.ShareCommandButtonText,tooltipText:t}}(e)),r&&a.push(function(e){return{key:Object(m.a)("DetailsPageStopSharingButton"),onClick:function(){e.showUnshareDialog()},text:strings.Dialog.StopSharingButtonText}}(e)),Object(Qi.a)("OfficeScriptsRunFromButton")&&a.push({key:"addbutton",onClick:function(){var t,r=(t=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(Ji.a)(e.script.storageScript.name,e.script.localUpdates.shareId);case 2:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function o(e){Zi(i,n,a,o,s,"next",e)}function s(e){Zi(i,n,a,o,s,"throw",e)}o(void 0)}))});return function(){return r.apply(this,arguments)}}(),text:"Add Button",disabled:!r}),a.concat([ro(e),no(e),ao(e)])};function oo(e,t){return!t.some((function(t){return t.toUpperCase()===e.toUpperCase()}))}var so,co=Object(l.c)((function(e){return a.a.createElement(ei,{"data-testid":Object(m.a)("ScriptNameEditableLabel"),buttonTestId:Object(m.a)("ScriptNameEditableLabelButton"),text:e.scriptName,originalPage:e.originalPage,readOnly:!e.hasEditPrivileges,editMode:e.editorNameEditMode,setEditMode:e.setEditorNameEditMode,makeEdit:function(t){e.setScriptName(t)},onEscapeAction:function(){e.setScriptName(e.savedScriptName)},onBlurAction:function(){if("None"!==Object(Kr.isScriptNameValid)(e.scriptName).error||!oo(e.scriptName,e.otherScriptNames))throw new Error("Invalid name");e.scriptName!==e.savedScriptName&&(e.saveScript({script:e.script,updatedMetadata:{name:e.scriptName}}),Object(d.h)(Object(Mt.a)({eventName:"EditScriptProperties",eventType:"User",data:{logLevel:d.a.Information,storageId:e.script.storageScript.id,entryPoint:uo(e.originalPage),propertyName:"Name"}})))},placeholderText:strings.Details.ScriptNamePlaceholderText,fontSize:e.fontSize,fontWeight:e.fontWeight,errorDeferredValidationTime:1e3,getErrorMessage:function(t){return e.hasEditPrivileges?oo(t,e.otherScriptNames)?function(e){switch(e.error){case"Name is empty":return strings.Message.EmptyScriptNameError;case"Name is too long":return strings.Message.TooLongScriptNameError;case"Name contains invalid character":return strings.substitute(strings.Message.InvalidCharacterScriptNameError,{character:e.invalidSubstring});case"Invalid name":return strings.Message.InvalidScriptNameError;case"Name ends in whitespace":return strings.Message.EndInWhitespaceError;case"None":return""}}(Object(Kr.isScriptNameValid)(t)):strings.Message.ScriptNameUsedError:""},shouldFocus:e.shouldFocus,setShouldFocus:e.setShouldFocus,setButtonHasFocus:e.setButtonHasFocus,sendButtonClickTelemetry:function(){Object(d.h)({eventName:"ControlAction",eventType:"User",data:{control:"RenameButton",location:"EditableLabel"}})}})})),uo=function(e){switch(e){case"Details":return"Script Card";case"Editor":return"Editor Header"}},lo=r(954);!function(e){e[e.normal=0]="normal",e[e.compact=1]="compact"}(so||(so={}));var po=Object(re.a)(),fo=function(e){function t(t){var r=e.call(this,t)||this;return r._rootElement=n.createRef(),r._onClick=function(e){r._onAction(e)},r._onKeyDown=function(e){e.which!==vt.a.enter&&e.which!==vt.a.space||r._onAction(e)},r._onAction=function(e){var t=r.props,n=t.onClick,a=t.onClickHref;n?n(e):!n&&a&&(window.location.href=a,e.preventDefault(),e.stopPropagation())},Object(ne.a)(r),Object(lo.a)("DocumentCard",t,{accentColor:void 0}),r}return Object(G.c)(t,e),t.prototype.render=function(){var e,t=this.props,r=t.onClick,a=t.onClickHref,i=t.children,o=t.type,s=t.accentColor,c=t.styles,u=t.theme,l=t.className,d=Object(ie.d)(this.props,ie.c,["className","onClick","type","role"]),p=!(!r&&!a);this._classNames=po(c,{theme:u,className:l,actionable:p,compact:o===so.compact}),o===so.compact&&s&&(e={borderBottomColor:s});var f=this.props.role||(p?r?"button":"link":void 0),g=p?0:void 0;return n.createElement("div",Object(G.a)({ref:this._rootElement,tabIndex:g,"data-is-focusable":p,role:f,className:this._classNames.root,onKeyDown:p?this._onKeyDown:void 0,onClick:p?this._onClick:void 0,style:e},d),i)},t.prototype.focus=function(){this._rootElement.current&&this._rootElement.current.focus()},t.defaultProps={type:so.normal},t}(n.Component),go={root:"ms-DocumentCardPreview",icon:"ms-DocumentCardPreview-icon",iconContainer:"ms-DocumentCardPreview-iconContainer"},mo={root:"ms-DocumentCardActivity",multiplePeople:"ms-DocumentCardActivity--multiplePeople",details:"ms-DocumentCardActivity-details",name:"ms-DocumentCardActivity-name",activity:"ms-DocumentCardActivity-activity",avatars:"ms-DocumentCardActivity-avatars",avatar:"ms-DocumentCardActivity-avatar"},ho={root:"ms-DocumentCardTitle"},bo={root:"ms-DocumentCardLocation"},vo={root:"ms-DocumentCard",rootActionable:"ms-DocumentCard--actionable",rootCompact:"ms-DocumentCard--compact"},So=Object(z.a)(fo,(function(e){var t,r,n=e.className,a=e.theme,i=e.actionable,o=e.compact,s=a.palette,c=a.fonts,u=a.effects,l=Object(K.a)(vo,a);return{root:[l.root,{WebkitFontSmoothing:"antialiased",backgroundColor:s.white,border:"1px solid "+s.neutralLight,maxWidth:"320px",minWidth:"206px",userSelect:"none",position:"relative",selectors:(t={":focus":{outline:"0px solid"}},t["."+da.a+" &:focus"]=Object(ua.c)(s.neutralSecondary,u.roundedCorner2),t["."+bo.root+" + ."+ho.root]={paddingTop:"4px"},t)},i&&[l.rootActionable,{selectors:{":hover":{cursor:"pointer",borderColor:s.neutralTertiaryAlt},":hover:after":{content:'" "',position:"absolute",top:0,right:0,bottom:0,left:0,border:"1px solid "+s.neutralTertiaryAlt,pointerEvents:"none"}}}],o&&[l.rootCompact,{display:"flex",maxWidth:"480px",height:"108px",selectors:(r={},r["."+go.root]={borderRight:"1px solid "+s.neutralLight,borderBottom:0,maxHeight:"106px",maxWidth:"144px"},r["."+go.icon]={maxHeight:"32px",maxWidth:"32px"},r["."+mo.root]={paddingBottom:"12px"},r["."+ho.root]={paddingBottom:"12px 16px 8px 16px",fontSize:c.mediumPlus.fontSize,lineHeight:"16px"},r)}],n]}}),void 0,{scope:"DocumentCard"}),yo=r(21);function Oo(){return(Oo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var xo=Object(l.c)((function(e){var t=Object(n.useState)(!1),r=t[0],i=t[1],o=Object(n.useState)(!1),s=o[0],c=o[1],u=e.script?e.script.storageScript.name:"",l=Object(n.useState)(u),p=l[0],f=l[1],g=nt(e.script),h=Object(Le.a)(e.script),b=g&&!h?e.script.storageScript.creatorDisplayName+"'s OneDrive":"My Files",v=e.script.localUpdates.shareId?"OfficeScriptsSharedIcon48":"OfficeScriptsIcon48";Object(n.useEffect)((function(){f(e.script.storageScript.name)}),[e.script.storageScript.name]),Object(n.useEffect)((function(){"Failed"===e.scriptSavingStatus&&u!==p&&f(u)}),[e.scriptSavingStatus,u]),Object(n.useEffect)((function(){!0===e.isMakingACopy&&i(!0)}),[e.isMakingACopy]);var y=Object(n.useState)(!1),O=y[0],x=y[1],j=Object(n.useRef)(O),w=Object(n.useState)(!1),E=w[0],k=w[1],C=Object(n.useRef)(null),_=function(){var e;j.current&&(null==(e=C.current)||e.openMenu());if(!C.current){var t=new yo.b("Script card overflow button ref is null!");Object(d.g)(t,"Unexpected",d.a.Error)}};return Object(n.useEffect)((function(){var e;if(O){if(O&&(!E||Kt.b)){var t;null==(t=C.current)||t.openMenu()}}else null==(e=C.current)||e.dismissMenu()}),[O]),Object(n.useEffect)((function(){return window.addEventListener("transitionend",_),function(){window.removeEventListener("transitionend",_)}}),[]),a.a.createElement(_o,null,a.a.createElement(So,{styles:Eo(O),onMouseEnter:function(e){k(!0)},onMouseLeave:function(e){k(!1)}},a.a.createElement(Ro,null,e.isEditingScriptName?a.a.createElement(To,null,a.a.createElement(Do,null,a.a.createElement(co,{theme:e.theme,script:e.script,savedScriptName:u,scriptName:p,hasEditPrivileges:e.hasEditPrivileges,otherScriptNames:e.otherScriptNames,scriptSavingStatus:e.scriptSavingStatus,saveScript:e.saveScript,fontSize:e.theme.fontSizes.medium,editorNameEditMode:e.isEditingScriptName,setEditorNameEditMode:e.setIsEditingScriptName,shouldFocus:r,setShouldFocus:i,setScriptName:f,setButtonHasFocus:c,originalPage:"Details"}))):a.a.createElement(Io,{buttonHasFocus:s,onFocusCapture:function(){c(!0)},onBlurCapture:function(){c(!1)}},a.a.createElement(Do,null,a.a.createElement(co,{theme:e.theme,script:e.script,savedScriptName:u,scriptName:p,hasEditPrivileges:e.hasEditPrivileges,otherScriptNames:e.otherScriptNames,scriptSavingStatus:e.scriptSavingStatus,saveScript:e.saveScript,fontSize:e.theme.fontSizes.medium,editorNameEditMode:e.isEditingScriptName,setEditorNameEditMode:e.setIsEditingScriptName,shouldFocus:r,setShouldFocus:i,setScriptName:f,setButtonHasFocus:c,originalPage:"Details"}))),a.a.createElement(Po,null,a.a.createElement(at,{scriptHasUnsavedChanges:!1,rootFolder:b,isPointerCursor:!1}))),!e.isMakingACopy&&a.a.createElement(a.a.Fragment,null,a.a.createElement(jo,null,a.a.createElement(ko,{onClick:function(){e.openScriptInEditor(),Object(d.h)(Object(Mt.a)({eventName:"OpenScript",eventType:"User",data:{logLevel:d.a.Information,storageId:e.script.storageScript.id,entryPoint:"Script Card Icon",hasDescription:!!e.script.storageScript.description,isOwner:e.script.storageScript.isCreator}}))},onKeyDown:function(t){"Enter"!==t.key&&" "!==t.key||(e.openScriptInEditor(),t.preventDefault(),t.stopPropagation(),Object(d.h)(Object(Mt.a)({eventName:"OpenScript",eventType:"User",data:{logLevel:d.a.Information,storageId:e.script.storageScript.id,entryPoint:"Script Card Icon",hasDescription:!!e.script.storageScript.description,isOwner:e.script.storageScript.isCreator}})))},tabIndex:0},a.a.createElement(Co,null,a.a.createElement(S.a,{iconName:v,"aria-hidden":"true","data-testid":Object(m.a)("ScriptCardScriptIcon")})))),a.a.createElement(Yi,{script:e.script,hasElevatedPrivileges:e.hasEditPrivileges,isScriptRunning:e.isScriptRunning,isStorageCallInProgress:e.isStorageCallInProgress,isSharingEnabled:e.isSharingEnabled,openScriptInEditor:function(){e.openScriptInEditor(),Object(d.h)(Object(Mt.a)({eventName:"OpenScript",eventType:"User",data:{logLevel:d.a.Information,storageId:e.script.storageScript.id,entryPoint:"Script Card Button",hasDescription:!!e.script.storageScript.description,isOwner:e.script.storageScript.isCreator}}))},setNavigationSourcePage:e.setNavigationSourcePage,runScript:e.runScript,copyScript:e.copyScript,deleteScript:function(){e.showDialog({title:strings.Dialog.ConfirmDeleteDialogLabel,subText:strings.Dialog.DeleteWarningText,buttons:[{key:Object(m.a)("DeleteDialogDeleteButton"),text:strings.Dialog.DeleteButtonText,action:Ae.a.scripts.remove.request(e.script),isPrimary:!0},{key:Object(m.a)("DeleteDialogCancelButton"),text:strings.General.CancelButtonText,action:Ae.a.dialog.dismiss(),isPrimary:!1}]})},showShareDialog:e.showShareDialog,showUnshareDialog:e.showUnshareDialog,blockAccessToScript:e.blockAccessToScript,editMode:e.isEditingScriptName,setEditMode:e.setIsEditingScriptName,mostRecentRecorderHeartbeatReceived:e.mostRecentRecorderHeartbeatReceived,isMenuOpened:O,setIsMenuOpened:function(e){j.current=e,x(e)},overflowButtonRef:C}))))})),jo=l.b.div.withConfig({displayName:"ScriptCard__CardLogoPadding",componentId:"rampfd-0"})(["padding:0 5px 0;"]),wo={root:{width:"100%",maxWidth:"100%",borderRadius:"2px",transition:".1s linear",boxShadow:"0 4px 4px 0 rgb(0 0 0 / 6%)"}},Eo=function(e){return e?wo:Oo({},wo,{root:Oo({},wo.root,{selectors:{":hover":{transform:"scale(1.05)",boxShadow:"0 8px 16px rgb(0 0 0/ 10%)"}}})})},ko=l.b.div.withConfig({displayName:"ScriptCard__CardLogoWrapper",componentId:"rampfd-1"})(["width:100%;height:92px;background:",";&:focus{outline:0.1rem solid ",";}&:hover{cursor:pointer;}"],(function(e){return e.theme.colors.neutralLighter}),(function(e){return e.theme.colors.neutralSecondary})),Co=l.b.div.withConfig({displayName:"ScriptCard__CardLogoInnerWrapper",componentId:"rampfd-2"})(["top:50%;left:50%;position:relative;text-align:center;transform:translate(-50%,-50%);"]),_o=l.b.div.withConfig({displayName:"ScriptCard__Wrapper",componentId:"rampfd-3"})(["padding:0.8rem 2rem 1.2rem;display:flex;flex-direction:column;"]),Ro=l.b.div.withConfig({displayName:"ScriptCard__CardHeaderWrapper",componentId:"rampfd-4"})(["padding:0.8rem 0.5rem 0.9rem;display:flex;flex-direction:column;"]),Po=l.b.div.withConfig({displayName:"ScriptCard__FolderPathWrapper",componentId:"rampfd-5"})(["padding:0 7px;"]),To=l.b.div.withConfig({displayName:"ScriptCard__FlexWrapper",componentId:"rampfd-6"})(["display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;"]),Io=l.b.div.withConfig({displayName:"ScriptCard__HoverEffectFlexWrapper",componentId:"rampfd-7"})(["display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;outline:",";padding:0 7px 0;&:hover{background-color:",";}"],(function(e){return e.buttonHasFocus?"0.1rem solid "+e.theme.colors.neutralSecondary:"none"}),(function(e){return e.theme.colors.neutralQuaternaryAlt})),Do=l.b.div.withConfig({displayName:"ScriptCard__ScriptTitleWrapper",componentId:"rampfd-8"})(["overflow:hidden;flex-grow:1;"]);function Ao(){var e=No(["\n flex-grow: 1;\n margin: ",";\n font-size: ",";\n font-weight: 400;\n color: ",";\n vertical-align: middle;\n"]);return Ao=function(){return e},e}function Mo(){var e=No(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n height: 3.2rem;\n white-space: ",";\n"]);return Mo=function(){return e},e}function No(e,t){return t||(t=e.slice(0)),e.raw=t,e}var Lo,Bo,Fo,Wo=Object(l.c)((function(e){var t=e.theme,r=e.status,n=e.isToggleSection,i=e.shouldWrapText;return a.a.createElement(Uo,{id:"StatusBar",theme:t,shouldWrapText:!!i,role:"status"},"InProgress"===r&&a.a.createElement(a.a.Fragment,null,!n&&a.a.createElement(Ho,{theme:t,"data-testid":Object(m.a)("StatusText")},strings.Editor.SavingScriptStatusLabel),a.a.createElement(Ht.a,{size:zt.a.small,styles:Object(y.c)(zt.a.small)})),"Succeeded"===r&&a.a.createElement(a.a.Fragment,null,!n&&a.a.createElement(Ho,{theme:t,"data-testid":Object(m.a)("StatusText")},strings.Editor.SavedScriptStatusLabel),a.a.createElement(S.a,{iconName:"CheckMarkIcon",styles:{root:{fontSize:t.fontSizes.icon,color:t.colors.successIcon}}})),"Failed"===r&&a.a.createElement(a.a.Fragment,null,!n&&a.a.createElement(Ho,{theme:t,"data-testid":Object(m.a)("StatusText")},strings.Editor.SaveErrorScriptStatusLabel),a.a.createElement(S.a,{iconName:"ErrorBadge",styles:{root:{fontSize:t.fontSizes.icon,color:t.colors.errorIcon,height:"16px"}}})),"Unsaved"===r&&a.a.createElement(a.a.Fragment,null,a.a.createElement(Ho,{theme:t,"data-testid":Object(m.a)("UnsavedDecorator")},strings.Editor.UnsavedChangesLabel),a.a.createElement(S.a,{iconName:"ErrorBadge",styles:{root:{fontSize:t.fontSizes.icon,color:t.colors.successIcon,height:"16px"}}})))})),Uo=l.b.div(Mo(),(function(e){return e.shouldWrapText?"normal":"nowrap"})),Ho=l.b.div(Ao(),(function(e){return Object(Z.a)()?"0 0 0 "+e.theme.spacing.small:"0 "+e.theme.spacing.small+" 0 0"}),(function(e){return e.theme.fontSizes.small}),(function(e){return e.theme.colors.neutralSecondary})),zo=r(634),Go=r(871),Vo=Object(re.a)(),Ko=function(e){function t(t){var r,n=e.call(this,t)||this;return n.ICON_MAP=((r={})[Go.a.info]="Info",r[Go.a.warning]="Info",r[Go.a.error]="ErrorBadge",r[Go.a.blocked]="Blocked2",r[Go.a.severeWarning]="Warning",r[Go.a.success]="Completed",r),n._getRegionProps=function(){var e=!!n._getActionsDiv()||!!n._getDismissDiv(),t={"aria-describedby":n.state.labelId,role:"region"};return e?t:{}},n._onClick=function(e){n.setState({expandSingleLine:!n.state.expandSingleLine})},Object(ne.a)(n),n.state={labelId:Object(oa.a)("MessageBar"),showContent:!1,expandSingleLine:!1},n}return Object(G.c)(t,e),t.prototype.render=function(){var e=this.props.isMultiline;return this._classNames=this._getClassNames(),e?this._renderMultiLine():this._renderSingleLine()},t.prototype._getActionsDiv=function(){return this.props.actions?n.createElement("div",{className:this._classNames.actions},this.props.actions):null},t.prototype._getDismissDiv=function(){var e=this.props,t=e.onDismiss,r=e.dismissIconProps;return t?n.createElement(w.a,{disabled:!1,className:this._classNames.dismissal,onClick:t,iconProps:r||{iconName:"Clear"},ariaLabel:this.props.dismissButtonAriaLabel}):null},t.prototype._getDismissSingleLine=function(){return this.props.onDismiss?n.createElement("div",{className:this._classNames.dismissSingleLine},this._getDismissDiv()):null},t.prototype._getExpandSingleLine=function(){return!this.props.actions&&this.props.truncated?n.createElement("div",{className:this._classNames.expandSingleLine},n.createElement(w.a,{disabled:!1,className:this._classNames.expand,onClick:this._onClick,iconProps:{iconName:this.state.expandSingleLine?"DoubleChevronUp":"DoubleChevronDown"},ariaLabel:this.props.overflowButtonAriaLabel,"aria-expanded":this.state.expandSingleLine})):null},t.prototype._getIconSpan=function(){var e=this.props.messageBarIconProps;return n.createElement("div",{className:this._classNames.iconContainer,"aria-hidden":!0},e?n.createElement(S.a,Object(G.a)({},e,{className:Object(ca.a)(this._classNames.icon,e.className)})):n.createElement(S.a,{iconName:this.ICON_MAP[this.props.messageBarType],className:this._classNames.icon}))},t.prototype._renderMultiLine=function(){return n.createElement("div",Object(G.a)({className:this._classNames.root},this._getRegionProps()),n.createElement("div",{className:this._classNames.content},this._getIconSpan(),this._renderInnerText(),this._getDismissDiv()),this._getActionsDiv())},t.prototype._renderSingleLine=function(){return n.createElement("div",Object(G.a)({className:this._classNames.root},this._getRegionProps()),n.createElement("div",{className:this._classNames.content},this._getIconSpan(),this._renderInnerText(),this._getExpandSingleLine(),this._getActionsDiv(),this._getDismissSingleLine()))},t.prototype._renderInnerText=function(){var e=Object(ie.d)(this.props,ie.e,["className"]),t=this.props.theme,r={theme:Object(G.a)(Object(G.a)({},t),{semanticColors:Object(G.a)(Object(G.a)({},t.semanticColors),{link:t.semanticColors.messageLink,linkHovered:t.semanticColors.messageLinkHovered})})};return n.createElement(zo.a,{settings:r},n.createElement("div",{className:this._classNames.text,id:this.state.labelId,role:"status","aria-live":this._getAnnouncementPriority()},n.createElement("span",Object(G.a)({className:this._classNames.innerText},e),n.createElement(oe.a,null,n.createElement("span",null,this.props.children)))))},t.prototype._getClassNames=function(){var e=this.props,t=e.theme,r=e.className,n=e.messageBarType,a=e.onDismiss,i=e.actions,o=e.truncated,s=e.isMultiline,c=this.state.expandSingleLine;return Vo(this.props.styles,{theme:t,messageBarType:n||Go.a.info,onDismiss:void 0!==a,actions:void 0!==i,truncated:o,isMultiline:s,expandSingleLine:c,className:r})},t.prototype._getAnnouncementPriority=function(){switch(this.props.messageBarType){case Go.a.blocked:case Go.a.error:case Go.a.severeWarning:return"assertive"}return"polite"},t.defaultProps={messageBarType:Go.a.info,onDismiss:void 0,isMultiline:!0},t}(n.Component),qo={root:"ms-MessageBar",error:"ms-MessageBar--error",blocked:"ms-MessageBar--blocked",severeWarning:"ms-MessageBar--severeWarning",success:"ms-MessageBar--success",warning:"ms-MessageBar--warning",multiline:"ms-MessageBar-multiline",singleline:"ms-MessageBar-singleline",dismissalSingleLine:"ms-MessageBar-dismissalSingleLine",expandingSingleLine:"ms-MessageBar-expandingSingleLine",content:"ms-MessageBar-content",iconContainer:"ms-MessageBar-icon",text:"ms-MessageBar-text",innerText:"ms-MessageBar-innerText",dismissSingleLine:"ms-MessageBar-dismissSingleLine",expandSingleLine:"ms-MessageBar-expandSingleLine",dismissal:"ms-MessageBar-dismissal",expand:"ms-MessageBar-expand",actions:"ms-MessageBar-actions",actionsSingleline:"ms-MessageBar-actionsSingleLine"},Jo=((Lo={})[Go.a.error]="errorBackground",Lo[Go.a.blocked]="errorBackground",Lo[Go.a.success]="successBackground",Lo[Go.a.warning]="warningBackground",Lo[Go.a.severeWarning]="severeWarningBackground",Lo[Go.a.info]="infoBackground",Lo),Qo=((Bo={})[Go.a.error]="rgba(255, 0, 0, 0.3)",Bo[Go.a.blocked]="rgba(255, 0, 0, 0.3)",Bo[Go.a.success]="rgba(48, 241, 73, 0.3)",Bo[Go.a.warning]="rgba(255, 254, 57, 0.3)",Bo[Go.a.severeWarning]="rgba(255, 0, 0, 0.3)",Bo[Go.a.info]="Window",Bo),Zo=((Fo={})[Go.a.error]="errorIcon",Fo[Go.a.blocked]="errorIcon",Fo[Go.a.success]="successIcon",Fo[Go.a.warning]="warningIcon",Fo[Go.a.severeWarning]="severeWarningIcon",Fo[Go.a.info]="infoIcon",Fo),Yo=Object(z.a)(Ko,(function(e){var t,r,n,a,i,o=e.theme,s=e.className,c=e.onDismiss,u=e.truncated,l=e.isMultiline,d=e.expandSingleLine,p=e.messageBarType,f=void 0===p?Go.a.info:p,g=o.semanticColors,m=o.fonts,h=Object(q.m)(0,q.e),b=Object(K.a)(qo,o),v={fontSize:la.c.xSmall,height:10,lineHeight:"10px",color:g.messageText,selectors:(t={},t[q.a]={MsHighContrastAdjust:"none",color:"WindowText"},t)},S=[Object(ua.b)(o,{inset:1,highContrastStyle:{outlineOffset:"-4px",outlineColor:"Window"},borderColor:"transparent"}),{flexShrink:0,width:32,height:32,padding:"8px 12px",selectors:{"& .ms-Button-icon":v,":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}}];return{root:[b.root,m.medium,f===Go.a.error&&b.error,f===Go.a.blocked&&b.blocked,f===Go.a.severeWarning&&b.severeWarning,f===Go.a.success&&b.success,f===Go.a.warning&&b.warning,l?b.multiline:b.singleline,!l&&c&&b.dismissalSingleLine,!l&&u&&b.expandingSingleLine,{background:g[Jo[f]],color:g.messageText,minHeight:32,width:"100%",display:"flex",wordBreak:"break-word",selectors:(r={},r[q.a]={background:Qo[f],border:"1px solid WindowText",color:"WindowText"},r)},l&&{flexDirection:"column"},s],content:[b.content,{display:"flex",width:"100%",lineHeight:"normal"}],iconContainer:[b.iconContainer,{fontSize:la.c.medium,minWidth:16,minHeight:16,display:"flex",flexShrink:0,margin:"8px 0 8px 12px"}],icon:{color:g[Zo[f]],selectors:(n={},n[q.a]={MsHighContrastAdjust:"none",color:"WindowText"},n)},text:[b.text,Object(G.a)(Object(G.a)({minWidth:0,display:"flex",flexGrow:1,margin:8},m.small),{selectors:(a={},a[q.a]={MsHighContrastAdjust:"none"},a)}),!c&&{marginRight:12}],innerText:[b.innerText,{lineHeight:16,selectors:{"& span a":{paddingLeft:4}}},u&&{overflow:"visible",whiteSpace:"pre-wrap"},!l&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},!l&&!u&&{selectors:(i={},i[h]={overflow:"visible",whiteSpace:"pre-wrap"},i)},d&&{overflow:"visible",whiteSpace:"pre-wrap"}],dismissSingleLine:b.dismissSingleLine,expandSingleLine:b.expandSingleLine,dismissal:[b.dismissal,S],expand:[b.expand,S],actions:[l?b.actions:b.actionsSingleline,{display:"flex",flexGrow:0,flexShrink:0,flexBasis:"auto",flexDirection:"row-reverse",alignItems:"center",margin:"0 12px 0 8px",selectors:{"& button:nth-child(n+2)":{marginLeft:8}}},l&&{marginBottom:8},c&&!l&&{marginRight:0}]}}),void 0,{scope:"MessageBar"}),Xo=(r(1056),Object(l.c)((function(e){var t=e.messageBarProps,r=e.theme,n=e.dispatch,i=e.dismiss;return a.a.createElement($o,{"data-testid":Object(m.a)("MainReduxMessageBar"),className:"message-bar "+(t.isVisible?"active":""),isVisible:t.isVisible},t.isVisible&&a.a.createElement(Yo,{dismissButtonAriaLabel:"Close",messageBarType:t.style,onDismiss:t.isBlocking?void 0:function(){i(),t.additionalDismissCallback&&t.additionalDismissCallback()},isMultiline:!t.forceSingleLine,styles:es(r),actions:t.buttons?a.a.createElement("div",null,t.buttons.map((function(e){return a.a.createElement(O.a,{key:"button_"+e.text,text:e.text,primary:e.isPrimary,disabled:e.isDisabled,onClick:e.actions&&e.actions.length>0?function(){e.actions.forEach((function(e){n(e)})),e.additionalOnClickCallback&&e.additionalOnClickCallback()}:function(){e.altOnClick&&e.altOnClick(),e.additionalOnClickCallback&&e.additionalOnClickCallback()}})}))):void 0},t.text,t.urlLink&&a.a.createElement(j.a,{href:t.urlLink.url,target:"_blank"},t.urlLink.text),t.actionLink&&a.a.createElement(j.a,{onClick:function(){return n(t.actionLink.action)}},t.actionLink.text)))}))),$o=l.b.div.withConfig({displayName:"MessageBar__MessageBarWrapper",componentId:"sc-6ppfaj-0"})(["height:",";width:100%;position:relative;top:0;left:0;background-color:",";"],(function(e){return e.isVisible?"auto":0}),(function(e){return e.theme.colors.white})),es=function(e){return{root:{backgroundColor:e.colors.neutralLighter,border:"1px solid rgba(200, 198, 196, 0.5)",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.35)",selectors:{".ms-MessageBar-icon":{height:"16px"}}}}},ts=Object(i.b)((function(e){return{messageBarProps:e.messageBar}}),(function(e){return{dispatch:e,dismiss:function(){return e(L.a.messageBar.dismiss())}}}))(Xo);function rs(){var e=cs(["\n display: flex;\n position: relative;\n"]);return rs=function(){return e},e}function ns(){var e=cs(["\n padding: 1.1rem 2rem 0px 2rem;\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n align-items: center;\n"]);return ns=function(){return e},e}function as(){var e=cs(["\n flex-grow: 0;\n"]);return as=function(){return e},e}function is(){var e=cs(["\n width: 100%;\n align-items: end;\n justify-content: center;\n display: flex;\n position: relative;\n top: 30%;\n"]);return is=function(){return e},e}function os(){var e=cs(["\n padding: 0 ",";\n"]);return os=function(){return e},e}function ss(){var e=cs(["\n height: 100%;\n width: 100%;\n overflow: auto;\n"]);return ss=function(){return e},e}function cs(e,t){return t||(t=e.slice(0)),e.raw=t,e}var us=Object(l.c)((function(e){var t=e.theme,r=e.script,i=e.returnToPreviousPage,o=e.saveScript,s=e.hasReceivedMetadata,c=e.isScriptOwner,u=e.otherScriptNames,l=e.showConsentDialog,d=e.runScript,p=e.copyScript,f=e.openScriptInEditor,g=e.setNavigationSourcePage,h=e.showDialog,b=e.blockAccessToScript,v=e.isMakingACopy,S=e.isEditingScriptName,O=e.scriptSavingStatus,x=e.isScriptRunning,j=e.isStorageCallInProgress,w=e.showShareDialog,E=e.showUnshareDialog,k=e.setIsEditingScriptName,C=e.mostRecentRecorderHeartbeatReceived,_=e.hasLoadedAttachedScripts,R=e.othersOwnedScripts;Object(n.useEffect)((function(){window.document.title=strings.PageTitles.ScriptDetails})),Object(n.useEffect)((function(){var e;_&&(e=R,ji.keys().forEach((function(t){var r=ji.read(t);r&&(r.isOwner||0!==e.filter((function(e){return e.storageScript.id===t})).length||Ei(t))})))}),[_]);var P=a.a.createRef();Object(n.useEffect)((function(){P.current&&P.current.focus()}),[P]);var T=!s||!r,I=Object(n.useState)(!0),D=I[0],A=I[1];return sn().then((function(e){A(e)})),a.a.createElement(ls,{"data-testid":Object(m.a)("DetailsPage")},a.a.createElement(gs,null,a.a.createElement(Xn,{buttonText:strings.General.BackButtonAllScriptsLabel,returnToPreviousPage:i}),c&&!v&&a.a.createElement(fs,null,a.a.createElement(Wo,{status:O}))),!r||T?a.a.createElement(ds,null,a.a.createElement(Hn,null)):v?a.a.createElement(ps,null,a.a.createElement(Ht.a,{size:zt.a.large,ariaLabel:strings.Editor.MakingACopySpinner,label:strings.Editor.MakingACopySpinnerAriaLabel,styles:Object(y.c)(zt.a.large)})):a.a.createElement(a.a.Fragment,null,a.a.createElement(xo,{script:r,hasEditPrivileges:c,otherScriptNames:u,scriptSavingStatus:O,isScriptRunning:x,isStorageCallInProgress:j,isSharingEnabled:D,isMakingACopy:v,isEditingScriptName:S,saveScript:o,runScript:d,copyScript:p,openScriptInEditor:f,setNavigationSourcePage:g,showDialog:h,showShareDialog:w,showUnshareDialog:E,blockAccessToScript:b,setIsEditingScriptName:k,mostRecentRecorderHeartbeatReceived:C}),a.a.createElement(ms,null,a.a.createElement(ts,null)),a.a.createElement(Di,{theme:t,script:r,saveScript:o,isScriptOwner:c,showConsentDialog:l,isScriptRunning:x,isStorageCallInProgress:j})))})),ls=l.b.div(ss()),ds=l.b.div(os(),(function(e){return e.theme.spacing.medium})),ps=l.b.div(is()),fs=l.b.div(as()),gs=l.b.div(ns()),ms=l.b.div(rs());function hs(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function bs(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){hs(i,n,a,o,s,"next",e)}function s(e){hs(i,n,a,o,s,"throw",e)}o(void 0)}))}}var vs=new Gr.a(bs(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Yr.instance().getOrganization());case 1:case"end":return e.stop()}}),e)})))),Ss=function(){var e=bs(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",vs.promise());case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function ys(){var e=xs(["\n display: flex;\n"]);return ys=function(){return e},e}function Os(){var e=xs(["\n margin-bottom: ",";\n"]);return Os=function(){return e},e}function xs(e,t){return t||(t=e.slice(0)),e.raw=t,e}var js=Object(l.c)((function(e){var t=e.script,r=e.isOpen,i=e.addScriptToWorkbook,o=e.hideShareDialog,s=e.theme;if(!t)return null;var c=Object(n.useState)(!1),u=c[0],l=c[1],d=Object(n.useState)(""),p=d[0],f=d[1];return Ss().then((function(e){f(e.DisplayName)})),a.a.createElement(h.a,{hidden:!r,onDismiss:o,dialogContentProps:ks(s),modalProps:{isBlocking:!0,styles:Object(y.b)(),onDismissed:function(){l(!1)}}},a.a.createElement(Es,null,a.a.createElement(ws,null,""!==p?strings.substitute(strings.Details.ShareInWorkbookPermissionWithOrgText,{organizationName:p}):strings.Details.ShareInWorkbookPermissionText)),a.a.createElement(b.a,null,a.a.createElement(O.a,{"data-testid":Object(m.a)("ShareDialogActionButton"),text:strings.Details.ShareCommandButtonText,ariaLabel:strings.Details.ShareCommandButtonText,disabled:u,onClick:function(){l(!0),i(t)},primary:!0}),a.a.createElement(O.a,{"data-testid":Object(m.a)("ShareDialogCancelButton"),text:strings.General.CancelButtonText,ariaLabel:strings.General.CancelButtonText,disabled:u,onClick:function(){o()}})))})),ws=l.b.div(Os(),(function(e){return e.theme.spacing.mediumPlus})),Es=l.b.div(ys()),ks=function(e){return{type:v.a.normal,title:strings.Details.ShareInWorkbookDialogTitle,styles:{title:{fontSize:e.fontSizes.large,fontWeight:e.fontWeights.semibold,color:e.colors.primary}}}},Cs=Object(i.b)((function(e){return{isOpen:B.a.shareDialog.getIsVisible(e),script:B.a.scripts.get(e,B.a.editor.getActiveScriptId(e))}}),(function(e){return{dispatch:e,addScriptToWorkbook:function(t){return e(L.a.scripts.addScriptToWorkbook.request(t))},hideShareDialog:function(){return e(L.a.shareDialog.hide())}}}))(js),_s=r(1398);function Rs(){var e=Ts(["\n display: flex;\n flex-direction: column;\n"]);return Rs=function(){return e},e}function Ps(){var e=Ts(["\n margin-bottom: ",";\n"]);return Ps=function(){return e},e}function Ts(e,t){return t||(t=e.slice(0)),e.raw=t,e}var Is=Object(l.c)((function(e){var t=e.script,r=e.isOpen,i=e.removeScriptFromWorkbook,o=e.blockAccessToScript,s=e.hideUnshareDialog,c=e.theme;if(!t)return null;var u=Object(Le.a)(t),l=Object(n.useState)(!1),d=l[0],p=l[1],f=Object(n.useState)(!1),g=f[0],v=f[1],S=nt(t),x=Object(n.useState)(""),j=x[0],w=x[1];return Ss().then((function(e){w(e.DisplayName)})),a.a.createElement(h.a,{hidden:!r,onDismiss:s,dialogContentProps:Ms(c),modalProps:{isBlocking:!0,styles:Object(y.b)(),onDismissed:function(){v(!1)}}},a.a.createElement(As,null,a.a.createElement(Ds,null,""!==j?strings.substitute(strings.Details.StopShareInWorkbookPermissionWithOrgText,{organizationName:j}):strings.Details.StopShareInWorkbookPermissionText),u&&a.a.createElement(_s.a,{label:strings.Dialog.StopSharingCheckboxText,onChange:function(e,t){p(!!t)},checked:d})),a.a.createElement(b.a,null,a.a.createElement(O.a,{"data-testid":Object(m.a)("UnshareDialogActionButton"),text:strings.Dialog.StopSharingButtonText,ariaLabel:strings.Dialog.StopSharingButtonText,disabled:g,onClick:function(){v(!0),d||S||s(),d&&o(t),S&&i(t)},primary:!0}),a.a.createElement(O.a,{"data-testid":Object(m.a)("UnshareDialogCancelButton"),text:strings.General.CancelButtonText,ariaLabel:strings.General.CancelButtonText,disabled:g,onClick:function(){s()}})))})),Ds=l.b.div(Ps(),(function(e){return e.theme.spacing.mediumPlus})),As=l.b.div(Rs()),Ms=function(e){return{type:v.a.normal,title:strings.Details.UnshareDialogTitle,styles:{title:{fontSize:e.fontSizes.large,fontWeight:e.fontWeights.semibold,color:e.colors.primary}}}},Ns=Object(i.b)((function(e){return{isOpen:B.a.unshareDialog.getIsVisible(e),script:B.a.scripts.get(e,B.a.editor.getActiveScriptId(e))}}),(function(e){return{dispatch:e,removeScriptFromWorkbook:function(t){return e(L.a.scripts.removeScriptFromWorkbook.request(t))},blockAccessToScript:function(t){return e(L.a.scripts.unshareScriptFromAllWorkbooks.request(t))},hideUnshareDialog:function(){return e(L.a.unshareDialog.hide())}}}))(Is),Ls=Object(i.b)((function(e){var t=c.b.scripts.get(e,c.b.editor.getActiveScriptId(e)),r=c.b.scripts.getHasReceivedMetadata(e),n=c.b.scripts.getOtherOwnedScriptNames(e,(t||{storageScript:{}}).storageScript.id),a=c.b.scripts.getSavingStatus(e,t?t.storageScript.id:null),i=c.b.run.getIsRunning(e),o=c.b.scripts.getIsStorageCallInProgress(e,t?t.storageScript.id:null),s=c.b.editor.getMostRecentRecorderHeartbeatReceived(e);return{script:t,hasReceivedMetadata:r,localOtherOwnedScriptNames:n,savingStatus:a,isScriptRunning:i,isStorageCallInProgress:o,isMakingACopy:c.b.editor.getIsMakingACopy(e),isEditingScriptName:c.b.editor.getIsEditingScriptName(e),mostRecentRecorderHeartbeatReceived:s,hasLoadedAttachedScripts:c.b.scripts.getHasLoadedAttachedScripts(e),othersOwnedScripts:c.b.scripts.getAllOthersScripts(e)}}),{showDialog:c.a.dialog.show,saveScript:c.a.scripts.saveScriptToStorage.request,runScript:c.a.run.request,copyScript:c.a.editor.makeACopyOfScript,addScriptToWorkbook:c.a.scripts.addScriptToWorkbook.request,setNavigationSourcePage:c.a.editor.setNavigationSourcePage,removeScriptFromWorkbook:c.a.scripts.removeScriptFromWorkbook.request,showConsentDialog:c.a.consentDialog.show,showShareDialog:c.a.shareDialog.show,showUnshareDialog:c.a.unshareDialog.show,hideDetailsPage:c.a.editor.hideDetailsPage,showDetailsPage:c.a.editor.showDetailsPage,showBackstage:c.a.backstage.show,setCurrentPivotKey:c.a.backstage.setCurrentPivot,setIsEditingScriptName:c.a.editor.setIsEditingScriptName})((function(e){var t=e.script,r=e.hasReceivedMetadata,n=e.localOtherOwnedScriptNames,i=e.saveScript,o=e.runScript,s=e.copyScript,u=e.savingStatus,l=e.isScriptRunning,d=e.isStorageCallInProgress,p=e.isMakingACopy,f=e.isEditingScriptName,g=e.mostRecentRecorderHeartbeatReceived,h=e.setNavigationSourcePage,b=e.showConsentDialog,v=e.showShareDialog,S=e.showUnshareDialog,y=e.showDialog,O=e.hideDetailsPage,x=e.showBackstage,j=e.setCurrentPivotKey,w=e.setIsEditingScriptName,E=e.hasLoadedAttachedScripts,k=e.othersOwnedScripts,C=Object(Le.a)(t);return a.a.createElement(a.a.Fragment,null,t&&a.a.createElement(a.a.Fragment,null,a.a.createElement(Cs,null),a.a.createElement(Ns,null)),a.a.createElement(us,{script:t,hasReceivedMetadata:r,isScriptOwner:C,scriptSavingStatus:u,isScriptRunning:l,isStorageCallInProgress:d,otherScriptNames:n,showShareDialog:v,showUnshareDialog:S,isMakingACopy:p,isEditingScriptName:f,setNavigationSourcePage:h,mostRecentRecorderHeartbeatReceived:g,returnToPreviousPage:function(){C?j(ln.Recent):t&&Object(st.a)(t)?j(ln.Samples):j(ln.Attached),x(),O()},saveScript:i,copyScript:s,showConsentDialog:b,runScript:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){o({script:e.script,version:e.version,entryPoint:"Details Page"})})),openScriptInEditor:function(){O()},blockAccessToScript:function(){y({title:strings.Dialog.ConfirmBlockAccessDialogLabel,subText:strings.Dialog.BlockAccessWarningText,buttons:[{key:Object(m.a)("BlockAccessDialogBlockButton"),text:strings.Dialog.StopSharingButtonText,action:c.a.scripts.unshareScriptFromAllWorkbooks.request(t),isPrimary:!0},{key:Object(m.a)("BlockAccessDialogCancelButton"),text:strings.General.CancelButtonText,action:c.a.dialog.dismiss(),isPrimary:!1}]})},showDialog:y,setIsEditingScriptName:w,hasLoadedAttachedScripts:E,othersOwnedScripts:k}))})),Bs=l.b.div.withConfig({displayName:"EditorWrapper",componentId:"sc-1l194aj-0"})(["height:100%;overflow:hidden;flex:1;position:relative;"]);function Fs(){var e=Gs(["\n color: ",";\n vertical-align: middle;\n margin: 0 0.1rem 0.2rem 0.1rem;\n padding: 0 0.1rem;\n white-space: nowrap;\n"]);return Fs=function(){return e},e}function Ws(){var e=Gs(["\n color: ",";\n vertical-align: middle;\n margin: 0 0.1rem 0.2rem 0.1rem;\n padding: 0 0.1rem;\n"]);return Ws=function(){return e},e}function Us(){var e=Gs(["\n margin: ",";\n"]);return Us=function(){return e},e}function Hs(){var e=Gs(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 0 ",";\n"]);return Hs=function(){return e},e}function zs(){var e=Gs(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n border: ",";\n padding: ",";\n &:hover {\n background-color: ",";\n }\n"]);return zs=function(){return e},e}function Gs(e,t){return t||(t=e.slice(0)),e.raw=t,e}var Vs=Object(l.c)((function(e){var t=e.theme,r=e.script,i=e.scriptSavingStatus,o=e.isScriptOwner,s=e.otherScriptNames,c=e.saveScript,u=e.editMode,l=e.setEditMode,d=e.shouldFocus,p=e.setShouldFocus,f=e.isMakingACopy,g=e.savedScriptName,m=e.scriptName,h=e.setScriptName,b=Object(n.useState)(!1),v=b[0],y=b[1];return u?a.a.createElement(qs,null,a.a.createElement(co,{theme:t,script:r,savedScriptName:g,scriptName:m,hasEditPrivileges:o,otherScriptNames:s,scriptSavingStatus:i,saveScript:c,fontSize:e.theme.fontSizes.small,fontWeight:600,originalPage:"Editor",editorNameEditMode:u,setEditorNameEditMode:l,shouldFocus:d,setShouldFocus:p,setScriptName:h,setButtonHasFocus:y}),!o&&a.a.createElement(Qs,null,"[",strings.Editor.ReadOnlyLabel,"]")):a.a.createElement(Ks,{buttonHasFocus:v,onFocusCapture:function(){y(!0)},onBlurCapture:function(){y(!1)}},a.a.createElement(S.a,{iconName:r.localUpdates.shareId?"OfficeScriptsSharedIcon":"OfficeScriptsIcon",styles:{root:{marginTop:".2rem",fontSize:t.fontSizes.icon}}}),a.a.createElement(co,{theme:t,script:r,savedScriptName:g,scriptName:m,hasEditPrivileges:o,otherScriptNames:s,scriptSavingStatus:i,saveScript:c,fontSize:e.theme.fontSizes.small,fontWeight:600,originalPage:"Editor",editorNameEditMode:u,setEditorNameEditMode:l,shouldFocus:d,setShouldFocus:p,setScriptName:h,setButtonHasFocus:y}),o&&!f&&a.a.createElement(Js,null,a.a.createElement(Wo,{status:i})),!o&&a.a.createElement(Zs,null,"[",strings.Editor.ReadOnlyLabel,"]"))})),Ks=l.b.div(zs(),(function(e){return e.buttonHasFocus?"0.1rem solid "+e.theme.colors.neutralSecondary:"none"}),(function(e){return e.buttonHasFocus?"0 "+e.theme.spacing.medium:"0.1rem "+e.theme.spacing.medium}),(function(e){return e.theme.colors.neutralQuaternaryAlt})),qs=l.b.div(Hs(),(function(e){return e.theme.spacing.medium})),Js=l.b.div(Us(),Object(Z.a)()?"0 auto 0 0":"0 0 0 auto"),Qs=l.b.div(Ws(),(function(e){return e.theme.colors.neutralPrimary})),Zs=l.b.div(Fs(),(function(e){return e.theme.colors.neutralPrimary})),Ys=r(738),Xs=Object(i.b)((function(e){return{showByDefault:c.b.settings.get(e,"editor.showContextualHelp"),outputLogs:c.b.bottomPanel.getOutputLogs(e),problemsLogs:c.b.bottomPanel.getProblemsLogs(e),helpLinks:c.b.bottomPanel.getHelpLinks(e),currentPivotKey:c.b.bottomPanel.getCurrentPivot(e),activeScriptId:c.b.editor.getActiveScriptId(e)||""}}),{hide:c.a.bottomPanel.hide,setCurrentPivotKey:c.a.bottomPanel.setCurrentPivot,editSetting:c.a.settings.edit.request})(Ys.b),$s=r(64),ec=r(226),tc=function(e){return!Object(Le.a)(e)},rc=Object(i.b)((function(e){var t=c.b.editor.getActiveScriptId(e);return{script:c.b.scripts.get(e,t),isScriptRunning:c.b.run.getIsRunning(e),disableHeader:!t||c.b.run.getIsRunning(e),navigationSourcePageName:c.b.editor.getNavigationSourcePage(e),mostRecentRecorderHeartbeatReceived:c.b.editor.getMostRecentRecorderHeartbeatReceived(e)}}),{runScript:c.a.run.request,makeCopyOfActiveScript:c.a.editor.makeACopyOfScript,saveScript:c.a.scripts.saveScriptToStorage.request,showBottomPanel:c.a.bottomPanel.show,hideBottomPanel:c.a.bottomPanel.hide,showBackstage:c.a.backstage.show,dismissMessage:c.a.messageBar.dismiss,showDialog:c.a.dialog.show,revertToLastSaved:c.a.scripts.revertToLastSaved,setBottomPanelPivotKey:c.a.bottomPanel.setCurrentPivot,setCurrentPivotKey:c.a.backstage.setCurrentPivot})((function(e){var t=!Object(ec.a)();Object(n.useEffect)((function(){window.document.title=strings.PageTitles.CodeEditor}));var r,i,o,s={marginTop:".1rem"},u={marginTop:".1rem",opacity:"50%"},l=Object(Le.a)(e.script),p=Ki(e.script,e.isScriptRunning,e.mostRecentRecorderHeartbeatReceived),f=!p&&Object(Vi.a)(e.mostRecentRecorderHeartbeatReceived),g=Ar(e.script,e.isStorageCallInProgress),h=qi(e.script,e.isStorageCallInProgress),b=Me(e.script,e.isScriptRunning,e.isStorageCallInProgress),v=Be(e.script,e.isScriptRunning,e.isStorageCallInProgress),S=(r=e.script,i=e.isScriptRunning,o=e.isStorageCallInProgress,!!r&&!tc(r)&&Object(Gi.a)(r)&&Object(De.a)(r)&&!o&&!i),y={key:Object(m.a)("MainHeaderMakeACopy"),text:strings.Editor.MakeCopyButtonText,ariaLabel:strings.Editor.MakeCopyButtonText,iconProps:{iconName:"CopyIcon",style:b?s:u},disabled:!b,onClick:function(){e.makeCopyOfActiveScript({originalPage:"Editor"}),e.editableScriptNameRef&&e.editableScriptNameRef.current&&e.editableScriptNameRef.current.focus()}},O=!!e.script&&!l,x="Details"===e.navigationSourcePageName?strings.General.BackButtonDetailsPageLabel:strings.General.BackButtonAllScriptsLabel,j=[{key:Object(m.a)("MainHeaderRunButton"),text:strings.General.RunButtonText,ariaLabel:strings.General.RunButtonText,iconProps:{iconName:"PlayIcon"},tooltipText:f?strings.Details.RunButtonDisabledTooltipText:void 0,disabled:!p,onClick:function(){Object(d.j)(e.script,"Editor Header run button"),e.script&&e.runScript({script:e.script,version:"lastModified",entryPoint:"Editor Page"})}},O?y:{key:Object(m.a)("MainHeaderPublishButton"),text:strings.Editor.SaveButtonText,ariaLabel:strings.Editor.SaveButtonText,iconProps:{iconName:"SaveToCloudIcon"},disabled:!g,onClick:function(){Object(d.j)(e.script,"Editor Header save button"),e.script&&(Object(d.h)({eventName:"ControlAction",eventType:"User",data:{control:"MainHeaderPublishButton",location:"Editor",storageId:e.script.storageScript.id,navigationSourcePage:e.navigationSourcePageName}}),e.saveScript({script:e.script,updatedMetadata:{}}))},additionalStyles:{iconDisabled:{opacity:.5}},tooltipText:l?"":strings.Message.OnlyScriptOwner}];return a.a.createElement(nc,null,a.a.createElement(Xn,{buttonText:x,returnToPreviousPage:function(){e.isScriptRunning||e.dismissMessage(),"Details"===e.navigationSourcePageName?e.showDetailsPage():(l?e.setCurrentPivotKey(ln.Recent):e.script&&Object(st.a)(e.script)?e.setCurrentPivotKey(ln.Samples):e.setCurrentPivotKey(ln.Attached),e.showBackstage())}}),a.a.createElement(At,{disabled:e.disableHeader,primaryCommands:j,overflowCommands:[!O&&y,{key:Object(m.a)("MainHeaderOverflowDelete"),text:strings.Editor.DeleteButtonText,ariaLabel:strings.Editor.DeleteButtonText,iconProps:{iconName:"AfterDeleteIcon",style:v?s:u},disabled:!v,onClick:function(){e.showDialog({title:strings.Dialog.ConfirmDeleteDialogLabel,subText:strings.Dialog.DeleteWarningText,buttons:[{key:Object(m.a)("DeleteDialogDeleteButton"),text:strings.Dialog.DeleteButtonText,ariaLabel:strings.Dialog.DeleteButtonText,action:c.a.scripts.remove.request(Object(d.j)(e.script,"Editor Header delete button")),isPrimary:!0},{key:Object(m.a)("DeleteDialogCancelButton"),text:strings.General.CancelButtonText,ariaLabel:strings.General.CancelButtonText,action:c.a.dialog.dismiss(),isPrimary:!1}]})}},{key:Object(m.a)("MainHeaderOverflowRevertToSavedButton"),text:strings.Editor.DiscardChangesButtonText,ariaLabel:strings.Editor.DiscardChangesButtonText,iconProps:{iconName:Object(Z.a)()?"UndoIconRtl":"UndoIcon",style:S?s:u},disabled:!S,onClick:function(){Object(d.j)(e.script,"Editor Header revert to last saved button"),e.script&&e.revertToLastSaved(e.script)}},{key:Object(m.a)("MainHeaderOverflowRenameButton"),text:strings.Editor.RenameButtonText,ariaLabel:strings.Editor.RenameButtonText,iconProps:{iconName:"RenameIcon",style:h?s:u},disabled:!h,onClick:function(){e.editMode||e.setEditMode(!0),Object(d.h)({eventName:"ControlAction",eventType:"User",data:{control:"RenameButton",location:"Overflow"}})}},{key:Object(m.a)("MainHeaderOverflowConsole"),text:strings.Editor.ConsoleButtonText,ariaLabel:strings.Editor.ConsoleButtonText,ariaDescription:strings.Editor.ConsoleAriaDescription,iconProps:{iconName:"AccReportBlankIcon",style:s},onClick:function(){e.setShouldFocusBottomPanel(!0),e.setBottomPanelPivotKey(Ys.a.Output),e.showBottomPanel()}},{key:Object(m.a)("MainHeaderOverflowHelpButton"),text:strings.Editor.HelpButtonText,ariaLabel:strings.Editor.HelpButtonText,iconProps:{iconName:"Info",style:s},onClick:function(){e.setShouldFocusBottomPanel(!0),e.setBottomPanelPivotKey(Ys.a.Help),e.showBottomPanel()}},{key:Object(m.a)("MainHeaderOverflowSettingsButton"),text:strings.Editor.SettingsButtonText,ariaLabel:strings.Editor.SettingsButtonText,iconProps:{iconName:"CurrentViewSettingsIcon",style:s},onClick:function(){e.showSettingsPage()}},t&&{key:"MainHeaderOverflowOptionsButton",text:strings.PageTitles.About,iconProps:{iconName:"PlayerSettings"},onClick:function(){window.sessionStorage.setItem(Object(Mt.a)("ShowBackButton"),"1"),window.location.hash=$s.a.About}},Object(zr.a)().FeedbackEnabled&&{key:"MainHeaderOverflowOptionsButton",text:strings.Editor.SendFeedbackButtonText,iconProps:{iconName:"Feedback"},onClick:function(){window.OfficeBrowserFeedback.multiFeedback().catch((function(e){Object(d.g)(e,"Unexpected",d.a.Information)}))}}].filter((function(e){return e})),isDetailsPage:!1}))})),nc=l.b.div.withConfig({displayName:"EditorHeader__Wrapper",componentId:"sc-1fukbqc-0"})(["padding:0 ",";"],(function(e){return e.theme.spacing.small}));function ac(){return(ac=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var ic=Object(i.b)((function(e,t){var r={script:t.script,isReadOnly:!1,isMonacoLoading:!1,externalContentUpdateCounter:0,isStorageCallInProgress:!1,monacoEditorOnWindowName:window.Cypress?"MONACO_EDITOR":void 0,isReactMonacoLoaded:!1},n=B.a.scripts.getIsStorageCallInProgress(e,t.script.storageScript.id);return ac({},r,{isReadOnly:n||B.a.run.getIsRunning(e)||tc(t.script),isMonacoLoading:B.a.editor.getIsLoading(e),externalContentUpdateCounter:B.a.editor.getExternalContentUpdateCounter(e),isStorageCallInProgress:n,isReactMonacoLoaded:B.a.backstage.getIsReactMonacoLoaded(e),navigationSourcePageName:B.a.editor.getNavigationSourcePage(e)})}),{editorDidMount:L.a.editor.onMount,onValueChange:L.a.scripts.editBody,saveScript:L.a.scripts.saveScriptToStorage.request})(Fr),oc=Object(i.b)((function(e){var t=c.b.scripts.get(e,c.b.editor.getActiveScriptId(e)),r=c.b.scripts.getIsScriptOwner(e,t?t.storageScript.id:void 0),n=c.b.scripts.getSavingStatus(e,t?t.storageScript.id:null),a=c.b.scripts.getIsStorageCallInProgress(e,t?t.storageScript.id:null),i=c.b.scripts.getOtherOwnedScriptNames(e,(t||{storageScript:{}}).storageScript.id);return{isBottomPanelVisible:c.b.bottomPanel.getIsVisible(e),savingStatus:n,script:t,isScriptOwner:r,isStorageCallInProgress:a,localOtherOwnedScriptNames:i,isMakingACopy:c.b.editor.getIsMakingACopy(e),isEditingScriptName:c.b.editor.getIsEditingScriptName(e)}}),{showDetailsPage:c.a.editor.showDetailsPage,saveScript:c.a.scripts.saveScriptToStorage.request,setIsEditingScriptName:c.a.editor.setIsEditingScriptName})((function(e){var t=e.isBottomPanelVisible,r=e.savingStatus,i=e.isStorageCallInProgress,o=e.script,s=e.isScriptOwner,c=e.localOtherOwnedScriptNames,u=e.isMakingACopy,l=e.isEditingScriptName,d=e.showDetailsPage,f=e.showSettingsPage,g=e.saveScript,m=e.setIsEditingScriptName,h=Object(n.useState)(!1),b=h[0],v=h[1],S=Object(n.useRef)(null),O=Object(n.useState)(!1),x=O[0],j=O[1],w=o?o.storageScript.name:"",E=Object(n.useState)(w),k=E[0],C=E[1];return Object(n.useEffect)((function(){C(o?o.storageScript.name:"")}),[null==o?void 0:o.storageScript.name]),Object(n.useEffect)((function(){"Failed"===r&&w!==k&&C(w)}),[r,w]),Object(n.useEffect)((function(){!0===u&&j(!0)}),[u]),a.a.createElement(W.a,{header:a.a.createElement(rc,{isStorageCallInProgress:i,showDetailsPage:d,showSettingsPage:f,setShouldFocusBottomPanel:function(e){return v(e)},editableScriptNameRef:S,editMode:l,setEditMode:m}),main:a.a.createElement(sc,null,o?a.a.createElement(a.a.Fragment,null,a.a.createElement(Vs,{script:o,savedScriptName:w,scriptName:k,scriptSavingStatus:r,isStorageCallInProgress:i,isScriptOwner:s,otherScriptNames:c,saveScript:g,editMode:l,setEditMode:m,shouldFocus:x,setShouldFocus:j,isMakingACopy:u,setScriptName:C}),a.a.createElement(Bs,null,a.a.createElement(ts,null),u?a.a.createElement(uc,null,a.a.createElement(Ht.a,{size:zt.a.large,ariaLabel:strings.Editor.MakingACopySpinner,label:strings.Editor.MakingACopySpinnerAriaLabel,styles:Object(y.c)(zt.a.large)})):a.a.createElement(ic,{script:o}),a.a.createElement(p.a,{when:t},a.a.createElement(Xs,{shouldFocusBottomPanel:b,setShouldFocusBottomPanel:function(e){return v(e)}})))):a.a.createElement(cc,null,a.a.createElement(Ht.a,{size:zt.a.large,styles:{circle:{border:"2px solid #9fcdb3",borderTop:"2px solid #217346",width:"30px",height:"30px",animation:"loading-animation 1s linear infinite"}}})))})})),sc=l.b.div.withConfig({displayName:"CodeEditor__MainWrapper",componentId:"sc-1d66gn5-0"})(["height:100%;width:100%;"]),cc=l.b.div.withConfig({displayName:"CodeEditor__SpinnerWrapper",componentId:"sc-1d66gn5-1"})(["height:100%;width:100%;display:flex;align-items:center;justify-content:center;"]),uc=l.b.div.withConfig({displayName:"CodeEditor__SpinnerArea",componentId:"sc-1d66gn5-2"})(["width:100%;height:calc(100% - 3.2rem);background:",";display:flex;align-items:center;justify-content:center;"],(function(e){return e.theme.colors.neutralLighterAlt})),lc=r(833),dc=!1,pc="",fc="",gc=0,mc=0,hc=Object(i.b)((function(e){return{isBackstageVisible:c.b.backstage.getIsVisible(e),isDetailsPageVisible:c.b.editor.getIsDetailsPageVisible(e),detailsNavigateSource:c.b.editor.getDetailsNavigateSource(e)}}),{setDetailsNavigateSource:c.a.editor.setDetailsNavigateSource})((function(e){var t=e.isBackstageVisible,r=e.isDetailsPageVisible,i=e.detailsNavigateSource,o=e.setDetailsNavigateSource,s=Object(n.useState)(!1),c=s[0],u=s[1];return fc=pc,pc=t?"Backstage":r?"Details":"Editor",i&&"Details"==pc?(Object(d.c)(i,pc),o(null)):Object(d.c)(fc,pc),Object(n.useEffect)((function(){dc||window.addEventListener("resize",Ut()((function(){var e=window.innerWidth,t=window.innerHeight;e==gc&&t==mc||Object(d.h)({eventName:"WindowResized",eventType:"System",data:{height:t,previousHeight:mc,width:e,previousWidth:gc,page:pc}}),gc=e,mc=t}),3e3)),dc=!0,gc=window.innerWidth,mc=window.innerHeight})),a.a.createElement(bc,{"data-testid":Object(m.a)("CodeEditor")},a.a.createElement(lc.a,null),a.a.createElement(F,null),t?a.a.createElement(a.a.Fragment,null,a.a.createElement(ts,null),a.a.createElement(xn,null)):r?a.a.createElement(Ls,null):c?a.a.createElement(Tn,{hideSettingsPage:function(){return u(!1)}}):a.a.createElement(oc,{showSettingsPage:function(){return u(!0)}}),a.a.createElement(p.a,{when:["local","alpha"].includes(Object(f.a)())},a.a.createElement(vc,null,a.a.createElement("span",null,Object(f.a)()+" editor using "+Object(g.c)()))))})),bc=l.b.div.withConfig({displayName:"EditorMain__Wrapper",componentId:"sc-19e5x8c-0"})(["height:100%;width:100%;padding-bottom:",";display:flex;flex-direction:column;"],(function(e){return e.theme.spacing.medium})),vc=l.b.footer.withConfig({displayName:"EditorMain__Footer",componentId:"sc-19e5x8c-1"})(["background-color:black;color:limegreen;height:",";width:100%;padding:0 1rem;display:flex;justify-content:flex-end;font-size:1.2rem;"],(function(e){return e.theme.spacing.medium})),Sc=r(705),yc=r(649),Oc=r(640),xc=r(707),jc=Object(yc.combineReducers)({isVisible:function(e,t){switch(void 0===e&&(e=!0),t.type){case Object(Oc.getType)(xc.show):return!0;case Object(Oc.getType)(xc.hide):return!1;default:return e}},currentPivot:function(e,t){switch(void 0===e&&(e=null),t.type){case Object(Oc.getType)(xc.setCurrentPivot):return t.payload;default:return e}},isReactMonacoLoaded:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(Oc.getType)(xc.setIsReactMonacoLoaded):return!0;default:return e}}}),wc=r(708),Ec=r(681);function kc(e){var t=Ec.c.filter((function(t){return t.id===e}));if(1!==t.length)throw new Error("Did not find link for key "+e+". This is an internal bug.");return t[0]}function Cc(e,t){for(var r=function(e){var t=Object.keys(e).map((function(t){return{linkId:t,count:e[t]}}));return t.sort((function(e,t){return t.count-e.count})),t}(e).filter((function(e){return e.count>0}));r.length>t;)r.pop();var n=r.map((function(e){return e.linkId}));return Ec.b.forEach((function(e){n.length<t&&n.indexOf(e)<0&&n.push(e)})),n.map((function(e){return kc(e)}))}var _c=Ec.b.map((function(e){return kc(e)})),Rc=Object(yc.combineReducers)({isVisible:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(Oc.getType)(wc.show):return!0;case Object(Oc.getType)(wc.hide):return!1;default:return e}},currentPivot:function(e,t){switch(void 0===e&&(e=null),t.type){case Object(Oc.getType)(wc.setCurrentPivot):return t.payload;default:return e}},outputLogs:function(e,t){switch(void 0===e&&(e=[]),t.type){case Object(Oc.getType)(wc.addOutputLogs):return[].concat(e,t.payload);case Object(Oc.getType)(wc.clearOutputLogs):return[];default:return e}},problemsLogs:function(e,t){switch(void 0===e&&(e=[]),t.type){case Object(Oc.getType)(wc.setProblemsLogs):return t.payload;case Object(Oc.getType)(wc.clearProblemsLogs):return[];default:return e}},helpLinks:function(e,t){switch(void 0===e&&(e=_c),t.type){case Object(Oc.getType)(wc.setHelpLinks):return t.payload;default:return e}}}),Pc=r(709),Tc=Object(yc.combineReducers)({isVisible:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(Oc.getType)(Pc.show):return!0;case Object(Oc.getType)(Pc.hide):return!1;default:return e}}}),Ic=r(758),Dc=r(712),Ac=Object(yc.combineReducers)({isVisible:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(Oc.getType)(Dc.show):return!0;case Object(Oc.getType)(Dc.hide):return!1;default:return e}}}),Mc=r(713),Nc=Object(yc.combineReducers)({isVisible:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(Oc.getType)(Mc.show):return!0;case Object(Oc.getType)(Mc.hide):return!1;default:return e}}}),Lc=r(759),Bc=r(795),Fc=r(744),Wc=r(796),Uc=r(834),Hc=r(697);function zc(){return(zc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Gc=Object.keys(kn.a).map((function(e){return e})).reduce((function(e,t){var r;return zc({},e,((r={})[t]=kn.a[t].defaultValue,r))}),{}),Vc=Object(yc.combineReducers)({settings:function(e,t){switch(void 0===e&&(e=Gc),t.type){case Object(Oc.getType)(Hc.edit.success):return zc({},e,t.payload);default:return e}}}),Kc=r(664),qc=r(760);function Jc(e){e.addAction({id:"trigger-suggest",label:"Trigger suggestion",keybindings:[monaco.KeyCode.F2],contextMenuGroupId:"navigation",contextMenuOrder:0,run:function(){return e.trigger("editor","editor.action.triggerSuggest",{})}})}var Qc=r(745);function Zc(e){return{theme:(t=e["editor.theme"],{Office:"vs",Light:"vs",Dark:"vs-dark","High Contrast":"hc-black"}[t]),fontFamily:["Menlo","Source Code Pro","Consolas","Courier New","monospace"].map((function(e){return e.includes(" ")?JSON.stringify(e):e})).join(", "),fontSize:e["editor.fontSize"],lineHeight:e["editor.fontSize"]*Qc.a,wordWrap:e["editor.wordWrap"].toLowerCase(),tabSize:e["editor.tabSize"],minimap:{enabled:e["editor.minimap"]},folding:e["editor.folding"],lineNumbers:"on",lineNumbersMinChars:4,scrollbar:{vertical:"visible",arrowSize:15},formatOnPaste:!0,glyphMargin:!1,fixedOverflowWidgets:!0,ariaLabel:"editor",wordWrapColumn:120,wrappingIndent:"indent",selectOnLineNumbers:!0};var t}var Yc=0,Xc=function(e){return{id:""+Yc++,message:"["+e.startLineNumber+", "+e.startColumn+"] "+e.message,severity:$c(e.severity)}},$c=function(e){switch(e){case monaco.MarkerSeverity.Hint:return Ec.a.Log;case monaco.MarkerSeverity.Info:return Ec.a.Info;case monaco.MarkerSeverity.Warning:return Ec.a.Warn;case monaco.MarkerSeverity.Error:return Ec.a.Error;default:throw new Error("Invalid marker severity")}},eu=r(761),tu=r(780);var ru,nu=function(e,t){var r=Object(eu.a)(t,e.storageScript.name);return Object(tu.a)({name:r,description:e.storageScript.description,body:e.localUpdates.body||e.storageScript.body,apiInfo:e.storageScript.apiInfo})},au=r(48);function iu(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function ou(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){iu(i,n,a,o,s,"next",e)}function s(e){iu(i,n,a,o,s,"throw",e)}o(void 0)}))}}function su(){return(su=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var cu={tabWidth:2};function uu(e){cu=su({},cu,e)}function lu(e){return du.apply(this,arguments)}function du(){return(du=ou(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fu().then((function(){return pu(t,cu)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pu(e,t){try{return ru?ru.js_beautify(e,{indent_size:t.tabWidth,break_chained_methods:!0,brace_style:Object(au.a)("CurlyBracesOnNewLine")?"expand":"collapse"}):e}catch(r){return e}}function fu(){return gu.apply(this,arguments)}function gu(){return(gu=ou(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ru){e.next=2;break}return e.abrupt("return",ru);case 2:return e.abrupt("return",Object(rr.a)("formatter",(function(){return r.e(11).then(r.t.bind(null,1386,7))})).then((function(e){return ru=e.default,e.default})));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var mu=r(731);function hu(e,t,r){var n=e.getModel();monaco.editor.setModelMarkers(n,t,r)}var bu=r(1060),vu=r.n(bu),Su={MainFunction:null,FunctionArgument:null,SyncApi:null};function yu(e){if(!Su[e]){var t=new vu.a;t.addEventListener("error",(function(r){t.terminate(),Su[e]=null,Object(d.g)(new Error("Unexpected error in Monaco marker web worker: "+r.message),"Unexpected",d.a.Warning,"Monaco")})),Su[e]=t}return Su[e]}var Ou=r(835),xu=r(836),ju=r(756);function wu(){return Object(zr.f)().ServerDocId+":"+Object(zr.f)().TenantId}function Eu(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function ku(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){Eu(i,n,a,o,s,"next",e)}function s(e){Eu(i,n,a,o,s,"throw",e)}o(void 0)}))}}var Cu=function(){var e=this;Object.defineProperty(this,"getConsent",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=ku(regeneratorRuntime.mark((function e(t,r){var n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new d.b("GetConsent","System"),e.prev=1,e.next=4,Object(Vr.b)((function(e){return Object(Kr.getConsent)(t,r,e)}),n,(function(){return!1}));case 4:return a=e.sent,n.end(!0,d.a.Information,{storageId:t,isConsented:!!a}),e.abrupt("return",a);case 9:throw e.prev=9,e.t0=e.catch(1),n.end(!1,d.a.Warning,{ErrorText:Object(er.a)(e.t0)}),e.t0;case 13:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(t,r){return e.apply(this,arguments)}}()}),Object.defineProperty(this,"putConsent",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=ku(regeneratorRuntime.mark((function e(t,r){var n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={documentId:r,scriptId:t,scopes:["ReadWriteCurrentDocument"]},a=new d.b("PutConsent","User"),e.prev=2,e.next=5,Object(Vr.b)((function(e){return Object(Kr.putConsent)(n,e)}),a,(function(){return!1}));case 5:a.end(!0,d.a.Information,{storageId:t}),e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(2),a.end(!1,d.a.Warning,{ErrorText:Object(er.a)(e.t0)}),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t,r){return e.apply(this,arguments)}}()}),Object.defineProperty(this,"deleteConsent",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=ku(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new d.b("DeleteConsent","User"),e.prev=1,e.next=4,Object(Vr.b)((function(e){return Object(Kr.deleteConsent)(t,e)}),r,(function(){return!1}));case 4:r.end(!0,d.a.Information,{storageId:t}),e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(1),r.end(!1,d.a.Warning,{ErrorText:Object(er.a)(e.t0)}),e.t0;case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}()}),Object.defineProperty(this,"acceptConsent",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=ku(regeneratorRuntime.mark((function t(r,n){var a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===n&&(n=["ReadWriteCurrentDocument"]),!Object(au.a)("ConsentWithMakerService")){t.next=5;break}return t.next=4,e.putConsent(r.storageScript.id,wu());case 4:return t.abrupt("return",r);case 5:return a=new d.b("ConsentForScript","User"),t.prev=6,t.next=9,Object(Vr.a)(a.id);case 9:return t.next=11,ju.a.writeConsentRecord({documentId:wu(),scriptId:r.storageScript.id,scopes:n});case 11:return a.end(!0,d.a.Information,{storageId:r.storageScript.id,accept:!0}),t.abrupt("return",r);case 15:throw t.prev=15,t.t0=t.catch(6),a.end(!1,Object(qr.d)(t.t0)?d.a.Warning:d.a.Error,{storageId:r.storageScript.id,accept:!0,ErrorText:Object(er.a)(t.t0)},t.t0),t.t0;case 19:case"end":return t.stop()}}),t,null,[[6,15]])})));return function(e,r){return t.apply(this,arguments)}}()}),Object.defineProperty(this,"denyConsent",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=ku(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Object(au.a)("ConsentWithMakerService")){t.next=4;break}return t.next=3,e.deleteConsent(r.storageScript.id);case 3:return t.abrupt("return",r);case 4:return n=new d.b("ConsentForScript","User"),t.prev=5,t.next=8,Object(Vr.a)(n.id);case 8:return t.next=10,ju.a.revokeConsentForAllDocuments(r.storageScript.id);case 10:return n.end(!0,d.a.Information,{storageId:r.storageScript.id,accept:!1}),t.abrupt("return",r);case 14:throw t.prev=14,t.t0=t.catch(5),n.end(!1,Object(qr.d)(t.t0)?d.a.Warning:d.a.Error,{storageId:r.storageScript.id,accept:!1,ErrorText:Object(er.a)(t.t0)},t.t0),t.t0;case 18:case"end":return t.stop()}}),t,null,[[5,14]])})));return function(e){return t.apply(this,arguments)}}()}),Object.defineProperty(this,"getScriptConsentValue",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=ku(regeneratorRuntime.mark((function t(r,n){var a,i,o,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===n&&(n=["ReadWriteCurrentDocument"]),!Object(au.a)("ConsentWithMakerService")){t.next=6;break}return t.next=4,e.getConsent(r.storageScript.id,wu());case 4:return a=t.sent,t.abrupt("return",!!a);case 6:return i=new d.b("GetScriptConsentValues","System"),o=!1,t.prev=8,t.next=11,Object(Vr.a)(i.id);case 11:return t.next=13,ju.a.getConsentRecord(r.storageScript.id,wu());case 13:return(s=t.sent)&&(o=n.every((function(e){return s.scopes.includes(e)}))),i.end(!0,d.a.Information,{storageId:r.storageScript.id,isConsented:o}),t.abrupt("return",o);case 19:throw t.prev=19,t.t0=t.catch(8),i.end(!1,Object(qr.d)(t.t0)?d.a.Warning:d.a.Error,{storageId:r.storageScript.id,ErrorText:Object(er.a)(t.t0)},t.t0),t.t0;case 23:case"end":return t.stop()}}),t,null,[[8,19]])})));return function(e,r){return t.apply(this,arguments)}}()})},_u=function(){function e(){}return e.instance=function(){if(!e._instance)switch(Object(g.c)()){case g.b.makerserviceprodnew:case g.b.makerserviceint:case g.b.makerservicetest:case g.b.makerservicelocal:case g.b.localstorage:e._instance=new Cu;break;default:throw new Error(g.a)}return e._instance},e}();Object.defineProperty(_u,"_instance",{configurable:!0,enumerable:!0,writable:!0,value:void 0});var Ru=r(763),Pu=function(){function e(){}return e.instance=function(){if(!e._instance)switch(Object(g.c)()){case g.b.makerserviceprodnew:case g.b.makerserviceint:case g.b.makerservicetest:case g.b.makerservicelocal:case g.b.localstorage:e._instance=new Ru.a;break;default:throw new Error(g.a)}return e._instance},e}();Object.defineProperty(Pu,"_instance",{configurable:!0,enumerable:!0,writable:!0,value:void 0});var Tu=r(730);function Iu(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function Du(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){Iu(i,n,a,o,s,"next",e)}function s(e){Iu(i,n,a,o,s,"throw",e)}o(void 0)}))}}function Au(e,t){return Mu.apply(this,arguments)}function Mu(){return(Mu=Du(regeneratorRuntime.mark((function e(t,n){var a,i,o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Cr(n);case 2:return a=e.sent,e.next=5,Object(rr.a)("parser",(function(){return Promise.all([r.e(1),r.e(18)]).then(r.t.bind(null,1387,7))}));case 5:return i=e.sent,o=i.parseTypescriptToFlow,s=i.MakerApiType,c=n===$t.synchronous?s.MakerSyncApi:s.BatchApi,e.abrupt("return",o(t,{libSource:a,makerApiType:c,parseImplicitTypes:!0}));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nu(){return(Nu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Lu=function(e,t){return{storageScript:e.storageScript,localUpdates:Nu({},e.localUpdates,t)}},Bu=r(718),Fu=r(798),Wu=r(227),Uu=r(715),Hu=new(function(){function e(e){if(Object.defineProperty(this,"searches",{configurable:!0,enumerable:!0,writable:!0,value:[]}),this.searches=e.map((function(e){var t=e.tokens;if(0===t.length)throw new Error("No search terms found for key "+e.id);var r=t.map((function(e){return e.toLowerCase()})).join("|");return{linkId:e.id,exp:new RegExp(r,"i")}})),0===this.searches.length)throw new Error("No keys provided for recommender")}var t=e.prototype;return t.recommend=function(e,t){return Cc(this.createCounts(e),t)},t.createCounts=function(e){var t=this,r=this.emptyCounts();return e.split("\n").forEach((function(e){t.searches.forEach((function(t){e.match(t.exp)&&r[t.linkId]++}))})),r},t.getName=function(){return"NLPV1"},t.emptyCounts=function(){var e={};return this.searches.forEach((function(t){e[t.linkId]=0})),e},e}())([{id:"contextualHelpRange",tokens:["range","cell","grid",strings.Recommendations.Range]},{id:"contextualHelpWorkbook",tokens:["book","document","workbook",strings.Recommendations.Workbook]},{id:"contextualHelpPivotTable",tokens:["pivot",strings.Recommendations.PivotTable]},{id:"contextualHelpChart",tokens:["chart",strings.Recommendations.Chart]},{id:"contextualHelpComment",tokens:["comment","mention","task",strings.Recommendations.Comment]},{id:"contextualHelpRangeFormat",tokens:["format","color","range",strings.Recommendations.RangeFormat]},{id:"contextualHelpShape",tokens:["shape",strings.Recommendations.Shape]},{id:"contextualHelpTable",tokens:["table",strings.Recommendations.Table]},{id:"contextualHelpWorksheet",tokens:["worksheet","sheet",strings.Recommendations.Worksheet]}]);var zu=r(56);function Gu(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function Vu(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){Gu(i,n,a,o,s,"next",e)}function s(e){Gu(i,n,a,o,s,"throw",e)}o(void 0)}))}}var Ku=regeneratorRuntime.mark(bl),qu=regeneratorRuntime.mark(vl),Ju=regeneratorRuntime.mark(Sl),Qu=regeneratorRuntime.mark(yl),Zu=regeneratorRuntime.mark(Ol),Yu=regeneratorRuntime.mark(xl),Xu=regeneratorRuntime.mark(jl),$u=regeneratorRuntime.mark(wl),el=regeneratorRuntime.mark(El),tl=regeneratorRuntime.mark(kl),rl=regeneratorRuntime.mark(Cl),nl=regeneratorRuntime.mark(_l),al=regeneratorRuntime.mark(Rl),il=regeneratorRuntime.mark(Pl),ol=regeneratorRuntime.mark(Tl),sl=regeneratorRuntime.mark(Il),cl=regeneratorRuntime.mark(Dl),ul=regeneratorRuntime.mark(Al),ll=regeneratorRuntime.mark(Ml),dl=regeneratorRuntime.mark(Bl),pl=regeneratorRuntime.mark(Fl),fl=regeneratorRuntime.mark(Wl),gl=regeneratorRuntime.mark(Ul),ml=regeneratorRuntime.mark(Hl),hl=regeneratorRuntime.mark(Vl);function bl(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.fetchMetadataFromStorage.request),Ol);case 2:return e.next=4,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.fetchScriptsFromDocument.request),xl);case 4:return e.next=6,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.fetchSamples.request),jl);case 6:return e.next=8,Object(Kc.l)(Object(Oc.getType)(Ae.a.editor.setActive),Sl);case 8:return e.next=10,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.fetchScriptFromStorage.request),wl);case 10:return e.next=12,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.fetchScriptFromStorage.success),El);case 12:return e.next=14,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.fetchSharedScriptFromStorage.success),Cl);case 14:return e.next=16,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.saveScriptToStorage.request),Pl);case 16:return e.next=18,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.saveScriptToStorage.success),Tl);case 18:return e.next=20,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.saveScriptToStorage.failure),Dl);case 20:return e.next=22,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.editBody),Bl);case 22:return e.next=24,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.partialUpdate),Fl);case 24:return e.next=26,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.remove.request),_l);case 26:return e.next=28,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.remove.success),Rl);case 28:return e.next=30,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.acceptConsent.request),Al);case 30:return e.next=32,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.denyConsent.request),Ml);case 32:return e.next=34,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.addScriptToWorkbook.request),Wl);case 34:return e.next=36,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.removeScriptFromWorkbook.request),Ul);case 36:return e.next=38,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.unshareScriptFromAllWorkbooks.request),Hl);case 38:return e.next=40,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.revertToLastSaved),Vl);case 40:case"end":return e.stop()}}),Ku)}function vl(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(Kc.h)(Ae.a.scripts.fetchMetadataFromStorage.request());case 2:return t.next=4,Object(Kc.i)({success:Object(Kc.k)(Object(Oc.getType)(Ae.a.scripts.fetchMetadataFromStorage.success)),failure:Object(Kc.k)(Object(Oc.getType)(Ae.a.scripts.fetchMetadataFromStorage.failure))});case 4:if(e=t.sent,e.success,e.failure,"Editor"!==Object($s.b)()){t.next=12;break}return t.next=10,Object(Kc.h)(Ae.a.scripts.fetchScriptsFromDocument.request());case 10:return t.next=12,Object(Kc.h)(Ae.a.scripts.fetchSamples.request());case 12:case"end":return t.stop()}}),qu)}function Sl(e){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(Kc.j)(Ae.b.scripts.get,e.payload.id);case 2:if(!(t=r.sent)||!t.storageScript.dateFirstPublished){r.next=6;break}return r.next=6,Object(Kc.b)(yl,t);case 6:case"end":return r.stop()}}),Ju)}function yl(e){var t,r,n,a,i,o,s,c;return regeneratorRuntime.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return r=Date.now(),u.next=3,Object(Kc.j)(Ae.b.scripts.getAttachingStatus,e.storageScript.id);case 3:if("InProgress"===u.sent){u.next=7;break}return u.next=7,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:e.storageScript.id,status:"None"}));case 7:if(!Object(Le.a)(e)){u.next=41;break}return u.prev=8,u.next=11,Object(Kc.h)(Ae.a.scripts.storageCallInProgress({id:e.storageScript.id}));case 11:return u.next=13,Object(Kc.b)(Ou.a.instance);case 13:return n=u.sent,u.next=16,Object(Kc.b)(n.getScript,e.storageScript.id,e.localUpdates.shareId);case 16:return a=u.sent,t=a,u.next=20,Object(Kc.h)(Ae.a.scripts.fetchScriptFromStorage.success({script:a}));case 20:u.next=35;break;case 22:return u.prev=22,u.t0=u.catch(8),u.next=26,Object(Kc.h)(Ae.a.scripts.fetchScriptFromStorage.failure({error:u.t0}));case 26:if(Object(Ne.a)(e)){u.next=35;break}if(i=Object(qr.k)(u.t0)?strings.Message.FailedToOpenDeletedScriptMessage:Object(qr.q)(u.t0)?strings.Message.TimeOutErrorMessage:strings.Message.FailedToOpenScriptMessage,"Editor"!==Object($s.b)()){u.next=35;break}return u.next=31,Object(Kc.h)(Ae.a.backstage.setCurrentPivot("Recent"));case 31:return u.next=33,Object(Kc.h)(Ae.a.backstage.show());case 33:return u.next=35,Object(Kc.h)(Ae.a.messageBar.show({style:1,text:i}));case 35:return u.prev=35,u.next=38,Object(Kc.h)(Ae.a.scripts.storageCallComplete({id:e.storageScript.id}));case 38:return u.finish(35);case 39:u.next=69;break;case 41:if(!e.localUpdates.shareId){u.next=69;break}return u.prev=42,u.next=45,Object(Kc.h)(Ae.a.scripts.storageCallInProgress({id:e.storageScript.id}));case 45:return u.next=47,Object(Kc.b)(xu.a.instance().getSharedScript,e.localUpdates.shareId,e.storageScript.id);case 47:return o=u.sent,t=o,u.next=51,Object(Kc.h)(Ae.a.scripts.fetchSharedScriptFromStorage.success({script:t}));case 51:u.next=65;break;case 53:return u.prev=53,u.t1=u.catch(42),s=Object(qr.k)(u.t1)?strings.Message.FailedToOpenUnsharedScriptMessage:strings.Message.FailedToOpenSharedScriptMessage,u.next=58,Object(Kc.h)(Ae.a.scripts.fetchSharedScriptFromStorage.failure({error:u.t1}));case 58:if("Editor"!==Object($s.b)()){u.next=65;break}return u.next=61,Object(Kc.h)(Ae.a.backstage.setCurrentPivot("Attached"));case 61:return u.next=63,Object(Kc.h)(Ae.a.backstage.show());case 63:return u.next=65,Object(Kc.h)(Ae.a.messageBar.show({style:1,text:s}));case 65:return u.prev=65,u.next=68,Object(Kc.h)(Ae.a.scripts.storageCallComplete({id:e.storageScript.id}));case 68:return u.finish(65);case 69:c=Date.now(),t&&Object(d.h)({eventName:"RefetchScript",eventType:"System",data:{logLevel:d.a.Information,storageId:e.storageScript.id,location:"setActive",hasUpdatedBody:e.localUpdates.body!==t.localUpdates.body,scriptFetchTimeMs:c-r,scriptAge:Date.now()-e.localUpdates.dateLastModified}});case 71:case"end":return u.stop()}}),Qu,null,[[8,22,35,39],[42,53,65,69]])}function Ol(e){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!1,e.prev=1,!Object(zr.g)()){e.next=9;break}return t=!0,e.next=7,Object(Kc.b)(d.e);case 7:return e.next=9,Object(Kc.h)(Ae.a.scripts.publishedScriptMetadataReceived());case 9:return e.next=11,Object(Kc.b)(Ou.a.instance);case 11:return r=e.sent,e.next=14,Object(Kc.b)(r.getScripts);case 14:return n=e.sent,e.next=17,Object(Kc.h)(Ae.a.scripts.fetchMetadataFromStorage.success({scripts:n}));case 17:if(t||"Editor"!==Object($s.b)()){e.next=22;break}return e.next=20,Object(Kc.b)(d.e);case 20:return e.next=22,Object(Kc.h)(Ae.a.scripts.publishedScriptMetadataReceived());case 22:e.next=29;break;case 24:return e.prev=24,e.t0=e.catch(1),t||Object(zu.f)(strings.Message.UnexpectedError,strings.Message.FetchMetadataFailed),e.next=29,Object(Kc.h)(Ae.a.scripts.fetchMetadataFromStorage.failure({error:e.t0}));case 29:case"end":return e.stop()}}),Zu,null,[[1,24]])}function xl(e){var t,r,n,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(Kc.b)(Pu.instance().readScriptIdsFromWorkbook);case 3:if(t=e.sent,0!==t.length){e.next=10;break}return e.next=8,Object(Kc.h)(Ae.a.scripts.fetchScriptsFromDocument.success({scripts:[]}));case 8:e.next=18;break;case 10:return r=Object(Bu.b)(t),(n=Object(zr.i)())&&(a=n.map((function(e){return e.localUpdates.shareId})),r=r.filter((function(e){return!a.includes(e.shareId)}))),e.next=15,Object(Kc.b)(xu.a.instance().fetchAllDocAttachedScripts,r);case 15:return i=e.sent,e.next=18,Object(Kc.h)(Ae.a.scripts.fetchScriptsFromDocument.success({scripts:i}));case 18:e.next=28;break;case 20:if(e.prev=20,e.t0=e.catch(0),!(e.t0 instanceof Kr.MakerStorageError&&e.t0.errorCode===Kr.StorageErrorCode.WorkbookCustomXMLMalformed)){e.next=26;break}Object(d.g)(e.t0,"Unexpected",d.a.Debug,"Core"),e.next=28;break;case 26:return e.next=28,Object(Kc.h)(Ae.a.scripts.fetchScriptsFromDocument.failure({error:e.t0}));case 28:case"end":return e.stop()}}),Yu,null,[[0,20]])}function jl(e){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(Kc.b)(Wu.b);case 3:return t=e.sent,e.next=6,Object(Kc.h)(Ae.a.scripts.fetchSamples.success({scripts:t}));case 6:e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(0),e.next=12,Object(Kc.h)(Ae.a.scripts.fetchSamples.failure({error:e.t0}));case 12:case"end":return e.stop()}}),Xu,null,[[0,8]])}function wl(e){var t,r,n;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(Kc.h)(Ae.a.scripts.storageCallInProgress({id:e.payload.id}));case 3:return a.next=5,Object(Kc.b)(Ou.a.instance);case 5:return t=a.sent,a.next=8,Object(Kc.b)(t.getScript,e.payload.id,e.payload.shareId);case 8:return r=a.sent,a.next=11,Object(Kc.h)(Ae.a.scripts.fetchScriptFromStorage.success({script:r}));case 11:a.next=20;break;case 13:return a.prev=13,a.t0=a.catch(0),n=Object(qr.k)(a.t0)?strings.Message.FailedToOpenDeletedScriptMessage:Object(qr.q)(a.t0)?strings.Message.TimeOutErrorMessage:strings.Message.FailedToOpenScriptMessage,a.next=18,Object(Kc.h)(Ae.a.scripts.fetchScriptFromStorage.failure({error:a.t0}));case 18:return a.next=20,Object(Kc.h)(Ae.a.messageBar.show({style:1,text:n}));case 20:return a.prev=20,a.next=23,Object(Kc.h)(Ae.a.scripts.storageCallComplete({id:e.payload.id}));case 23:return a.finish(20);case 24:case"end":return a.stop()}}),$u,null,[[0,13,20,24]])}function El(e){var t,r,n,a,i,o,s;return regeneratorRuntime.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=e.payload.script,c.next=3,Object(Kc.j)(Ae.b.scripts.get,t.storageScript.id);case 3:if(r=c.sent,"Editor"!==Object($s.b)()){c.next=8;break}return c.next=7,Object(Kc.j)(Ae.b.editor.getActiveScriptId);case 7:n=c.sent;case 8:if(a=Object(mu.a)({incomingScript:t,existingScript:r}),i=a.selectedScript,o=a.isLocalBodyUpdated,s=a.hasConflict,!(r&&s&&n&&n===i.storageScript.id)){c.next=14;break}return c.next=12,Object(Kc.b)(kl,t,r);case 12:c.next=19;break;case 14:return c.next=16,Object(Kc.h)(Ae.a.scripts.update(i));case 16:if(!o){c.next=19;break}return c.next=19,Object(Kc.h)(Ae.a.editor.contentExternallyUpdated());case 19:return c.next=21,Object(Kc.b)(Tu.c,i);case 21:case"end":return c.stop()}}),el)}function kl(e,t){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(Kc.h)(Ae.a.dialog.show({title:strings.Editor.VersionConflictDialogTitle,subText:strings.Editor.VersionConflictDialogMainText,buttons:[{key:"KeepLocal",text:strings.Editor.VersionConflictDialogButton_LocalCopy,ariaLabel:strings.Editor.VersionConflictDialogButton_LocalCopyAriaLabel,lambda:Jl(t,"KeepLocal"),action:Ae.a.scripts.update(Object(mu.b)(e,t)),isPrimary:!1},{key:"RevertToPublished",text:strings.Editor.VersionConflictDialogButton_LatestPublished,ariaLabel:strings.Editor.VersionConflictDialogButton_LatestPublishedAriaLabel,lambda:Jl(t,"RevertToPublished"),action:[Ae.a.scripts.update(e),Ae.a.editor.contentExternallyUpdated()],isPrimary:!1}]}));case 2:case"end":return r.stop()}}),tl)}function Cl(e){var t,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=e.payload.script,r=!1,n.prev=2,n.next=5,Object(Kc.b)(_u.instance().getScriptConsentValue,t);case 5:r=n.sent,n.next=10;break;case 8:n.prev=8,n.t0=n.catch(2);case 10:return n.next=12,Object(Kc.h)(Ae.a.scripts.updateConsent({id:t.storageScript.id,value:r}));case 12:return n.next=14,Object(Kc.h)(Ae.a.scripts.update(t));case 14:case"end":return n.stop()}}),rl,null,[[2,8]])}function _l(e){var t,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=e.payload,Object(d.j)(t,"onRemoveScriptRequestSaga"),!Object(Gi.a)(t)){n.next=30;break}return n.prev=3,n.next=6,Object(Kc.h)(Ae.a.scripts.storageCallInProgress({id:t.storageScript.id}));case 6:return n.next=8,Object(Kc.b)(Ou.a.instance);case 8:return r=n.sent,n.next=11,Object(Kc.b)(r.removeScript,t);case 11:return n.next=13,Object(Kc.b)(Tu.a,t.storageScript.id);case 13:return n.next=15,Object(Kc.h)(Ae.a.scripts.remove.success({script:t}));case 15:n.next=24;break;case 17:if(n.prev=17,n.t0=n.catch(3),"Editor"!==Object($s.b)()){n.next=22;break}return n.next=22,Object(Kc.h)(Ae.a.editor.setIsMakingACopy(!1));case 22:return n.next=24,Object(Kc.h)(Ae.a.scripts.remove.failure({error:n.t0,fallbackValue:t}));case 24:return n.prev=24,n.next=27,Object(Kc.h)(Ae.a.scripts.storageCallComplete({id:t.storageScript.id}));case 27:return n.finish(24);case 28:n.next=34;break;case 30:return n.next=32,Object(Kc.b)(Tu.a,t.storageScript.id);case 32:return n.next=34,Object(Kc.h)(Ae.a.scripts.remove.success({script:t}));case 34:case"end":return n.stop()}}),nl,null,[[3,17,24,28]])}function Rl(e){var t,r,n;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!(t="Editor"===Object($s.b)())){a.next=7;break}return a.next=4,Object(Kc.j)(Ae.b.editor.getIsMakingACopy);case 4:a.t0=a.sent,a.next=8;break;case 7:a.t0=!1;case 8:return r=a.t0,a.next=11,Object(Kc.b)(Ji.e,{operationName:"Delete",scriptMetadata:Object(Fu.a)(e.payload.script)});case 11:if(Ei(e.payload.script.storageScript.id),!t){a.next=20;break}return a.next=15,Object(Kc.j)(Ae.b.editor.getActiveScriptId);case 15:a.t2=a.sent,a.t3=e.payload.script.storageScript.id,a.t1=a.t2===a.t3,a.next=21;break;case 20:a.t1=!1;case 21:if(n=a.t1,!(!r&&n)){a.next=26;break}return a.next=26,Object(Kc.h)(Ae.a.editor.hideDetailsPage());case 26:if(!t||!r){a.next=29;break}return a.next=29,Object(Kc.h)(Ae.a.editor.setIsMakingACopy(!1));case 29:if(!e.payload.script.localUpdates.shareId){a.next=38;break}return a.prev=30,a.next=33,Object(Kc.b)(Pu.instance().detachScriptFromWorkbook,Object(Bu.a)(e.payload.script.storageScript.id,e.payload.script.localUpdates.shareId));case 33:a.next=38;break;case 35:a.prev=35,a.t4=a.catch(30),Object(d.g)(new yo.b("Script was successfully deleted, but failed to detach from document.",a.t4),"Unexpected",d.a.Debug,"Core");case 38:case"end":return a.stop()}}),al,null,[[30,35]])}function Pl(e){var t,r,n,a,i,o,s,c;return regeneratorRuntime.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return t=e.payload,r=t.script,(n=t.updatedMetadata).name&&(n.name=n.name.trim()),a=r,u.prev=3,u.next=6,Object(Kc.h)(Ae.a.scripts.storageCallInProgress({id:r.storageScript.id}));case 6:return u.next=8,Object(Kc.h)(Ae.a.scripts.updateSavingStatus({id:r.storageScript.id,status:"InProgress"}));case 8:if(void 0!==r.localUpdates.body&&null!==r.localUpdates.body||(i=new Error("Trying to save a script with no body"),Object(d.g)(i,"Unexpected",d.a.Error)),!("MacroRecorder"===Object($s.b)())||!r.localUpdates.body){u.next=20;break}return u.next=13,Object(Kc.b)(lu,r.localUpdates.body);case 13:if((o=u.sent)===r.localUpdates.body){u.next=20;break}return r.localUpdates.body=o,u.next=18,Object(Kc.h)(Ae.a.scripts.update(r));case 18:return u.next=20,Object(Kc.h)(Ae.a.editor.contentExternallyUpdated());case 20:return u.next=22,Object(Kc.b)(zl,r);case 22:return r.localUpdates.parameterInfo=u.sent,s=Object(Uu.a)(r)?r.storageScript.id:void 0,u.next=26,Object(Kc.b)(Ou.a.instance);case 26:return c=u.sent,u.next=29,Object(Kc.b)(c.saveScript,r,n);case 29:return a=u.sent,u.next=32,Object(Kc.b)(Tu.c,a);case 32:return u.next=34,Object(Kc.h)(Ae.a.scripts.saveScriptToStorage.success({script:a,draftId:s}));case 34:u.next=43;break;case 36:if(u.prev=36,u.t0=u.catch(3),"Editor"!==Object($s.b)()){u.next=41;break}return u.next=41,Object(Kc.h)(Ae.a.editor.setIsMakingACopy(!1));case 41:return u.next=43,Object(Kc.h)(Ae.a.scripts.saveScriptToStorage.failure({error:u.t0,script:a}));case 43:case"end":return u.stop()}}),il,null,[[3,36]])}function Tl(e){var t,r,n;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(t=e.payload.script,!(r=e.payload.draftId)||r===t.storageScript.id){a.next=7;break}return a.next=5,Object(Kc.b)(Il,t,r);case 5:a.next=25;break;case 7:if(!("Editor"===Object($s.b)())){a.next=14;break}return a.next=11,Object(Kc.j)(Ae.b.editor.getIsMakingACopy);case 11:a.t0=a.sent,a.next=15;break;case 14:a.t0=!1;case 15:if(n=a.t0,Object(g.c)()!==g.b.localstorage||!n){a.next=19;break}return a.next=19,Object(Kc.h)(Ae.a.editor.setIsMakingACopy(!1));case 19:return a.next=21,Object(Kc.h)(Ae.a.scripts.updateSavingStatus({id:t.storageScript.id,status:"Succeeded"}));case 21:return a.next=23,Object(Kc.h)(Ae.a.scripts.update(t));case 23:return a.next=25,Object(Kc.h)(Ae.a.scripts.storageCallComplete({id:t.storageScript.id}));case 25:return a.next=27,Object(Kc.b)(Ji.e,{operationName:"Publish",scriptMetadata:Object(Fu.a)(t)});case 27:case"end":return a.stop()}}),ol)}function Il(e,t){var r,n;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Object(Kc.h)(Ae.a.scripts.updateSavingStatus({id:e.storageScript.id,status:"Succeeded"}));case 2:return a.next=4,Object(Kc.h)(Ae.a.scripts.update(e));case 4:return a.next=6,Object(Kc.h)(Ae.a.scripts.storageCallComplete({id:e.storageScript.id}));case 6:if("Editor"!==Object($s.b)()){a.next=13;break}return a.next=9,Object(Kc.j)(Ae.b.editor.getActiveScriptId);case 9:if(r=a.sent,t!==r){a.next=13;break}return a.next=13,Object(Kc.h)(Ae.a.editor.setActive({id:e.storageScript.id}));case 13:return a.next=15,Object(Kc.j)(Ae.b.scripts.get,t);case 15:if(!(n=a.sent)){a.next=19;break}return a.next=19,Object(Kc.h)(Ae.a.scripts.remove.request(n));case 19:case"end":return a.stop()}}),sl)}function Dl(e){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.payload.script){r.next=4;break}return Object(d.g)(new Error("Trying to update saving status for a script that doesn't exist"),"Unexpected",d.a.Warning,"Core"),r.abrupt("return");case 4:return r.next=6,Object(Kc.h)(Ae.a.scripts.storageCallComplete({id:t.storageScript.id}));case 6:return r.next=8,Object(Kc.h)(Ae.a.scripts.updateSavingStatus({id:t.storageScript.id,status:"Failed"}));case 8:case"end":return r.stop()}}),cl)}function Al(e){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.payload,r.next=3,Object(Kc.h)(Ae.a.scripts.updateConsent({id:t.storageScript.id,value:!0}));case 3:return r.next=5,Object(Kc.h)(Ae.a.scripts.acceptConsent.success({script:t}));case 5:return r.prev=5,r.next=8,Object(Kc.b)(_u.instance().acceptConsent,t);case 8:r.next=12;break;case 10:r.prev=10,r.t0=r.catch(5);case 12:case"end":return r.stop()}}),ul,null,[[5,10]])}function Ml(e){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.payload,r.prev=1,r.next=4,Object(Kc.b)(_u.instance().denyConsent,t);case 4:return r.next=6,Object(Kc.h)(Ae.a.scripts.updateConsent({id:t.storageScript.id,value:!1}));case 6:return r.next=8,Object(Kc.h)(Ae.a.scripts.denyConsent.success({script:t}));case 8:r.next=14;break;case 10:return r.prev=10,r.t0=r.catch(1),r.next=14,Object(Kc.h)(Ae.a.scripts.denyConsent.failure({error:r.t0}));case 14:case"end":return r.stop()}}),ll,null,[[1,10]])}var Nl,Ll=0;function Bl(e){var t,r,n,a,i,o,s,c,u;return regeneratorRuntime.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return t=e.payload,r=t.id,n=t.updatedBody,l.next=3,Object(Kc.j)(Ae.b.scripts.get,r);case 3:if(a=l.sent,Object(d.j)(a,"onScriptEditSaga"),!a){l.next=25;break}return i=Lu(a,{body:n}),l.next=9,Object(Kc.h)(Ae.a.scripts.update(i));case 9:return l.next=11,Object(Kc.h)(Ae.a.editor.updateMonacoMarkers());case 11:return l.next=13,Object(Kc.b)(Tu.c,i);case 13:return l.next=15,Object(Kc.j)(Ae.b.scripts.getHasUnsavedChanges,i.storageScript.id);case 15:return o=l.sent,s=o?"Unsaved":"None",l.next=19,Object(Kc.h)(Ae.a.scripts.updateSavingStatus({id:a.storageScript.id,status:s}));case 19:if(!(c=ql(n))){l.next=23;break}return l.next=23,Object(Kc.h)(Ae.a.bottomPanel.setHelpLinks(c));case 23:((u=Date.now())-Ll>6e4||Nl!==a.storageScript.id)&&(Ll=u,Nl=a.storageScript.id,Object(d.h)({eventName:"EditScript",eventType:"User",data:{logLevel:d.a.Information,storageId:a.storageScript.id,apiInfo:a.storageScript.apiInfo}}));case 25:case"end":return l.stop()}}),dl)}function Fl(e){var t,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(Kc.j)(Ae.b.scripts.get,e.payload.id);case 2:if(!(t=n.sent)){n.next=9;break}return r=Lu(t,e.payload.updatedFields),n.next=7,Object(Kc.b)(Tu.c,r);case 7:return n.next=9,Object(Kc.h)(Ae.a.scripts.update(r));case 9:Object(d.h)({eventName:"PartiallyUpdateScript",eventType:"User",data:{logLevel:d.a.Information,storageId:e.payload.id,updatedFields:Object.keys(e.payload.updatedFields),hasMatchingScript:!!t}});case 10:case"end":return n.stop()}}),pl)}function Wl(e){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.payload,r.next=3,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:t.storageScript.id,status:"InProgress"}));case 3:return r.next=5,Object(Kc.b)(sn);case 5:if(r.sent){r.next=10;break}return r.next=9,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:t.storageScript.id,status:"Failed"}));case 9:throw new Error("Only users with sharing enabled can share scripts.");case 10:return r.prev=10,r.next=13,Object(Kc.b)(xu.a.instance().shareScript,t.storageScript.id);case 13:if(t.localUpdates.shareId=r.sent,t.localUpdates.shareId){r.next=16;break}throw new Error("shareScript returned invalid shareId.");case 16:r.next=25;break;case 18:return r.prev=18,r.t0=r.catch(10),r.next=22,Object(Kc.h)(Ae.a.scripts.addScriptToWorkbook.failure({error:r.t0}));case 22:return r.next=24,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:t.storageScript.id,status:"Failed"}));case 24:return r.abrupt("return");case 25:if(r.prev=25,!Object(Hr.a)()){r.next=29;break}return r.next=29,Object(Kc.b)(Pu.instance().attachScriptToWorkbook,Object(Bu.a)(t.storageScript.id,t.localUpdates.shareId));case 29:return r.next=31,Object(Kc.h)(Ae.a.scripts.addScriptToWorkbook.success(t));case 31:return r.next=33,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:t.storageScript.id,status:"Succeeded"}));case 33:return r.next=35,Object(Kc.h)(Ae.a.scripts.partialUpdate({id:t.storageScript.id,updatedFields:{shareId:t.localUpdates.shareId}}));case 35:return r.next=37,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:t.storageScript.id,status:"Succeeded"}));case 37:return r.next=39,Object(Kc.b)(Ji.e,{operationName:"Attach",scriptMetadata:Object(Fu.a)(t)});case 39:r.next=47;break;case 41:return r.prev=41,r.t1=r.catch(25),r.next=45,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:t.storageScript.id,status:"Failed"}));case 45:return r.next=47,Object(Kc.c)();case 47:return r.next=49,Object(Kc.h)(Ae.a.shareDialog.hide());case 49:case"end":return r.stop()}}),fl,null,[[10,18],[25,41]])}function Ul(e){var t,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=e.payload,n.next=3,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:t.storageScript.id,status:"InProgress"}));case 3:if(t.localUpdates.shareId){n.next=9;break}return n.next=6,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:t.storageScript.id,status:"Failed"}));case 6:return r=new Error("Unable to find shareId for script with id "+t.storageScript.id),Object(d.g)(r,"Unexpected",d.a.Error),n.abrupt("return");case 9:if(n.prev=9,!Object(Hr.a)()){n.next=13;break}return n.next=13,Object(Kc.b)(Pu.instance().detachScriptFromWorkbook,Object(Bu.a)(t.storageScript.id,t.localUpdates.shareId));case 13:return n.next=15,Object(Kc.h)(Ae.a.scripts.removeScriptFromWorkbook.success(t));case 15:return n.next=17,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:t.storageScript.id,status:"Succeeded"}));case 17:return n.next=19,Object(Kc.h)(Ae.a.scripts.partialUpdate({id:t.storageScript.id,updatedFields:{shareId:void 0}}));case 19:return n.next=21,Object(Kc.b)(Ji.e,{operationName:"Detach",scriptMetadata:Object(Fu.a)(t)});case 21:if(Object(Le.a)(t)){n.next=27;break}return n.next=24,Object(Kc.h)(Ae.a.backstage.show());case 24:return n.next=26,Object(Kc.h)(Ae.a.editor.hideDetailsPage());case 26:Ei(t.storageScript.id);case 27:n.next=37;break;case 29:return n.prev=29,n.t0=n.catch(9),n.next=33,Object(Kc.h)(Ae.a.scripts.removeScriptFromWorkbook.failure());case 33:return n.next=35,Object(Kc.h)(Ae.a.scripts.updateAttachingStatus({id:t.storageScript.id,status:"Failed"}));case 35:return n.next=37,Object(Kc.c)();case 37:return n.next=39,Object(Kc.h)(Ae.a.unshareDialog.hide());case 39:case"end":return n.stop()}}),gl,null,[[9,29]])}function Hl(e){var t,r,n;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(t=e.payload){a.next=3;break}throw new Error("Unexpected: Block access was called with no script context");case 3:return r=t.storageScript.id,n=t.localUpdates.shareId,a.prev=5,a.next=8,Object(Kc.b)(xu.a.instance().unshareScriptFromAllWorkbooks,r);case 8:return a.next=10,Object(Kc.h)(Ae.a.unshareDialog.hide());case 10:return a.next=12,Object(Kc.h)(Ae.a.scripts.unshareScriptFromAllWorkbooks.success(t));case 12:return a.next=14,Object(Kc.b)(Ji.e,{operationName:"Detach",scriptMetadata:Object(Fu.a)(t)});case 14:a.next=22;break;case 16:return a.prev=16,a.t0=a.catch(5),a.next=20,Object(Kc.h)(Ae.a.scripts.unshareScriptFromAllWorkbooks.failure());case 20:return a.next=22,Object(Kc.c)();case 22:if(!n){a.next=34;break}return t.localUpdates.shareId=void 0,a.next=26,Object(Kc.h)(Ae.a.scripts.partialUpdate({id:t.storageScript.id,updatedFields:{shareId:t.localUpdates.shareId}}));case 26:return a.prev=26,a.next=29,Object(Kc.b)(Pu.instance().detachScriptFromWorkbook,Object(Bu.a)(r,n));case 29:a.next=34;break;case 31:a.prev=31,a.t1=a.catch(26),Object(d.g)(new yo.b("Script was successfully blocked in all workbooks, but failed to detach from current workbook.",a.t1),"Unexpected",d.a.Debug,"Core");case 34:case"end":return a.stop()}}),ml,null,[[5,16],[26,31]])}function zl(e){return Gl.apply(this,arguments)}function Gl(){return(Gl=Vu(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Au(t.localUpdates.body||"",Ir(t));case 3:return r=e.sent,e.abrupt("return",JSON.stringify(r));case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",void 0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function Vl(e){var t,r,n,a,i,o,s,c,u;return regeneratorRuntime.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return t=e.payload,r=Date.now(),n="RevertScript",l.prev=3,l.next=6,Object(Kc.b)(Ou.a.instance);case 6:return i=l.sent,l.next=9,Object(Kc.b)(i.getScript,t.storageScript.id,t.localUpdates.shareId);case 9:if(!(a=l.sent)){l.next=13;break}return l.next=13,Object(Kc.h)(Ae.a.scripts.fetchScriptFromStorage.success({script:a}));case 13:l.next=26;break;case 15:return l.prev=15,l.t0=l.catch(3),o=Object(qr.k)(l.t0),s=Object(qr.q)(l.t0),c=o?strings.Message.FailedToOpenDeletedScriptMessage:s?strings.Message.TimeOutErrorMessage:strings.Message.FailedToOpenScriptMessage,u=o||s?strings.General.OKButtonText:strings.General.DismissButtonText,Object(d.g)(l.t0,o?"UserError":"Unexpected",o?d.a.Warning:d.a.Error,"Core",{location:n}),l.next=24,Object(Kc.h)(Ae.a.scripts.fetchScriptFromStorage.failure({error:l.t0}));case 24:return l.next=26,Object(Kc.h)(Ae.a.messageBar.show({style:1,text:c,forceSingleLine:!0,isBlocking:!0,buttons:[{isPrimary:!0,text:u,actions:[Ae.a.messageBar.dismiss(),Ae.a.backstage.setCurrentPivot("Recent"),Ae.a.backstage.show()]}]}));case 26:if(!a){l.next=36;break}return Object(d.h)({eventName:n,eventType:"User",data:{logLevel:d.a.Information,storageId:t.storageScript.id,hasUpdatedBody:a.storageScript.body!==t.storageScript.body,scriptFetchTimeMs:Date.now()-r,scriptAge:Date.now()-t.localUpdates.dateLastModified}}),l.next=30,Object(Kc.h)(Ae.a.scripts.update(a));case 30:return l.next=32,Object(Kc.b)(Tu.c,a);case 32:return l.next=34,Object(Kc.h)(Ae.a.editor.contentExternallyUpdated());case 34:return l.next=36,Object(Kc.h)(Ae.a.editor.updateMonacoMarkers());case 36:case"end":return l.stop()}}),hl,null,[[3,15]])}var Kl=0;function ql(e){var t=Date.now(),r=t-Kl>6e4?new d.b("RecommendLinks","System"):null,n=Hu.recommend(e,4);return r&&(r.end(!0,d.a.Information,{recommendations:n.map((function(e){return e.id}))}),Kl=t),n}function Jl(e,t){return function(){Object(d.h)({eventName:"ManualConflictResolution",eventType:"User",data:{logLevel:d.a.Information,storageId:e.storageScript.id,resolution:t}})}}var Ql=r(778);function Zl(){return(Zl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Yl(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function Xl(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){Yl(i,n,a,o,s,"next",e)}function s(e){Yl(i,n,a,o,s,"throw",e)}o(void 0)}))}}var $l,ed=regeneratorRuntime.mark(Od),td=regeneratorRuntime.mark(xd),rd=regeneratorRuntime.mark(jd),nd=regeneratorRuntime.mark(wd),ad=regeneratorRuntime.mark(Ed),id=regeneratorRuntime.mark(kd),od=regeneratorRuntime.mark(Cd),sd=regeneratorRuntime.mark(_d),cd=regeneratorRuntime.mark(Id),ud=regeneratorRuntime.mark(Dd),ld=regeneratorRuntime.mark(Ad),dd=regeneratorRuntime.mark(Md),pd=regeneratorRuntime.mark(Nd),fd=regeneratorRuntime.mark(Ld),gd=regeneratorRuntime.mark(Bd),md=regeneratorRuntime.mark(Fd),hd=regeneratorRuntime.mark(Wd),bd=regeneratorRuntime.mark(Ud),vd=regeneratorRuntime.mark(Hd),Sd=regeneratorRuntime.mark(zd),yd=regeneratorRuntime.mark(Gd);function Od(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.l)(Object(Oc.getType)(Ae.a.misc.initialize),xd);case 2:return e.next=4,Object(Kc.l)(Object(Oc.getType)(Ae.a.editor.createNewScript),Fd);case 4:return e.next=6,Object(Kc.l)(Object(Oc.getType)(Ae.a.editor.importScript),Wd);case 6:return e.next=8,Object(Kc.l)(Object(Oc.getType)(Ae.a.editor.makeACopyOfScript),Hd);case 8:return e.next=10,Object(Kc.l)(Object(Oc.getType)(Ae.a.scripts.remove.success),Ud);case 10:return e.next=12,Object(Kc.l)(Object(Oc.getType)(Ae.a.editor.openScript),wd);case 12:return e.next=14,Object(Kc.l)(Object(Oc.getType)(Ae.a.editor.openScriptInDetailsPage),Ed);case 14:return e.next=16,Object(Kc.l)(Object(Oc.getType)(Ae.a.editor.openScriptInEditor),kd);case 16:return e.next=18,Object(Kc.l)(Object(Oc.getType)(Ae.a.editor.onMount),Cd);case 18:return e.next=20,Object(Kc.l)(Object(Oc.getType)(Ae.a.editor.onOpenNewScript),_d);case 20:return e.next=22,Object(Kc.e)(1e3,Object(Oc.getType)(Ae.a.editor.updateMonacoMarkers),Id);case 22:return e.next=24,Object(Kc.n)(500,Object(Oc.getType)(Ae.a.editor.updateProblemsLogs),Nd);case 24:return e.next=26,Object(Kc.l)(Object(Oc.getType)(Ae.a.bottomPanel.show),Ld);case 26:return e.next=28,Object(Kc.l)(Object(Oc.getType)(Ae.a.editor.hideDetailsPage),Bd);case 28:return e.next=30,Object(Kc.l)(Object(Oc.getType)(Ae.a.settings.apply),zd);case 30:return e.next=32,Object(Kc.m)(Object(Oc.getType)(Ae.a.macroRecorder.sendRecorderHeartbeat),Gd);case 32:case"end":return e.stop()}}),ed)}function xd(){var e,t,r,n;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!(e=Object(zr.g)())){a.next=9;break}return a.next=4,Object(Kc.h)(Ae.a.scripts.mergeMetadataFromRibbon({scripts:e}));case 4:if("Editor"!==Object($s.b)()){a.next=9;break}return a.next=7,Object(Kc.b)(d.e);case 7:return a.next=9,Object(Kc.h)(Ae.a.scripts.publishedScriptMetadataReceived());case 9:if(!(t=Object(zr.i)())){a.next=13;break}return a.next=13,Object(Kc.h)(Ae.a.scripts.mergeSharedMetadataFromRibbon({scripts:t}));case 13:return a.next=15,Object(Kc.b)(zr.c);case 15:return r=a.sent,n=Object(zr.h)(),a.next=19,Object(Kc.g)(vl);case 19:if(!r){a.next=26;break}return a.next=22,Object(Kc.h)(Ae.a.editor.setDetailsNavigateSource(n||null));case 22:return a.next=24,Object(Kc.b)(jd,r);case 24:a.next=32;break;case 26:if("Editor"!==Object(zr.e)()){a.next=32;break}return a.next=30,Object(Kc.h)(Ae.a.backstage.hide());case 30:return a.next=32,Object(Kc.h)(Ae.a.editor.createNewScript());case 32:return a.next=34,Object(Kc.b)(d.f);case 34:case"end":return a.stop()}}),td)}function jd(e){var t,r,n,a;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e,i.next=3,Object(Kc.j)(Ae.b.scripts.get,t.storageScript.id);case 3:return r=i.sent,n=Object(mu.a)({incomingScript:t,existingScript:r}),a=n.selectedScript,i.next=7,Object(Kc.h)(Ae.a.scripts.update(a));case 7:if("Details"!==Object(zr.e)()){i.next=11;break}return i.next=11,Object(Kc.h)(Ae.a.editor.showDetailsPage());case 11:return i.next=13,Object(Kc.h)(Ae.a.backstage.hide());case 13:return i.next=15,Object(Kc.h)(Ae.a.editor.setActive({id:a.storageScript.id}));case 15:case"end":return i.stop()}}),rd)}function wd(e){var t,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=e.payload.id,r=e.payload.destination,n.next=4,Object(Kc.j)(Ae.b.scripts.getHasUnsavedChanges,e.payload.id);case 4:if(!n.sent){n.next=8;break}return n.next=8,Object(Kc.h)(Ae.a.scripts.updateSavingStatus({id:e.payload.id,status:"Unsaved"}));case 8:if("Details"!==r){n.next=13;break}return n.next=11,Object(Kc.h)(Ae.a.editor.openScriptInDetailsPage({id:t}));case 11:n.next=15;break;case 13:return n.next=15,Object(Kc.h)(Ae.a.editor.openScriptInEditor({id:t}));case 15:case"end":return n.stop()}}),nd)}function Ed(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(Kc.h)(Ae.a.editor.setActive(e.payload));case 2:return t.next=4,Object(Kc.h)(Ae.a.editor.showDetailsPage());case 4:return t.next=6,Object(Kc.h)(Ae.a.backstage.hide());case 6:case"end":return t.stop()}}),ad)}function kd(e){var t,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(Kc.j)(Ae.b.editor.getActiveScriptId);case 2:if(t=n.sent){n.next=6;break}return n.next=6,Object(Kc.h)(Ae.a.backstage.hide());case 6:return n.next=8,Object(Kc.h)(Ae.a.editor.setActive(e.payload));case 8:return n.next=10,Object(Kc.h)(Ae.a.editor.hideDetailsPage());case 10:return n.next=12,Object(Kc.h)(Ae.a.settings.apply());case 12:if(!(r=e.payload.id)||r===t){n.next=16;break}return n.next=16,Object(Kc.h)(Ae.a.editor.onOpenNewScript());case 16:return n.next=18,Object(Kc.h)(Ae.a.backstage.hide());case 18:return n.next=20,Object(Kc.j)(Ae.b.settings.get,"editor.showContextualHelp");case 20:if(!n.sent||!Object(au.a)("ShowContextualHelpByDefault")){n.next=26;break}return n.next=24,Object(Kc.h)(Ae.a.bottomPanel.setCurrentPivot("Help"));case 24:return n.next=26,Object(Kc.h)(Ae.a.bottomPanel.show());case 26:case"end":return n.stop()}}),id)}function Cd(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return $l=e.payload,t.next=3,Object(Kc.h)(Ae.a.editor.updateProblemsLogs());case 3:return t.next=5,Object(Kc.h)(Ae.a.editor.updateMonacoMarkers());case 5:return t.next=7,Object(Kc.b)(Jc,$l);case 7:return t.next=9,Object(Kc.h)(Ae.a.settings.apply());case 9:return t.next=11,Object(Kc.h)(Ae.a.editor.monacoInitialized());case 11:case"end":return t.stop()}}),od)}function _d(e){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.h)(Ae.a.bottomPanel.clearOutputLogs());case 2:return e.next=4,Object(Kc.h)(Ae.a.bottomPanel.clearProblemsLogs());case 4:case"end":return e.stop()}}),sd)}var Rd=0;function Pd(e,t,r,n){return Td.apply(this,arguments)}function Td(){return(Td=Xl(regeneratorRuntime.mark((function e(t,r,n,a){var i,o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new d.b(t,"System",3e3),o=Rd++,s=yu(t),c=new Promise((function(e,r){s.addEventListener("message",(function n(a){var c=a.data,u=c.messageId,l=c.markers,p=c.error,f=void 0===p?void 0:p,g=c.parameterInfo,m=void 0===g?void 0:g,h=c.telemetryData,b=void 0===h?void 0:h;o==u&&(s.removeEventListener("message",n),f?(i.end(!1,d.a.Warning,Zl({},b,{ErrorText:Object(er.a)(f)})),r(f)):(i.end(!0,d.a.Information,Zl({},b)),hu($l,Dr(t),l),e(m)))}))})),s.postMessage({messageId:o,linter:t,body:r,variant:n,rules:a}),e.abrupt("return",c);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Id(){var e,t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(Kc.j)(Ae.b.editor.getActiveScriptId);case 2:return e=r.sent,r.next=5,Object(Kc.j)(Ae.b.scripts.get,e);case 5:if(t=r.sent,!tc(t)){r.next=8;break}return r.abrupt("return");case 8:if(!$l){r.next=17;break}if(!e||!t){r.next=15;break}if(!Object(Tr.a)(t)){r.next=13;break}return r.next=13,Object(Kc.g)(Dd,t);case 13:return r.next=15,Object(Kc.g)(Ad,t);case 15:return r.next=17,Object(Kc.g)(Md);case 17:case"end":return r.stop()}}),cd)}function Dd(e){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(Kc.b)(Ql.a,e);case 2:return t=r.sent,r.prev=3,r.next=6,Object(Kc.b)(Pd,Rr.SyncAPI,e.localUpdates.body,void 0,t);case 6:r.next=10;break;case 8:r.prev=8,r.t0=r.catch(3);case 10:case"end":return r.stop()}}),ud,null,[[3,8]])}function Ad(e){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Object(Kc.b)(Pd,Rr.FunctionArgument,e.localUpdates.body,Ir(e));case 3:if(!(t=r.sent)){r.next=7;break}return r.next=7,Object(Kc.h)(Ae.a.scripts.partialUpdate({id:e.storageScript.id,updatedFields:{parameterInfo:t}}));case 7:r.next=11;break;case 9:r.prev=9,r.t0=r.catch(0);case 11:case"end":return r.stop()}}),ld,null,[[0,9]])}function Md(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<4)){t.next=9;break}return t.next=4,Object(Kc.h)(Ae.a.editor.updateProblemsLogs());case 4:return t.next=6,Object(Kc.f)(500);case 6:e++,t.next=1;break;case 9:case"end":return t.stop()}}),dd)}function Nd(){var e,t,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(Kc.j)(Ae.b.editor.getActiveScriptId);case 2:return e=n.sent,n.next=5,Object(Kc.j)(Ae.b.scripts.get,e);case 5:if(t=n.sent,!tc(t)){n.next=8;break}return n.abrupt("return");case 8:if(!$l||!t){n.next=15;break}return r=monaco.editor.getModelMarkers({resource:monaco.Uri.file(t.storageScript.name)}).map((function(e){return Xc(e)})),n.next=12,Object(Kc.j)(Ae.b.editor.getIsDetailsPageVisible);case 12:if(n.sent){n.next=15;break}return n.next=15,Object(Kc.h)(Ae.a.bottomPanel.setProblemsLogs(r));case 15:case"end":return n.stop()}}),pd)}function Ld(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.h)(Ae.a.editor.updateMonacoMarkers());case 2:return e.next=4,Object(Kc.j)(Ae.b.editor.getIsDetailsPageVisible);case 4:if(!e.sent){e.next=8;break}return e.next=8,Object(Kc.h)(Ae.a.editor.hideDetailsPage());case 8:case"end":return e.stop()}}),fd)}function Bd(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.j)(Ae.b.run.getIsRunning);case 2:if(e.sent){e.next=6;break}return e.next=6,Object(Kc.h)(Ae.a.messageBar.dismiss());case 6:case"end":return e.stop()}}),gd)}function Fd(e){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=eu.b,e.next=3,Object(Kc.j)(Ae.b.scripts.getScriptNames);case 3:return e.t1=e.sent,e.t2=strings.Editor.NewScriptNameText,t=(0,e.t0)(e.t1,e.t2),e.next=8,Object(Kc.b)(tu.a,{name:t});case 8:if(!(r=e.sent).localUpdates.body){e.next=19;break}return e.next=12,Object(Kc.b)(lu,r.localUpdates.body);case 12:if((n=e.sent)===r.localUpdates.body){e.next=19;break}return r.localUpdates.body=n,e.next=17,Object(Kc.h)(Ae.a.scripts.update(r));case 17:return e.next=19,Object(Kc.h)(Ae.a.editor.contentExternallyUpdated());case 19:return e.next=21,Object(Kc.h)(Ae.a.editor.importScript({script:r}));case 21:case"end":return e.stop()}}),md)}function Wd(e){var t,r,n,a;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.payload,r=t.script,n=t.originalPage,i.next=3,Object(Kc.j)(Ae.b.editor.getIsMakingACopy);case 3:return a=i.sent,i.next=6,Object(Kc.h)(Ae.a.scripts.update(r));case 6:return i.next=8,Object(Kc.h)(Ae.a.scripts.saveScriptToStorage.request({script:r,updatedMetadata:{}}));case 8:if("Details"!==n||!a){i.next=13;break}return i.next=11,Object(Kc.h)(Ae.a.editor.openScriptInDetailsPage({id:r.storageScript.id}));case 11:i.next=15;break;case 13:return i.next=15,Object(Kc.h)(Ae.a.editor.openScriptInEditor({id:r.storageScript.id}));case 15:case"end":return i.stop()}}),hd)}function Ud(e){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(Kc.j)(Ae.b.editor.getActiveScriptId);case 2:if(t=r.sent,e.payload.script.storageScript.id!==t){r.next=11;break}return r.next=7,Object(Kc.h)(Ae.a.editor.setActive({id:null}));case 7:return r.next=9,Object(Kc.h)(Ae.a.bottomPanel.hide());case 9:return r.next=11,Object(Kc.h)(Ae.a.backstage.show());case 11:case"end":return r.stop()}}),bd)}function Hd(e){var t,r,n,a,i,o,s,c;return regeneratorRuntime.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(u.t0=e.payload.scriptId,u.t0){u.next=5;break}return u.next=4,Object(Kc.j)(Ae.b.editor.getActiveScriptId);case 4:u.t0=u.sent;case 5:if(t=u.t0){u.next=8;break}throw new Error("There was no script to duplicate.");case 8:return u.next=10,Object(Kc.j)(Ae.b.scripts.get,t);case 10:if(r=u.sent){u.next=13;break}throw new Error("There was no script to duplicate.");case 13:if(n=!!r.localUpdates.body){u.next=23;break}return u.next=17,Object(Kc.h)(Ae.a.scripts.fetchScriptFromStorage.request({id:r.storageScript.id}));case 17:return u.next=19,Object(Kc.i)({success:Object(Kc.k)(Object(Oc.getType)(Ae.a.scripts.fetchScriptFromStorage.success)),failure:Object(Kc.k)(Object(Oc.getType)(Ae.a.scripts.fetchScriptFromStorage.failure))});case 19:a=u.sent,i=a.success,o=a.failure,i?(n=!0,r=i.payload.script):o&&Object(d.g)(new Error("Unable to fetch script while trying to make a copy"),"Unexpected",d.a.Error,"Core",{scriptI:r.storageScript.id});case 23:if(!n){u.next=35;break}return u.next=26,Object(Kc.j)(Ae.b.scripts.getScriptNames);case 26:return s=u.sent,u.next=29,nu(r,s);case 29:return c=u.sent,u.next=32,Object(Kc.h)(Ae.a.editor.setIsMakingACopy(!0));case 32:return u.next=34,Object(Kc.h)(Ae.a.editor.importScript({script:c,originalPage:e.payload.originalPage}));case 34:Object(d.h)({eventName:"DuplicateScript",eventType:"User",data:{logLevel:d.a.Information,originalScriptStorageId:r.storageScript.id,newScriptStorageId:c.storageScript.id,apiInfo:r.storageScript.apiInfo}});case 35:case"end":return u.stop()}}),vd)}function zd(e){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.j)(hi.getAll);case 2:if(!(t=e.sent)["editor.tabSize"]){e.next=6;break}return e.next=6,Object(Kc.b)(uu,{tabWidth:t["editor.tabSize"]});case 6:$l&&(r=Zc(t),$l.updateOptions(r),(n=$l.getModel())&&n.updateOptions({tabSize:t["editor.tabSize"]}),r.theme&&monaco.editor.setTheme(r.theme));case 7:case"end":return e.stop()}}),Sd)}function Gd(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.h)(Ae.a.editor.setMostRecentRecorderHeartbeatReceived());case 2:case"end":return e.stop()}}),yd)}var Vd=r(711),Kd=regeneratorRuntime.mark(Jd),qd=regeneratorRuntime.mark(Qd);function Jd(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.l)(Object(Oc.getType)(Vd.dismiss),Qd);case 2:case"end":return e.stop()}}),Kd)}function Qd(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.f)(300);case 2:return e.next=4,Object(Kc.h)(Vd.reset());case 4:case"end":return e.stop()}}),qd)}var Zd=r(831);function Yd(e){var t="function"===typeof Map?new Map:void 0;return(Yd=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Xd(e,arguments,tp(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ep(n,e)})(e)}function Xd(e,t,r){return(Xd=$d()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&ep(a,r.prototype),a}).apply(null,arguments)}function $d(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function ep(e,t){return(ep=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tp(e){return(tp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var rp=regeneratorRuntime.mark(ap),np=regeneratorRuntime.mark(ip);function ap(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.l)(Object(Oc.getType)(Hc.edit.request),ip);case 2:case"end":return e.stop()}}),rp)}function ip(e){var t,r,n,a,i;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,t=e.payload,r=Object.keys(kn.a),n=Object.keys(t),!((a=n.filter((function(e){return!r.includes(e)}))).length>0)){o.next=7;break}throw new op("Unrecognized keys: "+a.join(", "));case 7:return i={},Object.keys(t).map((function(e){return e})).forEach((function(e){var r=t[e],n=kn.a[e];if(n.enum&&!n.enum.includes(r))throw new op("'"+r+"' is not an allowed value for '"+e+"'.");Object(d.h)({eventName:"EditorSettings",eventType:"User",data:{propName:e,propStringValue:r.toString()}}),i[e]=r})),o.next=11,Object(Kc.h)(Hc.edit.success(i));case 11:return o.next=13,Object(Kc.h)(Hc.apply());case 13:o.next=19;break;case 15:return o.prev=15,o.t0=o.catch(0),o.next=19,Object(Kc.h)(Hc.edit.failure(o.t0));case 19:case"end":return o.stop()}}),np,null,[[0,15]])}var op=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(Yd(Error)),sp=regeneratorRuntime.mark(cp);function cp(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Kc.a)([Object(qc.a)(),Od(),Jd(),Object(Zd.a)(),bl(),ap()]);case 2:case"end":return e.stop()}}),sp)}var up=r(81),lp=function(e){!function(e){var t=hi.getAll(e),r=Oi.read(yi);t&&!vi()(t,r)&&(Oi.write(yi,t)||xi||(Object(d.g)(new Error("Failed to write editor settings"),"Unsupported",d.a.Warning),xi=!0))}(e)},dp=function(){var e;return(e={})[up.a]=Object(Tu.b)(),e[kn.b]=function(){var e=Oi.read(yi),t=Object(kn.d)();return void 0===e||Object.keys(t).forEach((function(r){e[r]&&(t[r]=e[r])})),{settings:t}}(),e},pp=r(764),fp=Object(i.b)((function(e){return{dialogProps:e.dialog}}),(function(e){return{dispatch:e,dismiss:function(){return e(L.a.dialog.dismiss())}}}))(pp.a),gp=r(171),mp=r(127),hp=(r(102),function(){function e(){Object.defineProperty(this,"store",{configurable:!0,enumerable:!0,writable:!0,value:void 0}),this.store={}}var t=e.prototype;return t.create=function(e,t){return!this.store[e]&&(this.store[e]=t,!0)},t.read=function(e){if(void 0!==this.store[e])return this.store[e];throw new Error("No such item: "+JSON.stringify(e))},t.update=function(e,t){var r=!!this.store[e];return this.store[e]=t,r},t.delete=function(e){var t=!!this.store[e];return delete this.store[e],t},t.keys=function(){var e=[];for(var t in this.store)e.push(t);return e},e}()),bp=r(765),vp=new hp;function Sp(e){var t=function(e){return function(t){(function(e){if(e.action===bp.a.Error||e.action===bp.a.Success){try{var t=e.messageId,r=vp.read(t);vp.delete(t),e.action===bp.a.Error?(r.reject(e.data),window.clearTimeout(r.timeoutCookie)):e.action==bp.a.Success&&(r.resolve(e.data),window.clearTimeout(r.timeoutCookie))}catch(n){}return!0}return!1})(t.payload)||e(t)}}(e);Object(bp.d)(t)}var yp,Op=r(804),xp=function(e,t){return new Promise((function(r,n){yp.dispatch(c.a.authDialog.show({acceptFn:function(){gp.a.getAccessTokenInternal(e,t,!0,1).then(r).catch(n)},cancelFn:n}))}))};t.default=function(){var e=Object(n.useState)(yp),t=e[0],r=e[1];return Object(zu.a)(),Object(n.useEffect)((function(){if(!yp){var e=window.Cypress&&window.initialState||dp();yp=Object(u.a)({initialState:e,rootReducer:Object(yc.combineReducers)({backstage:jc,bottomPanel:Rc,consentDialog:Tc,authDialog:Ic.a,shareDialog:Ac,unshareDialog:Nc,dialog:Lc.a,editor:Bc.a,messageBar:Fc.a,run:Wc.a,scripts:Uc.a,settings:Vc}),rootSaga:cp}),mp.a.putFallbackFn(xp),yp.subscribe(s()((function(){var e=yp.getState();lp(e)}),1e3)),yp.dispatch(c.a.misc.initialize()),window.Cypress&&(window.store=yp),r(yp),Object(Hr.a)()&&Sp((function(e){e.payload.method===bp.b.RecorderHeartbeat&&yp.dispatch(c.a.macroRecorder.sendRecorderHeartbeat())})),Vr.c.listen((function(e){Object(Op.a)(e),6===e.callCount&&e.callCount===e.fails.networkFailures&&(Object(au.a)("ShowFirewallMessage")&&yp.dispatch(c.a.messageBar.show({text:strings.General.NetworkFailureWarning,style:Go.a.warning})),Object(d.d)({eventName:"LikelyFirewallEncountered",eventType:"System"}))}))}}),[]),t?a.a.createElement(i.a,{store:t},a.a.createElement(a.a.Fragment,null,a.a.createElement(Sc.a,null,a.a.createElement(hc,null)),a.a.createElement(fp,null))):null}},641:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return c})),r.d(t,"a",(function(){return u})),r.d(t,"f",(function(){return n})),r.d(t,"g",(function(){return a})),r.d(t,"h",(function(){return M})),r.d(t,"i",(function(){return N})),r.d(t,"j",(function(){return i})),r.d(t,"k",(function(){return B})),r.d(t,"m",(function(){return F})),r.d(t,"n",(function(){return W})),r.d(t,"o",(function(){return U})),r.d(t,"p",(function(){return H})),r.d(t,"l",(function(){return z}));var n={};r.r(n),r.d(n,"show",(function(){return d})),r.d(n,"dismiss",(function(){return p})),r.d(n,"hide",(function(){return f})),r.d(n,"reset",(function(){return g}));var a={};r.r(a),r.d(a,"openScript",(function(){return m})),r.d(a,"openScriptInDetailsPage",(function(){return h})),r.d(a,"openScriptInEditor",(function(){return b})),r.d(a,"monacoInitialized",(function(){return v})),r.d(a,"setActive",(function(){return S})),r.d(a,"createNewScript",(function(){return y})),r.d(a,"importScript",(function(){return O})),r.d(a,"makeACopyOfScript",(function(){return x})),r.d(a,"onMount",(function(){return j})),r.d(a,"onOpenNewScript",(function(){return w})),r.d(a,"hideDetailsPage",(function(){return E})),r.d(a,"showDetailsPage",(function(){return k})),r.d(a,"contentExternallyUpdated",(function(){return C})),r.d(a,"updateMonacoMarkers",(function(){return _})),r.d(a,"updateProblemsLogs",(function(){return R})),r.d(a,"setNavigationSourcePage",(function(){return P})),r.d(a,"setIsMakingACopy",(function(){return T})),r.d(a,"setIsEditingScriptName",(function(){return I})),r.d(a,"setMostRecentRecorderHeartbeatReceived",(function(){return D})),r.d(a,"setDetailsNavigateSource",(function(){return A}));var i={};r.r(i),r.d(i,"initialize",(function(){return L}));var o=r(707),s=r(708),c=r(709),u=r(694),l=r(640),d=Object(l.createAction)("DIALOG_SHOW",(function(e){return function(t){var r=t.title,n=t.subText,a=t.buttons,i=t.style,o=t.isBlocking;return e({title:r,subText:n,buttons:a,style:i,isBlocking:void 0===o||o})}})),p=Object(l.createAction)("DIALOG_DISMISS"),f=Object(l.createAction)("DIALOG_HIDE"),g=Object(l.createAction)("DIALOG_RESET"),m=Object(l.createAction)("EDITOR_OPEN_SCRIPT",(function(e){return function(t){return e(t)}})),h=Object(l.createAction)("EDITOR_OPEN_SCRIPT_IN_DETAILS_PAGE",(function(e){return function(t){return e(t)}})),b=Object(l.createAction)("EDITOR_OPEN_SCRIPT_IN_EDITOR",(function(e){return function(t){return e(t)}})),v=Object(l.createAction)("EDITOR_MONACO_INITIALIZED"),S=Object(l.createAction)("EDITOR_SET_ACTIVE",(function(e){return function(t){return e(t)}})),y=Object(l.createAction)("EDITOR_CREATE_NEW_SCRIPT"),O=Object(l.createStandardAction)("EDITOR_IMPORT_AND_OPEN")(),x=Object(l.createAction)("EDITOR_MAKE_COPY",(function(e){return function(t){return e(t)}})),j=Object(l.createAction)("EDITOR_ON_MOUNT",(function(e){return function(t){return e(t)}})),w=Object(l.createAction)("EDITOR_ON_OPEN_NEW_SCRIPT"),E=Object(l.createAction)("EDITOR_HIDE_DETAILS_PAGE"),k=Object(l.createAction)("EDITOR_SHOW_DETAILS_PAGE"),C=Object(l.createAction)("EDITOR_CONTENT_EXTERNALLY_UPDATED"),_=Object(l.createAction)("EDITOR_UPDATE_MONACO_MARKERS"),R=Object(l.createAction)("EDITOR_UPDATE_PROBLEMS_LOGS"),P=Object(l.createAction)("EDITOR_SET_NAVIGATION_SOURCE_PAGE",(function(e){return function(t){return e(t)}})),T=Object(l.createAction)("EDITOR_SET_IS_MAKING_A_COPY",(function(e){return function(t){return e(t)}})),I=Object(l.createAction)("EDITOR_SET_IS_EDITING_SCRIPT_NAME",(function(e){return function(t){return e(t)}})),D=Object(l.createAction)("EDITOR_SET_LAST_KNOWN_RECORDING_HEARTBEAT"),A=Object(l.createAction)("EDITOR_SET_DETAILS_NAVIGATE_SOURCE",(function(e){return function(t){return e(t)}})),M=r(710),N=r(711),L=Object(l.createAction)("INITIALIZING"),B=r(695),F=r(696),W=r(697),U=r(712),H=r(713),z=r(714),G={backstage:o,bottomPanel:s,consentDialog:c,authDialog:u,dialog:n,editor:a,macroRecorder:M,messageBar:N,misc:i,run:B,scripts:F,settings:W,shareDialog:U,unshareDialog:H,runFromButton:z};t.e=G},643:function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"c",(function(){return a})),r.d(t,"d",(function(){return i})),r.d(t,"a",(function(){return o})),r.d(t,"l",(function(){return s})),r.d(t,"m",(function(){return c})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return L})),r.d(t,"h",(function(){return l})),r.d(t,"j",(function(){return d})),r.d(t,"k",(function(){return Oe})),r.d(t,"i",(function(){return p}));var n={};r.r(n),r.d(n,"getIsVisible",(function(){return f})),r.d(n,"getCurrentPivot",(function(){return g})),r.d(n,"getIsReactMonacoLoaded",(function(){return m}));var a={};r.r(a),r.d(a,"getIsVisible",(function(){return h})),r.d(a,"getCurrentPivot",(function(){return b})),r.d(a,"getOutputLogs",(function(){return v})),r.d(a,"getProblemsLogs",(function(){return S})),r.d(a,"getHelpLinks",(function(){return y}));var i={};r.r(i),r.d(i,"getIsVisible",(function(){return O}));var o={};r.r(o),r.d(o,"getIsVisible",(function(){return x})),r.d(o,"getAcceptFn",(function(){return j})),r.d(o,"getCancelFn",(function(){return w}));var s={};r.r(s),r.d(s,"getIsVisible",(function(){return E}));var c={};r.r(c),r.d(c,"getIsVisible",(function(){return k}));var u={};r.r(u),r.d(u,"getIsLoading",(function(){return _})),r.d(u,"getActiveScriptId",(function(){return R})),r.d(u,"getIsDetailsPageVisible",(function(){return P})),r.d(u,"getExternalContentUpdateCounter",(function(){return T})),r.d(u,"getNavigationSourcePage",(function(){return I})),r.d(u,"getIsMakingACopy",(function(){return D})),r.d(u,"getIsEditingScriptName",(function(){return A})),r.d(u,"getMostRecentRecorderHeartbeatReceived",(function(){return M})),r.d(u,"getDetailsNavigateSource",(function(){return N}));var l={};r.r(l),r.d(l,"getIsRunning",(function(){return F}));var d={};r.r(d),r.d(d,"get",(function(){return Q})),r.d(d,"getIsPublished",(function(){return Z})),r.d(d,"getHasUnsavedChanges",(function(){return Y})),r.d(d,"getAll",(function(){return X})),r.d(d,"getAllMyScripts",(function(){return $})),r.d(d,"getAllDocAttachedScripts",(function(){return ee})),r.d(d,"getAllOthersScripts",(function(){return te})),r.d(d,"getAllSampleScripts",(function(){return re})),r.d(d,"getAllMyScriptsInLastModifiedOrder",(function(){return ne})),r.d(d,"getAllSampleScriptsInSortIndexOrder",(function(){return ae})),r.d(d,"getScriptNames",(function(){return ie})),r.d(d,"getOwnedScriptNames",(function(){return oe})),r.d(d,"getOtherScriptNames",(function(){return se})),r.d(d,"getOtherOwnedScriptNames",(function(){return ce})),r.d(d,"getOtherNonOwnedScriptNames",(function(){return ue})),r.d(d,"getAllUnpublished",(function(){return le})),r.d(d,"getAllPublished",(function(){return de})),r.d(d,"getIsScriptOwner",(function(){return pe})),r.d(d,"getIsScriptDocAttached",(function(){return fe})),r.d(d,"getHasReceivedMetadata",(function(){return ge})),r.d(d,"getHasLoadedAttachedScripts",(function(){return me})),r.d(d,"getSavingStatus",(function(){return he})),r.d(d,"getAttachingStatus",(function(){return be})),r.d(d,"getIsStorageCallInProgress",(function(){return ve})),r.d(d,"getIsAnyStorageCallInProgress",(function(){return Se})),r.d(d,"getIsConsented",(function(){return ye}));var p={};r.r(p),r.d(p,"getActiveScript",(function(){return xe}));var f=function(e){return e.backstage.isVisible},g=function(e){return e.backstage.currentPivot},m=function(e){return e.backstage.isReactMonacoLoaded},h=function(e){return e.bottomPanel.isVisible},b=function(e){return e.bottomPanel.currentPivot},v=function(e){return e.bottomPanel.outputLogs},S=function(e){return e.bottomPanel.problemsLogs},y=function(e){return e.bottomPanel.helpLinks},O=function(e){return e.consentDialog.isVisible},x=function(e){return e.authDialog.isVisible},j=function(e){return e.authDialog.acceptFn},w=function(e){return e.authDialog.cancelFn},E=function(e){return e.shareDialog.isVisible},k=function(e){return e.unshareDialog.isVisible},C=r(745),_=function(e){return e[C.b].isLoading},R=function(e){return e[C.b].active},P=function(e){return e[C.b].isDetailsPageVisible},T=function(e){return e[C.b].externalContentUpdateCounter},I=function(e){return e[C.b].navigationSourcePage},D=function(e){return e[C.b].isMakingACopy},A=function(e){return e[C.b].isEditingScriptName},M=function(e){return e[C.b].mostRecentRecorderHeartbeatReceived},N=function(e){return e[C.b].detailsNavigateSource},L=r(724),B=r(726),F=function(e){return e[B.c].isRunning},W=r(81),U=r(850),H=r(674),z=r(678),G=r(656),V=function(e){return!!e.localUpdates.shareId},K=r(679);function q(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}function J(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}var Q=function(e,t){return t?e[W.a].scripts[t]:void 0},Z=function(e,t){var r=e[W.a].scripts[t];return!!r&&Object(z.a)(r)},Y=function(e,t){if(!t)return!1;var r=e[W.a].scripts[t];return Object(H.a)(r)},X=function(e){return Object.values(e[W.a].scripts)},$=function(e){return Object.values(e[W.a].scripts).filter((function(e){return Object(G.a)(e)}))},ee=function(e){return Object.values(e[W.a].scripts).filter((function(e){return V(e)}))},te=function(e){return Object.values(e[W.a].scripts).filter((function(e){return!Object(G.a)(e)}))},re=function(e){return Object.values(e[W.a].scripts).filter((function(e){return Object(K.a)(e)}))},ne=Object(U.a)([$],(function(e){return e.sort((function(e,t){return t.localUpdates.dateLastModified-e.localUpdates.dateLastModified}))})),ae=Object(U.a)([re],(function(e){return e.sort((function(e,t){return e.storageScript.sortIndex-t.storageScript.sortIndex}))})),ie=function(e){return Object.values(e[W.a].scripts).map((function(e){return e.storageScript.name}))},oe=function(e){return Object.values(e[W.a].scripts).filter((function(e){return Object(G.a)(e)})).map((function(e){return e.storageScript.name}))},se=function(e,t){var r=e[W.a].scripts,n=(r[t],q(r,[t].map(J)));return Object.values(n).map((function(e){return e.storageScript.name}))},ce=function(e,t){var r=e[W.a].scripts,n=(r[t],q(r,[t].map(J))),a=Object.values(n).filter((function(e){return Object(G.a)(e)}));return Object.values(a).map((function(e){return e.storageScript.name}))},ue=function(e,t){var r=e[W.a].scripts,n=(r[t],q(r,[t].map(J))),a=Object.values(n).filter((function(e){return!Object(G.a)(e)}));return Object.values(a).map((function(e){return e.storageScript.name}))},le=Object(U.a)([$],(function(e){return e.filter((function(e){return!Object(z.a)(e)}))})),de=Object(U.a)([$],(function(e){return e.filter((function(e){return Object(z.a)(e)}))})),pe=function(e,t){if(!t)return!1;var r=Q(e,t);return Object(G.a)(r)},fe=function(e,t){var r=Q(e,t);return!!r&&V(r)},ge=function(e){return e[W.a].hasReceivedMetadata},me=function(e){return e[W.a].hasLoadedAttachedScripts},he=function(e,t){if(!t)return"None";var r=e[W.a].scriptsSavingStatus[t],n=e[W.a].scripts[t];return r&&n?function(e,t){var r=Object(H.a)(e);return"Succeeded"===t&&r?"None":t}(n,r):"None"},be=function(e,t){if(!t)return"None";var r=e[W.a].scriptsAttachingStatus[t];return r||"None"},ve=function(e,t){return!!t&&!!e[W.a].scriptsIsStorageCallInProgress[t]},Se=function(e){return!!e[W.a].scriptsIsAnyStorageCallInProgress},ye=function(e,t){return!!t&&!!e[W.a].scriptsIsConsented[t]},Oe=r(698),xe=function(e){return e.runFromButton.activeScript};t.e={backstage:n,bottomPanel:a,consentDialog:i,authDialog:o,shareDialog:s,unshareDialog:c,editor:u,macroRecorder:L,run:l,scripts:d,settings:Oe,runFromButton:p}},645:function(e,t,r){"use strict";function n(e){return"testId-"+e}r.d(t,"a",(function(){return n}))},656:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){return!!e&&e.storageScript.isCreator}},663:function(e,t,r){"use strict";var n=r(641),a={backstage:n.b,bottomPanel:n.c,consentDialog:n.d,authDialog:n.a,shareDialog:n.o,unshareDialog:n.p,dialog:n.f,editor:n.g,macroRecorder:n.h,messageBar:n.i,misc:n.j,run:n.k,scripts:n.m,settings:n.n};t.a=a},665:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(3),a=r(22);function i(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function s(e){i(o,n,a,s,c,"next",e)}function c(e){i(o,n,a,s,c,"throw",e)}s(void 0)}))}}var s=new Map;function c(e,t){return u.apply(this,arguments)}function u(){return(u=o(regeneratorRuntime.mark((function e(t,r){var i,o,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=!s.has(t),s.set(t,!0),o=i?new n.b("LoadChunk","System"):void 0,c={numFailures:0,chunkName:t},e.next=6,Object(a.b)(r,(function(){return c.numFailures>0&&Object(n.g)(new Error("Retry required while loading chunks"),"Unexpected",n.a.Warning,"Core",c),!0}),(function(){return c.numFailures++,!1}),3,c);case 6:return u=e.sent,o&&o.end(!0,n.a.Information,{firstLoad:i,chunk:t}),e.abrupt("return",u);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},668:function(e,t,r){"use strict";var n=r(663);r.d(t,"a",(function(){return n.a}));var a=r(669);r.d(t,"b",(function(){return a.a}))},669:function(e,t,r){"use strict";var n=r(643);t.a={backstage:n.b,bottomPanel:n.c,consentDialog:n.d,authDialog:n.a,shareDialog:n.l,unshareDialog:n.m,editor:n.f,run:n.h,scripts:n.j,settings:n.k}},670:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(128),a=function(e){return i(e.storageScript)},i=function(e){return!Object(n.a)(e.body)&&!Object(n.a)(e.description)}},674:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(715);function a(e){return!!e&&(!!Object(n.a)(e)||e.storageScript.body!==e.localUpdates.body)}},678:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(3),a=function(e){return Object(n.j)(e,"isScriptPublished"),e&&!!e.storageScript.dateLastPublished}},679:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(81),a=function(e){return e.storageScript.creatorId===n.c}},680:function(e,t,r){"use strict";var n=r(125),a=r(0),i=r.n(a),o=r(852),s=r.n(o),c=r(1381),u=r(1339);function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}t.a=Object(n.c)((function(e){var t=e.theme,r=e.styles,n=e.primary,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,["theme","styles","primary"]);return n?i.a.createElement(c.a,l({styles:s()(d(t),r)},a)):i.a.createElement(u.a,l({styles:s()(p(t),r)},a))}));var d=function(e){return{root:{borderRadius:"2px",fontSize:e.fontSizes.small,fontWeight:e.fontWeights.semibold,height:"2.6rem"}}},p=function(e){return{root:{borderRadius:"2px",fontSize:e.fontSizes.small,fontWeight:e.fontWeights.semibold,height:"2.6rem",backgroundColor:""+e.colors.white,border:"1px solid "+e.colors.neutralTertiary}}}},681:function(e,t,r){"use strict";var n;r.d(t,"a",(function(){return n})),r.d(t,"d",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return o})),function(e){e.Info="info",e.Log="log",e.Warn="warn",e.Error="error"}(n||(n={}));var a={id:"contextualHelpLearnMore",title:strings.Editor.LearnMoreDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2135335"},i=["contextualHelpTableOrChart","contextualHelpRange","contextualHelpWorkbook","contextualHelpPivotTable"],o=[{id:"contextualHelpTableOrChart",title:strings.Editor.CreateTableOrChartDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2139464"},{id:"contextualHelpRange",title:strings.Editor.ApplyFunctionToRangeDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2139375"},{id:"contextualHelpWorkbook",title:strings.Editor.MakeChangesToWorkbookDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2139465"},{id:"contextualHelpPivotTable",title:strings.Editor.PivotTableDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2139466"},{id:"contextualHelpChart",title:strings.Editor.ChartDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2141308"},{id:"contextualHelpComment",title:strings.Editor.CommentDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2141307"},{id:"contextualHelpRangeFormat",title:strings.Editor.RangeFormatDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2141026"},{id:"contextualHelpShape",title:strings.Editor.ShapeDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2141025"},{id:"contextualHelpTable",title:strings.Editor.TableDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2141106"},{id:"contextualHelpWorksheet",title:strings.Editor.WorksheetDocsLink,link:"https://go.microsoft.com/fwlink/p/?LinkId=2141024"}]},684:function(e,t,r){"use strict";r.d(t,"c",(function(){return g})),r.d(t,"b",(function(){return S})),r.d(t,"a",(function(){return O}));var n=r(6),a=r(127),i=r(48),o=r(22),s=r(41),c=r(3),u=r(167),l=r(756);function d(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){d(i,n,a,o,s,"next",e)}function s(e){d(i,n,a,o,s,"throw",e)}o(void 0)}))}}var f=function(){return!0},g=new(function(){function e(){Object.defineProperty(this,"successes",{configurable:!0,enumerable:!0,writable:!0,value:0}),Object.defineProperty(this,"authFails",{configurable:!0,enumerable:!0,writable:!0,value:0}),Object.defineProperty(this,"networkFails",{configurable:!0,enumerable:!0,writable:!0,value:0}),Object.defineProperty(this,"allFails",{configurable:!0,enumerable:!0,writable:!0,value:0}),Object.defineProperty(this,"disabledFails",{configurable:!0,enumerable:!0,writable:!0,value:0}),Object.defineProperty(this,"listeners",{configurable:!0,enumerable:!0,writable:!0,value:[]})}var t=e.prototype;return t.success=function(){this.successes++,this.broadcast()},t.failure=function(e){this.allFails++,Object(u.m)(e)?this.networkFails++:Object(u.c)(e)?this.authFails++:Object(u.e)(e)&&this.disabledFails++,this.broadcast()},t.listen=function(e){this.listeners.push(e)},t.broadcast=function(){var e=this.buildReport();this.listeners.forEach((function(t){return t(e)}))},t.buildReport=function(){return{callCount:this.allFails+this.successes,fails:{callCount:this.allFails,authFailures:this.authFails,networkFailures:this.networkFails,disabledFailures:this.disabledFails}}},e}());function m(e,t){return h.apply(this,arguments)}function h(){return(h=p(regeneratorRuntime.mark((function e(t,r){var i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new c.b(r.rootName+".Internal","System"),e.prev=1,e.next=4,t(i.id);case 4:return o=e.sent,i.end(!0,c.a.Information,{parentCallId:r.id}),g.success(),e.abrupt("return",o);case 10:throw e.prev=10,e.t0=e.catch(1),i.end(!1,c.a.Warning,{parentCallId:r.id,ErrorText:Object(s.a)(e.t0)}),e.t0 instanceof n.StorageServiceError&&401===e.t0.status&&(Object(n.setAccessToken)(null),a.a.instance().clearStorageToken()),g.failure(e.t0),e.t0;case 16:case"end":return e.stop()}}),e,null,[[1,10]])})))).apply(this,arguments)}var b=0;function v(){return 0===b&&(b=Object(i.a)("MoreRetries")?5:3),b}function S(e,t,r){return y.apply(this,arguments)}function y(){return(y=p(regeneratorRuntime.mark((function e(t,r,n){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=function(){var e=p(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j(r);case 2:return e.abrupt("return",t(r));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",Object(o.b)(p(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",m(a,r));case 1:case"end":return e.stop()}}),e)}))),f,Object(o.a)(u.n,n),v()));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(e){return x.apply(this,arguments)}function x(){return(x=p(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.a.instance().authorizeMLAPI(t);case 2:r=e.sent,Object(l.c)(r);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(e){return w.apply(this,arguments)}function w(){return(w=p(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.a.instance().authorizeStorageService(t);case 2:r=e.sent,Object(l.b)(r);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},688:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"b",(function(){return a})),r.d(t,"d",(function(){return i})),r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return s}));var a="settings";function i(){return Object.keys(o).reduce((function(e,t){var r;return n({},e,((r={})[t]=o[t].defaultValue,r))}),{})}var o={"editor.theme":{userFacingName:strings.Editor.SettingsThemeLabel,defaultValue:"Office",enum:["Office","Dark","Light","High Contrast"],displayText:{Office:strings.Editor.SettingsThemeNameOffice,Dark:strings.Editor.SettingsThemeNameDark,Light:strings.Editor.SettingsThemeNameLight,"High Contrast":strings.Editor.SettingsThemeNameHighContrast}},"editor.fontSize":{userFacingName:strings.Editor.SettingsFontSizeLabel,defaultValue:12,enum:[4,8,10,12,14,16,18,20,22,24,28,32,36]},"editor.wordWrap":{userFacingName:strings.Editor.SettingsWordWrapLabel,defaultValue:"Bounded",enum:["On","Off","Bounded"],displayText:{On:strings.Editor.SettingsWordWrapOptionOn,Off:strings.Editor.SettingsWordWrapOptionOff,Bounded:strings.Editor.SettingsWordWrapOptionBounded}},"editor.tabSize":{userFacingName:strings.Editor.SettingsTabSizeLabel,defaultValue:2,enum:[2,4]},"editor.minimap":{userFacingName:strings.Editor.SettingsMinimapLabel,defaultValue:!1},"editor.folding":{userFacingName:strings.Editor.SettingsFoldingLabel,defaultValue:!0},"editor.showContextualHelp":{userFacingName:"ShowContextualHelpByDefault",defaultValue:!0}};function s(){return{storageId:"",isOwner:!0,groupSectionStatus:{descriptionGroup:!1,scriptAccessGroup:!0,scriptActivityGroup:!0,securityGroup:!0},runCount:0,promptShare:!0}}},694:function(e,t,r){"use strict";r.r(t),r.d(t,"show",(function(){return a})),r.d(t,"hide",(function(){return i}));var n=r(640),a=Object(n.createAction)("AUTH_DIALOG_SHOW",(function(e){return function(t){return e(t)}})),i=Object(n.createAction)("AUTH_DIALOG_HIDE")},695:function(e,t,r){"use strict";r.r(t),r.d(t,"request",(function(){return a})),r.d(t,"start",(function(){return i})),r.d(t,"success",(function(){return o})),r.d(t,"failure",(function(){return s})),r.d(t,"cancel",(function(){return c}));var n=r(640),a=Object(n.createAction)("RUN_SCRIPT_REQUEST",(function(e){return function(t){return e(t)}})),i=Object(n.createAction)("RUN_SCRIPT_START",(function(e){return function(t){return e(t)}})),o=Object(n.createAction)("RUN_COMPLETE_SUCCESS",(function(e){return function(t){return e(t)}})),s=Object(n.createAction)("RUN_COMPLETE_FAILURE",(function(e){return function(t){return e(t)}})),c=Object(n.createAction)("RUN_CANCEL")},696:function(e,t,r){"use strict";r.r(t),r.d(t,"publishedScriptMetadataReceived",(function(){return a})),r.d(t,"storageCallInProgress",(function(){return i})),r.d(t,"storageCallComplete",(function(){return o})),r.d(t,"mergeMetadataFromRibbon",(function(){return s})),r.d(t,"mergeSharedMetadataFromRibbon",(function(){return c})),r.d(t,"fetchMetadataFromStorage",(function(){return u})),r.d(t,"fetchScriptsFromDocument",(function(){return l})),r.d(t,"fetchSamples",(function(){return d})),r.d(t,"fetchScriptFromStorage",(function(){return p})),r.d(t,"fetchSharedScriptFromStorage",(function(){return f})),r.d(t,"saveScriptToStorage",(function(){return g})),r.d(t,"editBody",(function(){return m})),r.d(t,"partialUpdate",(function(){return h})),r.d(t,"update",(function(){return b})),r.d(t,"remove",(function(){return v})),r.d(t,"acceptConsent",(function(){return S})),r.d(t,"denyConsent",(function(){return y})),r.d(t,"updateConsent",(function(){return O})),r.d(t,"addScriptToWorkbook",(function(){return x})),r.d(t,"removeScriptFromWorkbook",(function(){return j})),r.d(t,"unshareScriptFromAllWorkbooks",(function(){return w})),r.d(t,"revertToLastSaved",(function(){return E})),r.d(t,"updateSavingStatus",(function(){return k})),r.d(t,"updateAttachingStatus",(function(){return C}));var n=r(640),a=Object(n.createAction)("SCRIPTS_PUBLISHED_METADATA_RECEIVED"),i=Object(n.createStandardAction)("SCRIPTS_STORAGE_CALL_IN_PROGRESS")(),o=Object(n.createStandardAction)("SCRIPTS_STORAGE_CALL_COMPLETE")(),s=Object(n.createStandardAction)("SCRIPTS_MERGE_METADATA_FROM_RIBBON")(),c=Object(n.createStandardAction)("SCRIPTS_MERGE_SHARED_METADATA_FROM_RIBBON")(),u=Object(n.createAsyncAction)("SCRIPTS_FETCH_METADATA_FROM_STORAGE_REQUEST","SCRIPTS_FETCH_METADATA_FROM_STORAGE_SUCCESS","SCRIPTS_FETCH_METADATA_FROM_STORAGE_FAILURE")(),l=Object(n.createAsyncAction)("SCRIPTS_FETCH_METADATA_FROM_DOCUMENT_REQUEST","SCRIPTS_FETCH_METADATA_FROM_DOCUMENT_SUCCESS","SCRIPTS_FETCH_METADATA_FROM_DOCUMENT_FAILURE")(),d=Object(n.createAsyncAction)("SCRIPTS_FETCH_SAMPLES_REQUEST","SCRIPTS_FETCH_SAMPLES_SUCCESS","SCRIPTS_FETCH_SAMPLES_FAILURE")(),p=Object(n.createAsyncAction)("SCRIPTS_FETCH_REQUEST","SCRIPTS_FETCH_SUCCESS","SCRIPTS_FETCH_FAILURE")(),f=Object(n.createAsyncAction)("SCRIPTS_SHARED_FETCH_REQUEST","SCRIPTS_SHARED_FETCH_SUCCESS","SCRIPTS_SHARED_FETCH_FAILURE")(),g=Object(n.createAsyncAction)("SCRIPTS_SAVE_REQUEST","SCRIPTS_SAVE_SUCCESS","SCRIPTS_SAVE_FAILURE")(),m=Object(n.createStandardAction)("SCRIPTS_EDIT")(),h=Object(n.createStandardAction)("SCRIPTS_PARTIAL_UPDATE")(),b=Object(n.createStandardAction)("SCRIPTS_UPDATE")(),v=Object(n.createAsyncAction)("SCRIPTS_REMOVE_REQUEST","SCRIPTS_REMOVE_SUCCESS","SCRIPTS_REMOVE_FAILURE")(),S=Object(n.createAsyncAction)("SCRIPTS_ACCEPT_CONSENT_REQUEST","SCRIPTS_ACCEPT_CONSENT_SUCCESS","SCRIPTS_ACCEPT_CONSENT_FAILURE")(),y=Object(n.createAsyncAction)("SCRIPTS_DENY_CONSENT_REQUEST","SCRIPTS_DENY_CONSENT_SUCCESS","SCRIPTS_DENY_CONSENT_FAILURE")(),O=Object(n.createStandardAction)("SCRIPTS_UPDATE_CONSENT")(),x=Object(n.createAsyncAction)("SCRIPTS_ADD_TO_WORKBOOK_REQUEST","SCRIPTS_ADD_TO_WORKBOOK_SUCCESS","SCRIPTS_ADD_TO_WORKBOOK_FAILURE")(),j=Object(n.createAsyncAction)("SCRIPTS_REMOVE_FROM_WORKBOOK_REQUEST","SCRIPTS_REMOVE_FROM_WORKBOOK_SUCCESS","SCRIPTS_REMOVE_FROM_WORKBOOK_FAILURE")(),w=Object(n.createAsyncAction)("SCRIPTS_UNSHARE_FROM_ALL_WORKBOOKS_REQUEST","SCRIPTS_UNSHARE_FROM_ALL_WORKBOOKS_SUCCESS","SCRIPTS_UNSHARE_FROM_ALL_WORKBOOKS_FAILURE")(),E=Object(n.createStandardAction)("SCRIPTS_REVERT_TO_SAVED")(),k=Object(n.createStandardAction)("SCRIPTS_UPDATE_SAVING_STATUS")(),C=Object(n.createStandardAction)("SCRIPTS_UPDATE_ATTACHING_STATUS")()},697:function(e,t,r){"use strict";r.r(t),r.d(t,"edit",(function(){return a})),r.d(t,"apply",(function(){return i}));var n=r(640),a=Object(n.createAsyncAction)("SETTINGS_EDIT_REQUEST","SETTINGS_EDIT_SUCCESS","SETTINGS_EDIT_FAILURE")(),i=Object(n.createAction)("SETTINGS_APPLY")},698:function(e,t,r){"use strict";r.r(t),r.d(t,"get",(function(){return a})),r.d(t,"getAll",(function(){return i}));var n=r(688),a=function(e,t){if(!Object.keys(e[n.b].settings).includes(t))throw new Error("Unable to select setting '"+t+"' from settings.");return e[n.b].settings[t]},i=function(e){return e[n.b].settings}},700:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(e){Object.defineProperty(this,"initFn",{configurable:!0,enumerable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cachedPromise",{configurable:!0,enumerable:!0,writable:!0,value:void 0}),this.initFn=e}var t=e.prototype;return t.promise=function(){return this.cachedPromise||(this.cachedPromise=this.initFn()),this.cachedPromise},t.forget=function(){this.cachedPromise=void 0},t.get=function(){var e=this;return function(){return e.promise()}},e}()},701:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RuntimeState=void 0,function(e){e[e.Ready=0]="Ready",e[e.Executing=1]="Executing",e[e.NonExisting=2]="NonExisting"}(t.RuntimeState||(t.RuntimeState={}))},705:function(e,t,r){"use strict";var n=r(125).b.div.withConfig({displayName:"TaskpaneWrapper",componentId:"sc-1kkkq32-0"})(["height:100vh;min-height:100vh;width:100%;overflow:hidden;display:flex;flex-direction:column;background:",";"],(function(e){return e.theme.colors.neutralLight}));t.a=n},706:function(e,t,r){"use strict";t.a=function(e){var t=e.when,r=e.children;return t?r:null}},707:function(e,t,r){"use strict";r.r(t),r.d(t,"show",(function(){return a})),r.d(t,"hide",(function(){return i})),r.d(t,"setCurrentPivot",(function(){return o})),r.d(t,"setIsReactMonacoLoaded",(function(){return s}));var n=r(640),a=Object(n.createAction)("BACKSTAGE_SHOW"),i=Object(n.createAction)("BACKSTAGE_HIDE"),o=Object(n.createStandardAction)("BACKSTAGE_SET_CURRENT_PIVOT")(),s=Object(n.createAction)("BACKSTAGE_SET_REACTMONACO_LOADED")},708:function(e,t,r){"use strict";r.r(t),r.d(t,"show",(function(){return a})),r.d(t,"hide",(function(){return i})),r.d(t,"addOutputLogs",(function(){return o})),r.d(t,"clearOutputLogs",(function(){return s})),r.d(t,"setProblemsLogs",(function(){return c})),r.d(t,"clearProblemsLogs",(function(){return u})),r.d(t,"setCurrentPivot",(function(){return l})),r.d(t,"setHelpLinks",(function(){return d}));var n=r(640),a=Object(n.createAction)("BOTTOM_PANEL_SHOW"),i=Object(n.createAction)("BOTTOM_PANEL_HIDE"),o=Object(n.createAction)("BOTTOM_PANEL_ADD_OUTPUT_LOGS",(function(e){return function(t){return e(t)}})),s=Object(n.createAction)("BOTTOM_PANEL_CLEAR_OUTPUT_LOGS"),c=Object(n.createAction)("BOTTOM_PANEL_SET_PROBLEMS_LOGS",(function(e){return function(t){return e(t)}})),u=Object(n.createAction)("BOTTOM_PANEL_CLEAR_PROBLEMS_LOGS"),l=Object(n.createStandardAction)("BOTTOM_PANEL_SET_CURRENT_PIVOT")(),d=Object(n.createStandardAction)("BOTTOM_PANEL_SET_HELP_LINKS")()},709:function(e,t,r){"use strict";r.r(t),r.d(t,"show",(function(){return a})),r.d(t,"hide",(function(){return i}));var n=r(640),a=Object(n.createAction)("CONSENT_DIALOG_SHOW"),i=Object(n.createAction)("CONSENT_DIALOG_HIDE")},710:function(e,t,r){"use strict";r.r(t),r.d(t,"startRecordingRequest",(function(){return a})),r.d(t,"startRecordingSuccess",(function(){return i})),r.d(t,"sendRecorderHeartbeat",(function(){return o})),r.d(t,"stopRecording",(function(){return s})),r.d(t,"completeSaveProcess",(function(){return c})),r.d(t,"saveRecording",(function(){return u})),r.d(t,"pushIntent",(function(){return l})),r.d(t,"updateIntentList",(function(){return d}));var n=r(640),a=Object(n.createAction)("MACRO_RECORDER_START_REQUEST"),i=Object(n.createAction)("MACRO_RECORDER_START_SUCCESS"),o=Object(n.createAction)("MACRO_RECORDER_HEARTBEAT"),s=Object(n.createAction)("MACRO_RECORDER_STOP",(function(e){return function(t){return e(t)}})),c=Object(n.createStandardAction)("MACRO_RECORDER_COMPLETE_SAVE_PROCESS")(),u=Object(n.createAction)("MACRO_RECORDER_SAVE",(function(e){return function(){return e()}})),l=Object(n.createAction)("MACRO_RECORDER_PUSH_INTENT",(function(e){return function(t){return e(t)}})),d=Object(n.createAction)("MACRO_RECORDER_UPDATE_INTENT_LIST",(function(e){return function(t){return e(t)}}))},711:function(e,t,r){"use strict";r.r(t),r.d(t,"show",(function(){return o})),r.d(t,"dismiss",(function(){return s})),r.d(t,"reset",(function(){return c}));var n=r(640),a=r(744);function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var o=Object(n.createAction)("MESSAGE_BAR_SHOW",(function(e){return function(t){var r=i({},a.b,{isVisible:!0},t);return e(r)}})),s=Object(n.createAction)("MESSAGE_BAR_HIDE"),c=Object(n.createAction)("MESSAGE_BAR_RESET_STATE")},712:function(e,t,r){"use strict";r.r(t),r.d(t,"show",(function(){return a})),r.d(t,"hide",(function(){return i}));var n=r(640),a=Object(n.createAction)("SHARE_DIALOG_SHOW"),i=Object(n.createAction)("SHARE_DIALOG_HIDE")},713:function(e,t,r){"use strict";r.r(t),r.d(t,"show",(function(){return a})),r.d(t,"hide",(function(){return i}));var n=r(640),a=Object(n.createAction)("UNSHARE_DIALOG_SHOW"),i=Object(n.createAction)("UNSHARE_DIALOG_HIDE")},714:function(e,t,r){"use strict";r.r(t),r.d(t,"setActiveScript",(function(){return a})),r.d(t,"attemptToRunScriptFromLink",(function(){return i})),r.d(t,"viewScript",(function(){return o}));var n=r(640),a=Object(n.createAction)("RFB_SET_ACTIVE_SCRIPT",(function(e){return function(t){return e(t)}})),i=Object(n.createAction)("RFB_ATTEMPT_TO_RUN",(function(e){return function(t){return e(t)}})),o=Object(n.createAction)("RFB_VIEW_SCRIPT",(function(e){return function(t){return e(t)}}))},715:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){return!e.storageScript.dateFirstPublished}},716:function(e,t,r){"use strict";var n=r(641);r.d(t,"a",(function(){return n.e}));var a=r(643);r.d(t,"b",(function(){return a.e}))},717:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){return e>0&&(Date.now()-e)/1e3<=3}},718:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return c}));var n=r(3);function a(e,t){var r;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"===typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t){return e+":"+t}function s(e){var t=e.split(":");if(2===t.length)return{storageId:t[0],shareId:t[1]};var r=new Error("Unexpected pattern for storageId:shareId string, expected two parts and got "+t.length);Object(n.g)(r,"Unexpected",n.a.Warning)}function c(e){for(var t,r=[],n=a(e.map((function(e){return s(e)})));!(t=n()).done;){var i=t.value;i&&r.push(i)}return r}},724:function(e,t,r){"use strict";r.r(t),r.d(t,"getRecordingStatus",(function(){return n})),r.d(t,"getIntents",(function(){return a}));var n=function(e){return e.macroRecorder.recordingStatus},a=function(e){return e.macroRecorder.intents}},726:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return o})),r.d(t,"d",(function(){return s}));var n=r(32),a="run",i="main",o=2e3;function s(){var e=Object(n.c)();switch(e){case n.b.makerservicetest:return c("https://test.arbitraryrunner.com");case n.b.makerserviceint:return c("https://runtime.arbitraryrunner.com");case n.b.makerservicelocal:return c("http://localhost:30002");case n.b.localstorage:case n.b.makerserviceprodnew:return c("https://officescripts.microsoftusercontent.com");default:throw new Error("Unexpected environment "+e+" passed to getRuntimeUrl")}}function c(e){return e+"/eed0a086-3498-4f91-a377-1e0265ecc0cc"}},728:function(e,t,r){"use strict";r.d(t,"c",(function(){return u})),r.d(t,"b",(function(){return l})),r.d(t,"d",(function(){return d}));var n=r(0),a=r.n(n),i=r(1405),o=r(125),s=r(1394);function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var u=function(e,t){return{root:{alignSelf:"stretch",height:"3.2rem",padding:"0 "+e.spacing.xSmall,backgroundColor:e.colors.neutralLight,fontSize:e.fontSizes.small,selectors:{".ms-Button-menuIcon":{fontSize:e.fontSizes.icon},".ms-Icon":{marginTop:".1rem",opacity:t?.5:1}}},rootDisabled:{backgroundColor:e.colors.neutralLight,selectors:{"@media screen and (-ms-high-contrast: active)":{background:"window",MsHighContrastAdjust:"none"}}},rootHovered:{backgroundColor:e.colors.neutralQuaternaryAlt},rootPressed:{backgroundColor:e.colors.neutralTertiaryAlt},icon:{fontSize:e.fontSizes.icon}}},l=function(e,t,r){void 0===r&&(r=!1);var n=function(e,t,r){void 0===r&&(r=!1);var n=u(t,r);return c({},n,{root:c({},n.root,{fontSize:e})})}(e,t,r);return c({},n,{root:c({},n.root,{backgroundColor:"transparent"}),rootDisabled:{backgroundColor:"transparent"}})},d=function(e){var t=u(e,!1);return c({},t,{root:c({},t.root,{backgroundColor:"transparent",padding:"0",width:"3.2rem",minWidth:"3.2rem"})})};t.a=Object(o.c)((function(e){var t=e.buttonProps,r=e.testId,o=e.theme,l=e.additionalStyles,d=e.tooltipText,p=e.dismissTooltipOnFirstShow,f=e.isMenuOpened,g=e.setIsMenuOpened,m=void 0!==r&&void 0!==d,h=Object(n.useRef)(null),b=Object(n.useState)(!m||p?"":d),v=b[0],S=b[1];return Object(n.useEffect)((function(){m&&!0!==p&&S(d)}),[d]),a.a.createElement(s.a,{content:v,id:r+"-tooltip",componentRef:h},a.a.createElement(i.a,c({"data-testid":r,styles:c({},u(o,!!t.disabled),l)},t,{"aria-describedby":m?r+"-tooltip":void 0,onMouseEnter:function(e){p&&!v&&(S(d||""),h.current&&h.current.show())},onMenuClick:function(e){g&&(g(!f),null==e||e.preventDefault(),null==e||e.stopPropagation())},onAfterMenuDismiss:function(){g&&g(!1)},onKeyDown:function(e){"ArrowDown"===e.key&&e.altKey&&g&&!f&&(g(!0),null==e||e.preventDefault(),null==e||e.stopPropagation())}})))}))},730:function(e,t,r){"use strict";r.d(t,"c",(function(){return u})),r.d(t,"b",(function(){return p})),r.d(t,"a",(function(){return f}));var n=r(729),a=r.n(n),i=r(757),o=r(3);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var c=new i.a("script_v2",2e6,6048e5,{canPurge:function(e){var t=Object(i.b)(e);return!t.localUpdates.body||t.storageScript.body===t.localUpdates.body},compare:function(e,t){return e.lastWrite-t.lastWrite}});function u(e){return function(e,t){var r={storageScript:s({},t.storageScript,{shareId:void 0}),localUpdates:s({},t.localUpdates,{shareId:void 0})};d(r.storageScript),d(r.localUpdates);var n=t.storageScript.id,i=e.read(n);if(r&&(!i||!a()(r,i))){if(!e.write(n,r)&&!l){var c=i?o.a.Warning:o.a.Information;Object(o.g)(new Error("Failed to write script to localstorage"),"Unsupported",c,"Core",{newEntry:!i}),l=!0}}return!1}(c,e)}var l=!1;function d(e){Object.keys(e).forEach((function(t){void 0===e[t]&&delete e[t]}))}var p=function(){return{scripts:c.keys().map((function(e){return c.read(e)})).reduce((function(e,t){var r;return s({},e,((r={})[t.storageScript.id]=t,r))}),{}),hasLoadedAttachedScripts:!1,hasReceivedMetadata:!1,scriptsSavingStatus:{},scriptsAttachingStatus:{},scriptsIsStorageCallInProgress:{},scriptsIsAnyStorageCallInProgress:!1,scriptsIsConsented:{}}},f=function(e){c.purge(e)}},731:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return c}));var n=r(670),a=r(674),i=r(3);function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function s(e){var t=e.incomingScript,r=e.existingScript;if(Object(i.j)(t,"compareAndMergeIncomingAndExistingScript"),!r)return{selectedScript:t,isLocalBodyUpdated:!1,hasConflict:!1};if(!r.storageScript.dateLastPublished||!t.storageScript.dateLastPublished){var s=new Error("Unable to compare scripts that have not been published.");return Object(i.g)(s,"Unexpected",i.a.Warning,"Core",{storageId:r.storageScript.id}),{selectedScript:t,isLocalBodyUpdated:!1,hasConflict:!1}}var p=t.localUpdates.shareId||r.localUpdates.shareId;return t.localUpdates.shareId=p,r.localUpdates.shareId=p,r.localUpdates.shareId=t.localUpdates.shareId,void 0===r.storageScript.isCreator&&(r.storageScript=o({},r.storageScript,{isCreator:t.storageScript.isCreator}),Object(i.g)(new Error("Did not find isCreator on cached script."),"Unsupported",i.a.Information,"Core",{storageId:r.storageScript.id})),l(t,r)&&(r.storageScript=o({},r.storageScript,{path:t.storageScript.path})),Object(n.a)(r)&&!u(t,r)?{selectedScript:r,isLocalBodyUpdated:!1,hasConflict:!1}:Object(a.a)(r)&&u(t,r)?d(t,r)?{selectedScript:r,isLocalBodyUpdated:!1,hasConflict:!0}:{selectedScript:c(t,r),isLocalBodyUpdated:!1,hasConflict:!1}:{selectedScript:t,isLocalBodyUpdated:d(t,r),hasConflict:!1}}var c=function(e,t){return{storageScript:e.storageScript,localUpdates:t.localUpdates}},u=function(e,t){return Object(i.j)(e,"isIncomingScriptNewer"),Object(i.j)(t,"isIncomingScriptNewer"),e.storageScript.dateLastPublished>t.storageScript.dateLastPublished},l=function(e,t){return e.storageScript.path!==t.storageScript.path},d=function(e,t){return!!t&&e.storageScript.body!==t.storageScript.body}},732:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.store={}}return e.prototype.create=function(e,t){return!this.store[e]&&(this.store[e]=t,!0)},e.prototype.read=function(e){if(void 0!==this.store[e])return this.store[e];throw new Error("No such item: "+JSON.stringify(e))},e.prototype.keyExists=function(e){return void 0!==this.store[e]},e.prototype.delete=function(e){var t=!!this.store[e];return delete this.store[e],t},e.prototype.keys=function(){return Object.keys(this.store)},e}();t.default=n},733:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return/MSIE|Trident/.test(window.navigator.userAgent)}},738:function(e,t,r){"use strict";r.d(t,"a",(function(){return O}));var n=r(125),a=r(0),i=r.n(a),o=r(1404),s=r(754),c=r(872),u=r.n(c),l=r(873).ObjectInspector,d=function(e){var t=e.obj;return t&&t.toJSON?i.a.createElement(l,{data:t.toJSON()}):"undefined"!==typeof OfficeExtension&&t instanceof OfficeExtension.Error?i.a.createElement(l,{data:t,expandPaths:["$","$.debugInfo","$.debugInfo.surroundingStatements"]}):u()(t)?i.a.createElement(l,{data:t,showNonenumerable:!0,expandLevel:1,sortObjectKeys:p}):i.a.createElement(l,{data:t})};function p(e,t){return"stack"===e?1:"stack"===t||e<t?-1:e>t?1:0}var f=r(41),g=r(1399),m=r(245),h=r(1394),b=r(681),v=r(3);function S(){return(S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var y,O,x=0,j=Object(n.c)((function(e){var t,r=e.severity,n=e.message,o=e.theme;x++,y||(y=new v.b("LogItem","System"));var s=Object(f.a)(n),c=s.length,u="object"===typeof n?"object":"string";if("object"===u){c>1e5&&(n=s)}Object(a.useEffect)((function(){y.ended()||y.end(!0,v.a.Information,{messageType:u,messageLength:c})}),[u,c]);var l={backgroundColor:o.colors.neutralLight,borderColor:o.colors.neutralLight,color:o.colors.neutralDark,icon:{name:"Log",color:o.colors.neutralSecondaryLight,tooltipText:void 0},ariaLabel:strings.substitute(strings.Editor.InfoConsoleLogLabel,{logText:s})},p=(t={},t[b.a.Log]=S({},l),t[b.a.Info]=S({},l,{icon:{name:"Info",color:o.colors.infoIcon},ariaLabel:strings.substitute(strings.Editor.InfoConsoleLogLabel,{logText:s})}),t[b.a.Warn]=S({},l,{icon:{name:"Warning",color:o.colors.warningIcon,tooltipText:strings.Editor.WarningConsoleLogTooltip},ariaLabel:strings.substitute(strings.Editor.WarningConsoleLogLabel,{logText:s})}),t[b.a.Error]=S({},l,{icon:{name:"Error",color:o.colors.errorIcon,tooltipText:strings.Editor.ErrorConsoleLogTooltip},ariaLabel:strings.substitute(strings.Editor.ErrorConsoleLogLabel,{logText:s})}),t)[r],m=p.backgroundColor,O=p.borderColor,j=p.color,C=p.icon,_=p.ariaLabel;return i.a.createElement(E,{backgroundColor:m,color:j,borderColor:O,role:"listitem","aria-label":_,tabIndex:0,dir:"ltr","data-is-focusable":!0},C&&i.a.createElement(h.a,{content:C.tooltipText?C.tooltipText:"",id:"log-item-"+x+"-tooltip",styles:w(o,C.color)},i.a.createElement(g.a,{iconName:C.name,"aria-describedby":C.tooltipText?"log-item-"+x+"-tooltip":void 0})),"object"===typeof n?i.a.createElement(d,{obj:n}):i.a.createElement(k,{dir:"ltr"},Object(f.a)(n)))})),w=function(e,t){return{root:{margin:Object(m.a)()?"0 0 0 "+e.spacing.smallPlus:"0 "+e.spacing.smallPlus+" 0 0",fontSize:e.fontSizes.small,height:"16px",color:t}}},E=n.b.li.withConfig({displayName:"LogItem__LogEntry",componentId:"sc-15co0cx-0"})(["display:flex;align-items:center;vertical-align:middle;position:relative;width:100%;min-height:2.4rem;padding:"," ",";margin-bottom:",";font-family:monospace;color:",";background-color:",";border-top:0.5px solid ",";border-bottom:0.5px solid ",";overflow-wrap:break-word;word-wrap:break-word;& *{background:",";}&:focus{outline:0.1rem solid ",";}"],(function(e){return e.theme.spacing.xSmall}),(function(e){return e.theme.spacing.small}),(function(e){return e.theme.spacing.xSmall}),(function(e){return e.color}),(function(e){return e.backgroundColor}),(function(e){return e.borderColor}),(function(e){return e.borderColor}),(function(e){return e.backgroundColor}),(function(e){return e.theme.colors.neutralSecondary})),k=n.b.pre.withConfig({displayName:"LogItem__LogText",componentId:"sc-15co0cx-1"})(["white-space:pre-wrap;word-wrap:break-word;font-size:",";width:100%;line-height:1.2rem;text-align:left;"],(function(e){return e.theme.fontSizes.small})),C=r(1408),_=Object(n.c)((function(e){var t=e.logs.slice(-500).map((function(e){var t=e.id,r=e.severity,n=e.message;return i.a.createElement(j,{key:t,severity:r,message:n})}));return i.a.createElement(C.a,{"data-testid":e["data-testid"],role:"list",style:R(e.theme)},t)})),R=function(e){return{padding:"0.6rem 0.1rem",maxHeight:"100%",overflowX:"hidden",overflowY:"auto",background:e.colors.neutralLight}},P=r(645),T=r(728),I=r(1401),D=Object(n.c)((function(e){var t=e.links.map((function(t){var r=t.id,n=t.title,a=t.link;return i.a.createElement(M,{key:r},i.a.createElement(I.a,{key:r,href:a,target:"_blank",onClick:function(){return Object(v.h)({eventName:"FollowLink",eventType:"User",data:{id:r,storageId:e.activeScriptId}})}},n))}));return i.a.createElement(C.a,{"data-testid":e["data-testid"],role:"list",style:A(e.theme)},i.a.createElement(i.a.Fragment,null,i.a.createElement(N,null,t),i.a.createElement(M,{key:b.d.id},i.a.createElement(I.a,{key:b.d.id,href:b.d.link,target:"_blank",onClick:function(){return Object(v.h)({eventName:"FollowLink",eventType:"User",data:{id:b.d.id,storageId:e.activeScriptId}})}},b.d.title))))})),A=function(e){return{padding:"0.6rem 0.1rem",maxHeight:"100%",overflowX:"hidden",overflowY:"auto",background:e.colors.neutralLight}},M=n.b.div.withConfig({displayName:"HelpLinkList__LinkWrapper",componentId:"sc-1ict7rp-0"})(["padding:"," "," 0 ",";"],(function(e){return e.theme.spacing.xSmall}),(function(e){return e.theme.spacing.small}),(function(e){return e.theme.spacing.small})),N=n.b.div.withConfig({displayName:"HelpLinkList__LinkListWrapper",componentId:"sc-1ict7rp-1"})(["padding-bottom:",";"],(function(e){return e.theme.spacing.smallPlus})),L=r(48);function B(){return(B=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}!function(e){e.Output="Output",e.Problems="Problems",e.Help="Help"}(O||(O={}));t.b=Object(n.c)((function(e){var t,r=Object(a.useState)(!1),n=r[0],c=r[1],u=e.theme,l=e.outputLogs,d=e.problemsLogs,p=e.helpLinks,f=e.shouldFocusBottomPanel,g=e.showByDefault,m=e.setShouldFocusBottomPanel,b=e.hide,S=e.activeScriptId,y=e.editSetting,x=n?{resizeIcon:"ChevronDown",resizeText:strings.General.CollapseText,color:u.colors.neutralDarker,panelHeight:"70%"}:{resizeIcon:"ChevronUp",resizeText:strings.General.ExpandText,color:u.colors.neutralDarker,panelHeight:"30%"},j=x.resizeIcon,w=x.resizeText,E=x.panelHeight,k=[{key:O.Output,testId:Object(P.a)("BottomPanelOutputPivot"),text:strings.Editor.OutputTabLabel,ariaLabel:strings.Editor.OutputTabLabel,itemCount:l.length},{key:O.Problems,testId:Object(P.a)("BottomPanelProblemsPivot"),text:strings.Editor.ProblemsTabLabel,ariaLabel:strings.Editor.ProblemsTabLabel,itemCount:d.length}];k.push({key:O.Help,testId:Object(P.a)("BottomPanelHelpPivot"),text:strings.Editor.HelpTabLabel,ariaLabel:strings.Editor.HelpTabLabel,itemCount:p?p.length:0});var C=((t={})[O.Output]=i.a.createElement(_,{"data-testid":Object(P.a)("BottomPanelOutputPanel"),logs:l}),t[O.Problems]=i.a.createElement(_,{"data-testid":Object(P.a)("BottomPanelProblemsPanel"),logs:d}),t[O.Help]=i.a.createElement(D,{"data-testid":Object(P.a)("BottomPanelHelpPanel"),links:p,activeScriptId:S}),t),R=e.currentPivotKey||Object.keys(C)[0];return Object(a.useEffect)((function(){Object(v.c)("Editor","Editor",R)}),[e.currentPivotKey]),i.a.createElement(H,{"data-testid":Object(P.a)("BottomPanel"),panelHeight:E},i.a.createElement(F,null,i.a.createElement(W,null,i.a.createElement(s.a,{selectedKey:R,onSelect:e.setCurrentPivotKey,items:k,shouldFocus:f,setShouldFocus:function(e){return m(e)}})),i.a.createElement("div",null,i.a.createElement(h.a,{id:"ExpandCollapseIcon-tooltip",content:w},i.a.createElement(o.a,{"data-testid":Object(P.a)("BottomPanelExpandCollapse"),iconProps:{iconName:j},ariaLabel:w,onClick:function(){c(!n)},styles:B({},Object(T.c)(u,!1),U(u)),"aria-describedby":"ExpandCollapseIcon-tooltip"})),i.a.createElement(h.a,{id:Object(P.a)("BottomPanelClose")+"-tooltip",content:strings.General.CloseButtonLabel},i.a.createElement(o.a,{"data-testid":Object(P.a)("BottomPanelClose"),iconProps:{iconName:"Cancel"},ariaLabel:strings.General.CloseButtonLabel,onClick:function(){var e;(b(),Object(L.a)("ShowContextualHelpByDefault"))&&(y(((e={})["editor.showContextualHelp"]=!1,e)),Object(v.d)({eventName:"CloseBottomPanel",eventType:"User",data:{pivotKey:R,showByDefault:g}}))},styles:B({},Object(T.c)(u,!1),U(u)),"aria-describedby":Object(P.a)("BottomPanelClose")+"-tooltip"})))),C[R])}));var F=n.b.div.withConfig({displayName:"Console__FlexWrapper",componentId:"dfh6kv-0"})(["display:flex;align-items:flex-start;"]),W=n.b.div.withConfig({displayName:"Console__PushLeft",componentId:"dfh6kv-1"})(["flex-grow:1;"]),U=function(e){return{root:{padding:0,fontSize:e.fontSizes.mini,color:e.colors.neutralDarker},icon:{fontSize:e.fontSizes.mini}}},H=n.b.div.withConfig({displayName:"Console__BottomPanelWrapper",componentId:"dfh6kv-2"})(["display:flex;flex-direction:column;background-color:",";height:",";max-height:",";width:100%;position:absolute;bottom:3.2rem;padding:"," ",";"],(function(e){return e.theme.colors.neutralLight}),(function(e){return e.panelHeight}),(function(e){return e.panelHeight}),(function(e){return e.theme.spacing.xSmall}),(function(e){return e.theme.spacing.small}))},742:function(e,t,r){"use strict";var n=r(125),a=r(0),i=r.n(a),o=r(1398),s=r(174);function c(){var e=function(e,t){t||(t=e.slice(0));return e.raw=t,e}(["\n margin: ",";\n margin-top: ",";\n"]);return c=function(){return e},e}t.a=Object(n.c)((function(e){var t=e["data-testid"]?{"data-testid":e["data-testid"]}:void 0;return i.a.createElement(l,null,i.a.createElement(o.a,{ariaLabel:strings.substitute(strings.Editor.SettingCheckboxAriaLabel,{settingName:e.settingTitle}),label:e.settingTitle,onChange:function(t,r){return void 0!==r&&e.onChange(r)},checked:e.checked,boxSide:"end",styles:u(e.theme),inputProps:t}))}));var u=function(e){return Object(s.a)()?{root:{width:"100%"},label:{width:"100%",justifyContent:"space-between"},checkbox:{position:"absolute",transform:"translate(-100%,0px)"},text:{fontSize:e.fontSizes.small,fontWeight:e.fontWeights.semibold}}:{root:{width:"100%"},label:{width:"100%",justifyContent:"space-between"},text:{fontSize:e.fontSizes.small,fontWeight:e.fontWeights.semibold}}},l=n.b.div(c(),(function(e){return e.theme.spacing.small}),(function(e){return e.theme.spacing.mediumPlus}))},744:function(e,t,r){"use strict";r.d(t,"b",(function(){return c}));var n=r(641),a=r(640),i=r(167);function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s={style:1,isVisible:!0,urlLink:null,actionLink:null,isBlocking:!0,forceSingleLine:!0},c={isVisible:!1,style:0,text:"",urlLink:null,actionLink:null,isBlocking:!1,forceSingleLine:!1};t.a=function(e,t){void 0===e&&(e=c);var r=o({},s,{buttons:[{isPrimary:!0,text:strings.General.DismissButtonText,actions:[n.e.messageBar.dismiss()]}]}),u=o({},s,{buttons:[{isPrimary:!0,text:strings.General.OKButtonText,actions:[n.e.messageBar.dismiss()]}]});switch(t.type){case Object(a.getType)(n.e.scripts.saveScriptToStorage.failure):var l=Object(i.q)(t.payload.error)?strings.Message.TimeOutErrorMessage:Object(i.k)(t.payload.error)?strings.Message.FailedToOpenDeletedScriptMessage:strings.Message.SaveFailed;return Object(i.q)(t.payload.error)?o({},u,{text:l}):Object(i.k)(t.payload.error)?o({},s,{text:l,buttons:[{isPrimary:!0,text:strings.General.OKButtonText,actions:[n.e.messageBar.dismiss(),n.e.backstage.setCurrentPivot("Recent"),n.e.backstage.show()]}]}):o({},r,{text:l});case Object(a.getType)(n.e.scripts.remove.failure):return o({},r,{text:strings.Message.DeleteFailed});case Object(a.getType)(n.e.scripts.addScriptToWorkbook.failure):return Object(i.k)(t.payload.error)?o({},s,{text:strings.Message.FailedToOpenDeletedScriptMessage,buttons:[{isPrimary:!0,text:strings.General.OKButtonText,actions:[n.e.messageBar.dismiss(),n.e.backstage.setCurrentPivot("Recent"),n.e.backstage.show()]}]}):o({},r,{text:strings.Message.SharingFailed});case Object(a.getType)(n.e.scripts.removeScriptFromWorkbook.failure):return o({},r,{text:strings.Message.UnsharingFailed});case Object(a.getType)(n.e.scripts.unshareScriptFromAllWorkbooks.failure):return o({},r,{text:strings.Message.BlockingAccessFailed});case Object(a.getType)(n.e.editor.onOpenNewScript):return c;case Object(a.getType)(n.e.messageBar.show):return t.payload;case Object(a.getType)(n.e.messageBar.dismiss):return o({},e,{isVisible:!1});case Object(a.getType)(n.e.messageBar.reset):return c;default:return e}}},745:function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return a}));var n="editor",a=1.35},746:function(e,t,r){"use strict";var n=r(649),a=r(851),i=r(739),o=r(56);t.a=function(e){var t=Object(i.a)({onError:function(e){return Object(o.b)(e)}}),r=Object(n.createStore)(e.rootReducer,e.initialState,Object(a.composeWithDevTools)(Object(n.applyMiddleware)(t)));if(t.run(e.rootSaga),logger.isEnabled){var s=r.dispatch;r.dispatch=function(e){logger.group(e.type),logger.log("%c prev state","color: gray",r.getState()),logger.log("%c action","color: blue",e);var t=s(e);return logger.log("%c next state","color: green",r.getState()),logger.groupEnd(),t}}return r}},753:function(e,t,r){"use strict";var n=r(125),a=r(0),i=r.n(a);t.a=function(e){var t=e.header,r=e.main;return i.a.createElement(o,null,t,i.a.createElement(s,null,r))};var o=n.b.div.withConfig({displayName:"HeaderAndMain__HeaderAndMainWrapper",componentId:"sc-16guzhj-0"})(["height:100%;width:100%;display:flex;flex-direction:column;background:",";"],(function(e){return e.theme.colors.neutralLight})),s=n.b.div.withConfig({displayName:"HeaderAndMain__MainArea",componentId:"sc-16guzhj-1"})(["overflow:hidden;flex:1;"])},754:function(e,t,r){"use strict";var n=r(125),a=r(0),i=r.n(a),o=r(1397),s=r(1027);t.a=Object(n.c)((function(e){var t=e.items,r=e.selectedKey,n=e.testId,u=e.shouldFocus,l=e.setShouldFocus,d=e.theme,p=e.onSelect,f=i.a.createRef();return Object(a.useEffect)((function(){u&&f.current&&(f.current.focus(),l&&l(!1))}),[u,l,f]),i.a.createElement(o.a,{"data-testid":n,componentRef:f,onLinkClick:function(e){var t=e?e.props.itemKey:null;t&&t!==r&&p&&p(t)},selectedKey:r,styles:c(d)},t.map((function(e){var t=e.testId?{"data-testid":e.testId}:void 0;return i.a.createElement(s.a,{key:e.key,itemKey:e.key,headerText:e.text,ariaLabel:e.ariaLabel,itemIcon:e.iconName,headerButtonProps:t,itemCount:e.itemCount||void 0})})))}));var c=function(e){return{root:{paddingTop:"1px",paddingBottom:e.spacing.smallPlus},linkIsSelected:{selectors:{":hover":{background:"transparent"}}},link:{selectors:{":hover":{background:"transparent"}}}}}},755:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(48);function a(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,c,"next",e)}function c(e){a(o,n,i,s,c,"throw",e)}s(void 0)}))}}var o=new(r(700).a)((function(){return s.apply(this,arguments)})).get();function s(){return(s=i(regeneratorRuntime.mark((function e(){var t,r,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t={},Object(n.a)("OfficeScriptOverrideUrl")){e.next=4;break}return e.abrupt("return",t);case 4:return a=(r="https://localhost:3000")+"/office-script-override.json",logger.log("[Office Script] Override url ["+a+"]"),e.next=9,p(a);case 9:if(!(i=e.sent)){e.next=14;break}return logger.log("[Office Script] Override name ["+(i.name||"?")+"]"),e.next=14,Promise.all([l("code","codeOverride",g,t,i,r),l("intellisense","intellisenseOverride",g,t,i,r),l("model","modelOverride",p,t,i,r),c("officeJs","officeJsOverride",h,t,i)]);case 14:return e.abrupt("return",t);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function c(e,t,r,n,a){return u.apply(this,arguments)}function u(){return(u=i(regeneratorRuntime.mark((function e(t,r,n,a,i){var o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(o=i[t])){e.next=8;break}return e.next=4,n(o);case 4:(s=e.sent)&&(a[r]=s),c="[Office Script] Override ["+t+"]\n["+o+"]\nset ["+(s?"ok":"FAIL")+"]",logger.log(c);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,t,r,n,a,i){return d.apply(this,arguments)}function d(){return(d=i(regeneratorRuntime.mark((function e(t,r,n,a,i,o){var s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(s=i[t])){e.next=9;break}return c=o+"/"+s,e.next=5,n(c);case 5:(u=e.sent)&&(a[r]=u),l="[Office Script]: Override ["+t+"]\n["+c+"]\nload ["+(u?"ok":"FAIL")+"]",logger.log(l);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return f.apply(this,arguments)}function f(){return(f=i(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g(t);case 2:if(r=e.sent,n=void 0,r)try{n=JSON.parse(r)}catch(a){logger.log(a)}return e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return m.apply(this,arguments)}function m(){return(m=i(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:return r=void 0,e.prev=3,e.next=6,fetch(t);case 6:r=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),logger.log(e.t0);case 12:if(n=void 0,!r||!r.ok){e.next=23;break}return e.prev=14,e.next=17,r.text();case 17:n=e.sent,e.next=23;break;case 20:e.prev=20,e.t1=e.catch(14),logger.log(e.t1);case 23:return e.abrupt("return",n);case 24:case"end":return e.stop()}}),e,null,[[3,9],[14,20]])})))).apply(this,arguments)}function h(e){return b.apply(this,arguments)}function b(){return(b=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t);case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},756:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return u}));var n=r(6),a={token:null,mlToken:null},i=new n.ConsentManager,o=function(e){Object(n.setUserAccessInfo)({currentUserToken:e.token,currentUserMlapiToken:e.mlToken})},s=function(){return a},c=function(e){var t=s();t.mlToken=e,o(t)},u=function(e){var t=s();t.token=e,o(t)}},757:function(e,t,r){"use strict";function n(e){return JSON.parse(e.data)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return a}));var a=function(){function e(e,t,r,n){if(Object.defineProperty(this,"_rootKey",{configurable:!0,enumerable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_maxSpace",{configurable:!0,enumerable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_expire",{configurable:!0,enumerable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_allValues",{configurable:!0,enumerable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_evaluator",{configurable:!0,enumerable:!0,writable:!0,value:void 0}),!e||!t||t>3e6||!n)throw new Error("Invalid param");this._rootKey=e+".",this._maxSpace=t,this._expire=r,this._evaluator=n}var t=e.prototype;return t.keys=function(){this.ensureInitialized();var e=this._rootKey.length;return Object.keys(this._allValues).map((function(t){return t.substring(e)}))},t.read=function(e){this.ensureInitialized();var t=this.fullKey(e);this.purgeExpired();var r=this._allValues[t];return r?n(r):void 0},t.write=function(e,t){this.ensureInitialized();var r=this.fullKey(e),n={data:JSON.stringify(t),lastWrite:Date.now()};try{return this.purgeOversize(this._maxSpace-n.data.length),this.totalSize()>this._maxSpace-n.data.length?!1:(this.doStorageWrite(r,JSON.stringify(n)),this._allValues[r]=n,!0)}catch(a){return!1}},t.purge=function(e){this.ensureInitialized();var t=this.keys().indexOf(e)>=0;if(t){var r=this.fullKey(e);this.removeKey(r)}return t},t.purgeOversize=function(e){var t=0,r=this.sortByValue();for(e=Math.max(0,e);this.totalSize()>e;){var n=r.shift();if(!n)throw new Error("Ran out of keys before we ran out of size.");this.canPurgeKey(n)&&(this.removeKey(n),t++)}return t},t.purgeExpired=function(){var e=this,t=0,r=Date.now();return Object.keys(this._allValues).forEach((function(n){var a=e._allValues[n];e._expire>0&&r-e._expire>a.lastWrite&&e.canPurgeKey(n)&&(e.removeKey(n),delete e._allValues[n],t++)})),t},t.canPurgeKey=function(e){return this.canPurgeEntry(this._allValues[e])},t.canPurgeEntry=function(e){return this._evaluator.canPurge(e)},t.readAll=function(){var e=this,t={},r=this.tryOrDefault((function(){return e.doStorageValueOf()}),{});return Object.keys(r).filter((function(t){return 0===t.indexOf(e._rootKey)})).forEach((function(n){try{var a=JSON.parse(r[n]);t[n]=a}catch(i){e.doStorageRemove(n)}})),t},t.totalSize=function(){var e=this,t=Object.keys(this._allValues),r=0;return t.forEach((function(t){r+=e._allValues[t].data.length})),r},t.sortByValue=function(){var e=this,t=Object.keys(this._allValues);return t.sort((function(t,r){var n=e._allValues[t],a=e._allValues[r];return e._evaluator.compare(n,a)})),t},t.fullKey=function(e){return this._rootKey+e},t.removeKey=function(e){try{delete this._allValues[e],this.doStorageRemove(e)}catch(t){return!1}return!0},t.ensureInitialized=function(){this._allValues||(this._allValues=this.readAll(),this.purgeExpired())},t.doStorageWrite=function(e,t){localStorage.setItem(e,t)},t.doStorageRemove=function(e){localStorage.removeItem(e)},t.doStorageValueOf=function(){return localStorage.valueOf()},t.tryOrDefault=function(e,t){try{return e()}catch(r){return t}},e}()},758:function(e,t,r){"use strict";var n=r(649),a=r(640),i=r(694);t.a=Object(n.combineReducers)({isVisible:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(a.getType)(i.show):return!0;case Object(a.getType)(i.hide):return!1;default:return e}},acceptFn:function(e,t){switch(void 0===e&&(e=function(){}),t.type){case Object(a.getType)(i.show):return t.payload.acceptFn;default:return e}},cancelFn:function(e,t){switch(void 0===e&&(e=function(e){}),t.type){case Object(a.getType)(i.show):return t.payload.cancelFn;default:return e}}})},759:function(e,t,r){"use strict";var n=r(641),a=r(640),i=r(869);function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s={isVisible:!1,style:i.a.normal,title:"",subText:"",isBlocking:!0,buttons:[]};t.a=function(e,t){switch(void 0===e&&(e=s),t.type){case Object(a.getType)(n.e.dialog.show):return{isVisible:!0,style:t.payload.style||i.a.normal,title:t.payload.title,subText:t.payload.subText,isBlocking:t.payload.isBlocking,buttons:t.payload.buttons};case Object(a.getType)(n.e.dialog.hide):return o({},e,{isVisible:!1});case Object(a.getType)(n.e.dialog.reset):return s;default:return e}}},760:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(664),a=r(640),i=r(93),o=r(641),s=regeneratorRuntime.mark(l),c=regeneratorRuntime.mark(d),u=regeneratorRuntime.mark(p);function l(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(n.g)(d);case 2:return e.next=4,Object(n.l)(Object(a.getType)(o.f.dismiss),p);case 4:case"end":return e.stop()}}),s)}function d(){var e,t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=3,Object(n.k)(Object(a.getType)(o.f.show));case 3:return r.next=6,Object(n.i)({show:Object(n.k)(Object(a.getType)(o.f.show)),dismiss:Object(n.k)(Object(a.getType)(o.f.dismiss))});case 6:if(e=r.sent,t=e.show,!e.dismiss){r.next=13;break}return r.abrupt("break",16);case 13:t&&(logger.error("A show was called while a dialog was already visible"),logger.error("Offending action: "+JSON.stringify(t,null,4)));case 14:r.next=3;break;case 16:r.next=0;break;case 18:case"end":return r.stop()}}),c)}function p(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(n.h)(o.f.hide());case 2:return e.next=4,Object(i.a)(500);case 4:return e.next=6,Object(n.h)(o.f.reset());case 6:case"end":return e.stop()}}),u)}},761:function(e,t,r){"use strict";function n(e,t){var r=1,n="",a=e.map((function(e){return e.toLowerCase()}));do{n=t+" "+r++}while(a.includes(n.toLowerCase()));return n}function a(e){for(var t=Math.pow(16,6),r=Math.pow(16,5),n=Math.floor(Math.random()*t);n<r;)n+=r;return e+" "+n.toString(16)}function i(e,t){var r=1,n=t.match(/ \(([0-9]+)\)$/);for(n&&(t=t.replace(n[0],""),r=Number(n[1])+1);e.includes(t+" ("+r+")");)r++;return t+" ("+r+")"}r.d(t,"b",(function(){return n})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return i}))},762:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(670);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var i=function(e,t){return function(e){if(!Object(n.b)(e))throw new Error("Trying to convert an incomplete CombinedStorageScript script to a StorageScript");return e}(a({},e.storageScript,e.localUpdates,t))}},763:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(6),a=r(3),i=r(41),o=r(718),s=r(167);function c(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){c(i,n,a,o,s,"next",e)}function s(e){c(i,n,a,o,s,"throw",e)}o(void 0)}))}}var l=function(){Object.defineProperty(this,"readScriptIdsFromWorkbook",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=u(regeneratorRuntime.mark((function e(){var t,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new a.b("ReadScriptIdsFromWorkbook","System"),e.prev=1,e.next=4,Object(n.readScriptIdsFromWorkbook)();case 4:return r=e.sent,t.end(!0,a.a.Information,{numberOfIds:r.length}),e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(1),o=e.t0 instanceof n.MakerStorageError&&(e.t0.errorCode===n.StorageErrorCode.WorkbookCustomXMLMalformed||e.t0.errorCode===n.StorageErrorCode.WorkbookCustomXMLNotFound||Object(s.p)(e.t0))?a.a.Warning:a.a.Error,t.end(!1,o,{ErrorText:Object(i.a)(e.t0)},e.t0),e.t0;case 14:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(){return e.apply(this,arguments)}}()}),Object.defineProperty(this,"attachScriptToWorkbook",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=u(regeneratorRuntime.mark((function e(t){var r,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new a.b("AttachScriptToWorkbook","User"),s=Object(o.c)(t),c=s?s.storageId:void 0,e.prev=3,e.next=6,Object(n.attachScriptToWorkbook)(t);case 6:r.end(!0,a.a.Information,{storageId:c}),e.next=13;break;case 9:throw e.prev=9,e.t0=e.catch(3),r.end(!1,a.a.Error,{storageId:c,ErrorText:Object(i.a)(e.t0)},e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t){return e.apply(this,arguments)}}()}),Object.defineProperty(this,"detachScriptFromWorkbook",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=u(regeneratorRuntime.mark((function e(t,r){var s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===r&&(r="User"),s=new a.b("DetachScriptToWorkbook","User"),c=Object(o.c)(t),u=c?c.storageId:void 0,e.prev=4,e.next=7,Object(n.detachScriptFromWorkbook)(t);case 7:s.end(!0,a.a.Information,{storageId:u,invokedBy:r}),e.next=14;break;case 10:throw e.prev=10,e.t0=e.catch(4),s.end(!1,a.a.Error,{storageId:u,invokedBy:r,ErrorText:Object(i.a)(e.t0)},e.t0),e.t0;case 14:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t,r){return e.apply(this,arguments)}}()})}},764:function(e,t,r){"use strict";var n=r(125),a=r(0),i=r.n(a),o=r(1392),s=r(1341),c=r(680),u=r(92),l=r(668),d=r(729),p=r.n(d);t.a=Object(n.c)((function(e){var t=e.dialogProps,r=e.dispatch,n=e.dismiss;return i.a.createElement(o.a,{hidden:!t.isVisible,onDismiss:n,dialogContentProps:{type:t.style,title:t.title,subText:t.subText},modalProps:{isBlocking:t.isBlocking,styles:Object(u.b)()}},i.a.createElement(s.a,null,t.buttons.map((function(e){return i.a.createElement(c.a,{key:e.key,"data-testid":e.key,text:e.text,onClick:function(){e.lambda&&e.lambda(),Array.isArray(e.action)?e.action.forEach((function(e){return r(e)})):r(e.action),p()(e.action,l.a.dialog.dismiss())||r(l.a.dialog.dismiss())},primary:e.isPrimary})}))))}))},765:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return c}));var n,a,i=r(64),o=r(39);function s(e,t){return{sourcePane:Object(i.b)(),targetPane:e,payload:t}}function c(e){Object(o.d)((function(t){t.targetPane===Object(i.b)()&&e(t)}))}!function(e){e[e.Request=0]="Request",e[e.Success=1]="Success",e[e.Error=2]="Error"}(n||(n={})),function(e){e[e.RecorderHeartbeat=0]="RecorderHeartbeat"}(a||(a={}))},778:function(e,t,r){"use strict";function n(e){if(e){var t=e.storageScript.apiInfo;if(t){var r=JSON.parse(t).variantVersion;if(void 0!==r&&"number"===typeof(n=r)&&Number.isInteger(n)&&n>=0)return r}}var n;return 0}r.d(t,"a",(function(){return c}));var a=r(755);function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function s(e){o(i,n,a,s,c,"next",e)}function c(e){o(i,n,a,s,c,"throw",e)}s(void 0)}))}}function c(e){return u.apply(this,arguments)}function u(){return(u=s(regeneratorRuntime.mark((function e(t){var r,o,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n(t),o=r>=1,s=r>=1,c=r>=2,e.next=6,Object(a.a)();case 6:return u=e.sent,l=i({},{enableNoImplicitAny:o,enableNoIdentifiersPassedToArrayMethodCallbacks:s,enableNoImplicitAnyAssignment:c},u),e.abrupt("return",l);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},779:function(e,t,r){"use strict";var n=r(125),a=r(0),i=r.n(a),o=r(1391),s=r(683),c=r(1340),u=r(706);function l(){var e=function(e,t){t||(t=e.slice(0));return e.raw=t,e}(["\n margin: ",";\n margin-bottom: ",";\n"]);return l=function(){return e},e}var d=Object(n.c)((function(e){return i.a.createElement(p,{"data-testid":e["data-testid"]},i.a.createElement(c.a,{styles:{root:{fontWeight:e.theme.fontWeights.semibold,fontSize:e.theme.fontSizes.small}}},e.label),e.children)})),p=n.b.div(l(),(function(e){return e.theme.spacing.small}),(function(e){return e.theme.spacing.medium})),f=(t.a=Object(n.c)((function(e){return i.a.createElement(d,{label:e.settingTitle},i.a.createElement(u.a,{when:!!e.description},i.a.createElement(c.a,null,e.description)),i.a.createElement(o.a,{"data-testid":e["data-testid"],ariaLabel:strings.substitute(strings.Editor.SettingsDropdownAriaLabel,{settingTitle:e.settingTitle}),selectedKey:f(e.settingTitle,e.currentValue),onChange:function(t,r){return r&&e.onChange(r.data)},options:e.possibleValues.map((function(t){return{key:f(e.settingTitle,t),text:e.displayValues&&e.displayValues[t]?e.displayValues[t]:t,data:t}})),responsiveMode:s.a.large,styles:g(e.theme)}))})),function(e,t){return e+"_"+t+"_key"}),g=function(e){return{dropdown:{fontSize:e.fontSizes.small,selectors:{"&:focus:after":{borderWidth:"1.5px"}}},dropdownItem:{fontSize:e.fontSizes.small},dropdownItemSelected:{fontSize:e.fontSizes.small}}}},780:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(797),a=r(102),i=r.n(a),o=r(173);function s(){var e={variant:o.a,variantVersion:1};return JSON.stringify(e)}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var u=function(e){var t=c({},l(),e);return{storageScript:t,localUpdates:{dateLastModified:Date.now(),body:t.body,parameterInfo:t.parameterInfo}}},l=function(){return{id:i()(),name:strings.Editor.NewScriptNameText,body:n.newScriptBody,description:"",apiInfo:s(),isCreator:!0}}},783:function(e,t,r){var n=r(673),a=r(965),i=r(966),o=Math.max,s=Math.min;e.exports=function(e,t,r){var c,u,l,d,p,f,g=0,m=!1,h=!1,b=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var r=c,n=u;return c=u=void 0,g=t,d=e.apply(n,r)}function S(e){return g=e,p=setTimeout(O,t),m?v(e):d}function y(e){var r=e-f;return void 0===f||r>=t||r<0||h&&e-g>=l}function O(){var e=a();if(y(e))return x(e);p=setTimeout(O,function(e){var r=t-(e-f);return h?s(r,l-(e-g)):r}(e))}function x(e){return p=void 0,b&&c?v(e):(c=u=void 0,d)}function j(){var e=a(),r=y(e);if(c=arguments,u=this,f=e,r){if(void 0===p)return S(f);if(h)return clearTimeout(p),p=setTimeout(O,t),v(f)}return void 0===p&&(p=setTimeout(O,t)),d}return t=i(t)||0,n(r)&&(m=!!r.leading,l=(h="maxWait"in r)?o(i(r.maxWait)||0,t):l,b="trailing"in r?!!r.trailing:b),j.cancel=function(){void 0!==p&&clearTimeout(p),g=0,c=f=u=p=void 0},j.flush=function(){return void 0===p?d:x(a())},j}},794:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(39),a=function(e){var t=Object(n.b)("wacFlights");return!!(t?JSON.parse(t):{})[e]}},795:function(e,t,r){"use strict";var n=r(649),a=r(640),i=r(641);t.a=Object(n.combineReducers)({active:function(e,t){switch(void 0===e&&(e=null),t.type){case Object(a.getType)(i.g.setActive):return t.payload.id;default:return e}},isLoading:function(e,t){switch(void 0===e&&(e=!0),t.type){case Object(a.getType)(i.g.monacoInitialized):return!1;default:return e}},isDetailsPageVisible:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(a.getType)(i.g.showDetailsPage):return!0;case Object(a.getType)(i.g.hideDetailsPage):return!1;default:return e}},externalContentUpdateCounter:function(e,t){switch(void 0===e&&(e=0),t.type){case Object(a.getType)(i.g.contentExternallyUpdated):return++e;default:return e}},navigationSourcePage:function(e,t){switch(void 0===e&&(e=""),t.type){case Object(a.getType)(i.g.setNavigationSourcePage):return t.payload;default:return e}},isMakingACopy:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(a.getType)(i.g.setIsMakingACopy):return t.payload;default:return e}},isEditingScriptName:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(a.getType)(i.g.setIsEditingScriptName):return t.payload;default:return e}},mostRecentRecorderHeartbeatReceived:function(e,t){switch(void 0===e&&(e=0),t.type){case Object(a.getType)(i.h.sendRecorderHeartbeat):return e>=0?Date.now():e;default:return e}},detailsNavigateSource:function(e,t){switch(void 0===e&&(e=null),t.type){case Object(a.getType)(i.g.setDetailsNavigateSource):return t.payload;default:return e}}})},796:function(e,t,r){"use strict";var n=r(649),a=r(640),i=r(695);t.a=Object(n.combineReducers)({isRunning:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(a.getType)(i.start):return!0;case Object(a.getType)(i.success):case Object(a.getType)(i.failure):case Object(a.getType)(i.cancel):return!1;default:return e}}})},797:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.newScriptBody=void 0,t.newScriptBody="function main(workbook: ExcelScript.Workbook) {\n // Your code here\n}"},798:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function a(e){return n({},e.storageScript,{shareId:e.localUpdates.shareId})}r.d(t,"a",(function(){return a}))},799:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RuntimeManager=t.RuntimeState=void 0;var n=r(701);Object.defineProperty(t,"RuntimeState",{enumerable:!0,get:function(){return n.RuntimeState}});var a=r(800);Object.defineProperty(t,"RuntimeManager",{enumerable:!0,get:function(){return a.RuntimeManager}})},800:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{c(n.next(e))}catch(t){i(t)}}function s(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(s){i=[6,s],n=0}finally{r=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RuntimeManager=void 0;var s=o(r(732)),c=r(701),u=r(801),l=o(r(733)),d=function(){function e(e){var t=this;this._timingData={},this._defaultManagerConfig={runtimeConsole:{log:function(e){},info:function(e){},warn:function(e){},error:function(e){}}},this.getRuntimeIds=function(){return t._runtimeMap.keys()},this._configuration=n(n({},this._defaultManagerConfig),e),this._runtimeMap=new s.default,this._terminatedScriptId=null,l.default()&&r(875)}return e.prototype.executeScript=function(e,t){return void 0===t&&(t={}),a(this,void 0,void 0,(function(){var r=this;return i(this,(function(n){return[2,new Promise((function(n,o){return a(r,void 0,void 0,(function(){var r,a,s,c;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),[4,this.getOrCreateRuntime(e,t)];case 1:return(r=i.sent()).getId()!==this._terminatedScriptId?[3,2]:(this._terminatedScriptId=null,n(!1),[3,4]);case 2:return[4,r.executeFunction(e.functionName,e.functionArgs,t.options)];case 3:a=i.sent(),s=r.getTimingData(),this._timingData[e.scriptId]=s,n(a),i.label=4;case 4:return[3,6];case 5:return c=i.sent(),o(c),[3,6];case 6:return[2]}}))}))}))]}))}))},e.prototype.getTimingData=function(e){var t=this._timingData[e];if(!t)throw new Error("No data for requested id "+e);return t},e.prototype.getOrCreateRuntime=function(e,t){return a(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return this._runtimeMap.keyExists(e.scriptId)?(r=this._runtimeMap.read(e.scriptId)).getLastUpdatedTime()===e.lastUpdatedTime?[2,r]:[4,this.terminateRuntime(e.scriptId)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,this.createNewRuntime(e,t)];case 3:return[2,n.sent()]}}))}))},e.prototype.createNewRuntime=function(e,t){return a(this,void 0,void 0,(function(){var r,n;return i(this,(function(a){switch(a.label){case 0:return r={managerConfiguration:this._configuration,runtimeConfiguration:t},[4,u.createRuntime(e,r)];case 1:return n=a.sent(),this._runtimeMap.create(e.scriptId,n),[2,n]}}))}))},e.prototype.terminateRuntime=function(e){return a(this,void 0,void 0,(function(){var t=this;return i(this,(function(r){return[2,new Promise((function(r){return a(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._runtimeMap.keyExists(e)?[4,this._runtimeMap.read(e).terminate()]:[3,2];case 1:return t.sent(),this._runtimeMap.delete(e),[2,r(!0)];case 2:return this._terminatedScriptId=e,[2,r(!1)]}}))}))}))]}))}))},e.prototype.terminateAll=function(){return a(this,void 0,void 0,(function(){var e=this;return i(this,(function(t){return[2,new Promise((function(t){return a(e,void 0,void 0,(function(){var e=this;return i(this,(function(r){switch(r.label){case 0:return[4,Promise.all(this.getRuntimeIds().map((function(t){return a(e,void 0,void 0,(function(){return i(this,(function(e){return[2,this.terminateRuntime(t)]}))}))})))];case 1:return r.sent(),t(),[2]}}))}))}))]}))}))},e.prototype.getState=function(e){return a(this,void 0,void 0,(function(){var t=this;return i(this,(function(r){return[2,new Promise((function(r){return t._runtimeMap.keyExists(e)?r(t._runtimeMap.read(e).getState()):r(c.RuntimeState.NonExisting)}))]}))}))},e}();t.RuntimeManager=d},801:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{c(n.next(e))}catch(t){i(t)}}function s(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(s){i=[6,s],n=0}finally{r=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createRuntime=void 0;var o=i(r(802));t.createRuntime=function(e,t){return n(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return Office.context.host!==Office.HostType.Excel?[3,4]:Office.context.platform!==Office.PlatformType.OfficeOnline?[3,2]:[4,o.default.createRuntimeInstance(e,t)];case 1:return[2,r.sent()];case 2:return Office.context.platform,Office.PlatformType.PC,Office.context.platform,Office.PlatformType.Mac,[4,o.default.createRuntimeInstance(e,t)];case 3:return[2,r.sent()];case 4:throw new Error("Runtime not implemented for host '"+Office.context.host+"' on platform '"+Office.context.platform+"'")}}))}))}},802:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{c(n.next(e))}catch(t){i(t)}}function s(e){try{c(n.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(s){i=[6,s],n=0}finally{r=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(r(803)),s=i(r(732)),c=r(701),u=r(102),l=i(r(733)),d=function(){function e(e,t,n){this.invocationConfiguration=n,this._timingData={created:0,iframeLoaded:0,codeLoaded:0,executeStarted:0,executeFinished:0,syncStarted:0,syncFinished:0,syncsOutstanding:0,syncTime:0,syncsPerformed:0},l.default()&&r(874),this._timingData.created=Date.now(),this._state=c.RuntimeState.Ready,this._messageHandler=this.handleMessage.bind(this),window.addEventListener("message",this._messageHandler,!1),this._callbackList=new s.default,this._id=e,this._sequenceId=0,this._creationTime=Date.now(),this._origin=new URL(n.managerConfiguration.serviceUrl),this._origin.host=u.v4()+"."+this._origin.host,this._runtimeConsole=n.managerConfiguration.runtimeConsole,this._lastUpdatedTime=t,this._iframe=document.createElement("iframe"),this._iframe.setAttribute("id",e),this._iframe.src=this._origin.href,this._iframe.style.display="none"}return e.createRuntimeInstance=function(t,r){return n(this,void 0,void 0,(function(){return a(this,(function(n){return[2,new Promise((function(n,a){var i=new e(t.scriptId,t.lastUpdatedTime,r);i._callbackList.create(++i._sequenceId,{resolve:n,reject:a}),i._iframe.onload=function(){var e,n,a;i._timingData.iframeLoaded=Date.now();var o=null===(n=null===(e=r.runtimeConfiguration)||void 0===e?void 0:e.options)||void 0===n?void 0:n.officeJsUrl;o&&(a=o);var s={scriptId:i._id,sequenceId:i._sequenceId,eventType:"loadScriptCode",scriptCode:t.scriptCode,officeJsUrl:a,options:r.runtimeConfiguration.options};i._iframe.contentWindow.postMessage(s,i._origin.href)},document.body.appendChild(i._iframe)}))]}))}))},e.prototype.getId=function(){return this._id},e.prototype.getCreationTime=function(){return this._creationTime},e.prototype.getLastUpdatedTime=function(){return this._lastUpdatedTime},e.prototype.getTimingData=function(){return{runCompleted:this._state===c.RuntimeState.Ready,iframeLoadTime:this._timingData.iframeLoaded-this._timingData.created,codeLoadTime:this._timingData.codeLoaded-this._timingData.iframeLoaded,syncsPerformed:this._timingData.syncsPerformed,syncTime:this._timingData.syncTime,executeTime:this._timingData.executeFinished-this._timingData.executeStarted}},e.prototype.getState=function(){return n(this,void 0,void 0,(function(){var e=this;return a(this,(function(t){return[2,new Promise((function(t){t(e._state)}))]}))}))},e.prototype.executeFunction=function(e,t,r){return n(this,void 0,void 0,(function(){var n=this;return a(this,(function(a){return[2,new Promise((function(a,i){n._timingData.executeStarted=Date.now(),n._timingData.syncsPerformed=0,n._timingData.syncTime=0,n._timingData.syncsOutstanding=0,o.default.True(null!=n._iframe.parentNode,"invalid iframe, no parent node found"),o.default.True(null!=n._iframe.contentWindow,"invalid iframe, no content window found"),n._callbackList.create(++n._sequenceId,{resolve:a,reject:i}),n._state=c.RuntimeState.Executing;var s={scriptId:n._id,sequenceId:n._sequenceId,eventType:"execute",functionName:e,functionArgs:t,options:r};n.invocationConfiguration.managerConfiguration.skipWrappingInRunFunction&&(s.skipWrappingInRunFunction=!0),n._iframe.contentWindow.postMessage(s,n._origin.href)}))]}))}))},e.prototype.handleMessage=function(e){var t=this;if(0===this._origin.href.indexOf(e.origin)&&e.data.scriptId===this._id&&e.source===this._iframe.contentWindow){var r=e.data.eventType;if("scriptCodeLoaded"===r&&(this._timingData.codeLoaded=Date.now(),this.handlePromiseResolving(e,this)),"executionFinished"===r&&(this._timingData.executeFinished=Date.now(),this.handlePromiseResolving(e,e.data.message.result),this._state=c.RuntimeState.Ready),"officeJsMessage"===r){0===this._timingData.syncsOutstanding&&(this._timingData.syncStarted=Date.now()),this._timingData.syncsOutstanding++;var n=e.data;this.invocationConfiguration.runtimeConfiguration.options&&this.invocationConfiguration.runtimeConfiguration.options.ignoreMakerSafe||(n.message[6]|=1024),OSF.DDA.RichApi.executeRichApiRequestAsync(n.message,(function(r){if(t._timingData.syncsPerformed++,t._timingData.syncsOutstanding--,0===t._timingData.syncsOutstanding&&(t._timingData.syncTime+=Date.now()-t._timingData.syncStarted),t._iframe.parentNode&&t._iframe.contentWindow){var a={scriptId:n.scriptId,eventType:"officeJsMessageResponse",sequenceId:n.sequenceId,result:r};t._iframe.contentWindow.postMessage(a,e.origin)}else t.completeAllPromises(!1)}))}if("consoleLog"===r){var a=e.data;this._runtimeConsole&&this._runtimeConsole[a.logType](a.scriptId,a.consoleArgs)}}},e.prototype.handlePromiseResolving=function(e,t){var r=e.data,n=this._callbackList.read(r.sequenceId);this._callbackList.delete(r.sequenceId),"Success"===r.message.status?(this._state=c.RuntimeState.Ready,n.resolve(t)):(this._state=c.RuntimeState.Ready,n.reject(e))},e.prototype.terminate=function(){return n(this,void 0,void 0,(function(){return a(this,(function(e){return this.completeAllPromises(!1),window.removeEventListener("message",this._messageHandler),this._iframe.parentNode&&this._iframe.parentNode.removeChild(this._iframe),[2]}))}))},e.prototype.completeAllPromises=function(e){var t=this;this._callbackList.keys().forEach((function(e){var r=t._callbackList.read(e);t._callbackList.delete(e),r.resolve(!1)}))},e}();t.default=d},803:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.Equals=function(e,t){if(e!==t)throw new Error(JSON.stringify(e)+" does not match expected "+JSON.stringify(t))},e.True=function(e,t){if(!e)throw new Error("Bad program state. "+(t||""))},e.Truthy=function(e,t){if(!e)throw new Error("Bad program state. "+(t||""))},e}();t.default=n},804:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(3),a=r(175);function i(e){e.fails.authFailures>0?(Object(n.g)(new Error("Terminated with auth failure"),"Unexpected",n.a.Warning),Object(a.b)()):e.fails.disabledFailures>0&&(Object(n.g)(new Error("Terminated with platform disabled"),"Unexpected",n.a.Warning),Object(a.a)())}},831:function(e,t,r){"use strict";r.d(t,"a",(function(){return ie}));var n=r(664),a=r(640),i=r(799),o=r(641),s=r(643),c=r(726),u=r(170),l=r(3);function d(e,t){return"Line #"+e+": "+t}var p=r(665);function f(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function g(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){f(i,n,a,o,s,"next",e)}function s(e){f(i,n,a,o,s,"throw",e)}o(void 0)}))}}function m(e){return h.apply(this,arguments)}function h(){return(h=g(regeneratorRuntime.mark((function e(t){var n,a,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(p.a)("typescript",(function(){return r.e(1).then(r.t.bind(null,637,7))}));case 2:if(n=e.sent,!(a=n.transpileModule(t,{reportDiagnostics:!0,compilerOptions:{target:n.ScriptTarget.ES5,allowJs:!0,lib:["dom","es2015"]}})).diagnostics.length){e.next=7;break}return i=a.diagnostics.map((function(e){var r=t.substr(0,e.start),n=t.substr(e.start+1),a=r.split("\n").length,i=r.lastIndexOf("\n"),o=t.substring(i,e.start+Math.max(n.indexOf("\n"),0)).trim();return d(a,e.messageText+"\n "+o)})).join("\n\n"),e.abrupt("return",{compileErrorMessage:i});case 7:return o=a.outputText.replace('Object.defineProperty(exports, "__esModule", { value: true });',""),e.abrupt("return",{outputText:o});case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function v(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){b(i,n,a,o,s,"next",e)}function s(e){b(i,n,a,o,s,"throw",e)}o(void 0)}))}}function S(e){return y.apply(this,arguments)}function y(){return(y=v(regeneratorRuntime.mark((function e(t){var r,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m(t);case 2:if(r=e.sent,n=r.compileErrorMessage,a=r.outputText,!n){e.next=7;break}throw new SyntaxError(n);case 7:if(!a){e.next=9;break}return e.abrupt("return",a);case 9:throw new SyntaxError("No Code");case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=r(41);function x(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function j(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){x(i,n,a,o,s,"next",e)}function s(e){x(i,n,a,o,s,"throw",e)}o(void 0)}))}}function w(){return E.apply(this,arguments)}function E(){return(E=j(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(p.a)("office.script.sync",(function(){return Promise.all([r.e(7),r.e(6),r.e(23),r.e(1),r.e(14)]).then(r.bind(null,1388))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e,t){var r=!1,n=!0,a=[],i={},o=new l.b("ScanScript","System");try{var s=e(t),c=s.requiredSets;i=s.performanceMetrics;var u=function(e){return e.map((function(e){var t=e.name,r=e.version;return{name:t,version:r,supported:Office.context.requirements.isSetSupported(t,r)}}))}(c);a.push.apply(a,u),n=!a.some((function(e){return"undefined"===e.name})),r=u.every((function(e){return e.supported}))}catch(d){return logger.log("[Office Script] Scanner - Error: "+JSON.stringify(d)),Object(l.g)(d,"Unexpected",l.a.Warning),o.end(!1,l.a.Information,{allSetsDefined:n,performanceMetrics:C(i),ErrorText:Object(O.a)(d)}),r}return o.end(n,l.a.Information,{allSetsDefined:n,performanceMetrics:C(i)}),logger.log("[Office Script] Scanner - Sets: "+a.map((function(e){return e.name+" "+e.version+" "+e.supported})).join(", ")),n||logger.log("[Office Script] Scanner - undefined set present"),r&&logger.log("[Office Script] Scanner - allSupported ["+r+"]"),r}function C(e){return{createProgramMilliseconds:e.createProgramMilliseconds,createCheckerMilliseconds:e.createCheckerMilliseconds,scanMilliseconds:e.scanMilliseconds}}var _=r(48);function R(){return(R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function P(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function T(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){P(i,n,a,o,s,"next",e)}function s(e){P(i,n,a,o,s,"throw",e)}o(void 0)}))}}function I(e,t,r){return D.apply(this,arguments)}function D(){return(D=T(regeneratorRuntime.mark((function e(t,r,n){var a,i,o,s,c,u,d,p,f,g,h,b,v,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w();case 2:if(a=e.sent,Object(_.a)("OfficeScriptScanner"))try{k(a.scanCode,t)}catch(y){Object(l.g)(y,"Unexpected",l.a.Warning),logger.log("[Office Script] isScriptSupported - Error: "+JSON.stringify(y))}return i=new l.b("TransformScript","System"),o={storageId:r.storageScript.id},e.prev=7,e.next=10,a.transformSynchronousCodeForBatchExecution(t,m,R({logger:logger},n));case 10:s=e.sent,e.next=18;break;case 13:throw e.prev=13,e.t0=e.catch(7),logger.log("[Office Script] ERROR: "+e.t0),i.end(!1,l.a.Error,R({},o,{ErrorText:Object(O.a)(e.t0),message:"Office Script unexpected transform error"})),e.t0;case 18:if(u=(c=s).syntaxErrorMessage,d=c.linterErrorMessage,p=c.transpilerErrorMessage,f=c.compileErrorMessage,g=c.outputText,h=c.transpilerStats,b=c.linterStats,v=c.failureStage,S=!u&&!d&&!p&&!f&&void 0!==g,i.end(S,l.a.Information,R({transpileTime:null==h?void 0:h.transpileTime,lintTime:null==b?void 0:b.lintTime,failureStage:v},o)),!u){e.next=24;break}throw logger.log("[Office Script] syntax error"),new SyntaxError(u);case 24:if(!d){e.next=27;break}throw logger.log("[Office Script] lint error"),new SyntaxError(d);case 27:if(!p){e.next=30;break}throw logger.log("[Office Script] transpile error"),new SyntaxError("Error Transpiling Code");case 30:if(!f){e.next=33;break}throw logger.log("[Office Script] compile error"),new SyntaxError(f);case 33:if(!g){e.next=36;break}return logger.log("[Office Script] output text"),e.abrupt("return",g);case 36:throw logger.log("[Office Script] no code"),new SyntaxError("No Code");case 38:case"end":return e.stop()}}),e,null,[[7,13]])})))).apply(this,arguments)}function A(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function M(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){A(i,n,a,o,s,"next",e)}function s(e){A(i,n,a,o,s,"throw",e)}o(void 0)}))}}function N(e,t,r){return L.apply(this,arguments)}function L(){return(L=M(regeneratorRuntime.mark((function e(t,r,n){var a,i,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a="",i=Object(u.a)(r),o=new l.b("CompileScript","System"),s={apiInfo:r.storageScript.apiInfo,storageId:r.storageScript.id},e.prev=4,!i){e.next=11;break}return e.next=8,I(t,r,n);case 8:e.t0=e.sent,e.next=14;break;case 11:return e.next=13,S(t);case 13:e.t0=e.sent;case 14:a=e.t0,o.end(!0,l.a.Information,s),e.next=22;break;case 18:throw e.prev=18,e.t1=e.catch(4),o.end(!1,l.a.Information,s),e.t1;case 22:return e.abrupt("return",a);case 23:case"end":return e.stop()}}),e,null,[[4,18]])})))).apply(this,arguments)}var B,F=r(871),W=r(681),U=r(739),H=r(168),z=function(e){return Object(H.a)(["log","info","warn","error"]).reduce((function(t,r){return t[r]=function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];return e(r,a)},t}),{})},G=0,V=function(e){return function(t,r){var n=r[0].map((function(e){return{id:(++G).toString(),message:e,severity:t}}));e(n)}},K=r(128),q=r(679),J=r(656),Q=r(778),Z=r(717),Y=r(738),X=regeneratorRuntime.mark(ie),$=regeneratorRuntime.mark(se),ee=regeneratorRuntime.mark(ce),te=regeneratorRuntime.mark(ue),re=regeneratorRuntime.mark(de),ne=regeneratorRuntime.mark(pe),ae=regeneratorRuntime.mark(fe);function ie(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(n.g)(se);case 2:return e.next=4,Object(n.l)(Object(a.getType)(o.k.request),ue);case 4:return e.next=6,Object(n.m)(Object(a.getType)(o.k.start),ce);case 6:return e.next=8,Object(n.l)(Object(a.getType)(o.k.failure),fe);case 8:return e.next=10,Object(n.l)(Object(a.getType)(o.k.success),pe);case 10:case"end":return e.stop()}}),X)}var oe=0;function se(){var e,t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e=Object(U.b)((function(e){var t=V(e);return B=new i.RuntimeManager({runtimeConsole:z(t),serviceUrl:Object(c.d)()}),function(){return null}}));case 1:return r.next=4,Object(n.k)(e);case 4:return t=r.sent,r.next=7,Object(n.h)(o.c.addOutputLogs(t));case 7:return r.next=9,Object(n.j)(s.f.getIsDetailsPageVisible);case 9:if(r.sent){r.next=15;break}return r.next=13,Object(n.h)(o.c.setCurrentPivot(Y.a.Output));case 13:return r.next=15,Object(n.h)(o.c.show());case 15:r.next=1;break;case 17:case"end":return r.stop()}}),$)}function ce(e){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(n.g)(de,e);case 2:return t=r.sent,r.next=5,Object(n.k)(Object(a.getType)(o.k.cancel));case 5:return r.next=7,Object(n.c)(t);case 7:case"end":return r.stop()}}),ee)}function ue(e){var t,r,i,c,u,d,p;return regeneratorRuntime.wrap((function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,Object(n.j)(s.j.get,e.payload.script.storageScript.id);case 2:if(t=f.sent){f.next=5;break}throw new Error("Trying to run a script that does not exist in the state!");case 5:if(!Object(K.a)(t.localUpdates.body)){f.next=9;break}return r=new Error("Trying to run a script that does not have a body."),Object(l.g)(r,"Unexpected",l.a.Error),f.abrupt("return");case 9:return i=Object(J.a)(t),f.next=12,Object(n.j)(s.j.getIsConsented,t.storageScript.id);case 12:if(c=f.sent,!(i||Object(q.a)(t)||c)){f.next=18;break}return f.next=16,Object(n.h)(o.k.start({script:t,version:e.payload.version,entryPoint:e.payload.entryPoint}));case 16:f.next=31;break;case 18:return f.next=20,Object(n.h)(o.d.show());case 20:return u=new l.b("ConsentToRun","User",6e4),f.next=23,Object(n.i)({accepted:Object(n.k)(Object(a.getType)(o.m.acceptConsent.success)),denied:Object(n.k)(Object(a.getType)(o.m.denyConsent.success))});case 23:if(d=f.sent,p=d.accepted,d.denied,u.end(!0,l.a.Information,{accepted:!!p,storageId:t.storageScript.id}),!p){f.next=30;break}return f.next=30,Object(n.h)(o.k.start({script:t,version:e.payload.version,entryPoint:e.payload.entryPoint}));case 30:case 31:case"end":return f.stop()}}),te)}function le(){return w()}function de(e){var t,r,a,i,u,d,p,f,g,m,h,b,v,S,y,O,x,j,w;return regeneratorRuntime.wrap((function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,Object(n.h)(o.c.clearOutputLogs());case 2:if(t=e.payload.script){E.next=5;break}throw new Error("Trying to run without a selected script!");case 5:if(r=function(){switch(e.payload.version){case"lastModified":return t.localUpdates.body;case"lastPublished":return t.storageScript.body;default:return null}}()){E.next=8;break}throw new Error("Trying to run a script that doesn't have a body");case 8:return a=!0,i="",u=Object(J.a)(t),d=new l.b("RunScript","User"),E.prev=12,E.next=15,Object(n.b)(Q.a,t);case 15:return p=E.sent,f=p,E.next=19,Object(n.b)(N,r,t,f);case 19:return g=E.sent,m=Date.now(),E.next=23,Object(n.h)(o.i.show({isBlocking:!0,forceSingleLine:!0,text:strings.Message.ScriptRunning,buttons:[{isPrimary:!0,text:strings.General.StopButtonText,actions:[o.k.cancel()]}]}));case 23:return h={scriptId:t.storageScript.id,scriptCode:g,functionName:c.a,functionArgs:[],lastUpdatedTime:m},"https://appsforoffice.microsoft.com/lib/beta/hosted/excel-web-16.00.js",b={options:{officeJsUrl:p.officeJsOverride||"https://appsforoffice.microsoft.com/lib/beta/hosted/excel-web-16.00.js"}},E.next=28,Object(n.b)([B,"executeScript"],h,b);case 28:return v=E.sent,E.next=31,Object(n.h)(o.k.success({script:t,startTime:m,result:v}));case 31:E.next=45;break;case 33:return E.prev=33,E.t0=E.catch(12),E.next=37,Object(n.b)(le);case 37:return S=E.sent,a=!1,y=E.t0 instanceof SyntaxError?E.t0:E.t0.data&&E.t0.data.message&&E.t0.data.message.error,O=S.formatErrorMessage(y),y&&(x=y.code)&&S.isUnexpectedBatchErrorCodeInSynchronousExecution(x)&&(i=x),"Unexpected strict mode reserved word"===O&&(i="UnexpectedReservedWord"),E.next=45,Object(n.h)(o.k.failure({errorMessage:O,script:t}));case 45:E.prev=45;try{j=B.getTimingData(t.storageScript.id)}catch(k){}return E.t1=Z.a,E.next=50,Object(n.j)(s.f.getMostRecentRecorderHeartbeatReceived);case 50:return E.t2=E.sent,w=(0,E.t1)(E.t2),d.endForExperiment(a,l.a.Information,{storageId:t.storageScript.id,stats:j,success:a,entryPoint:e.payload.entryPoint,isOwner:u,apiInfo:t.storageScript.apiInfo,unexpectedBatchErrorInSyncCode:i,hasDescription:!!t.storageScript.description,isDraft:r!==t.storageScript.body,isRecording:w}),E.next=55,Object(n.b)([B,"terminateRuntime"],t.storageScript.id);case 55:return E.next=57,Object(n.d)();case 57:if(!E.sent){E.next=60;break}return E.next=60,Object(n.h)(o.i.dismiss());case 60:return E.finish(45);case 61:case"end":return E.stop()}}),re,null,[[12,33,45,61]])}function pe(e){var t,r;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(t=e.payload.startTime,!((r=Date.now()-t)<c.b)){a.next=5;break}return a.next=5,Object(n.f)(c.b-r);case 5:return a.next=7,Object(n.h)(o.i.dismiss());case 7:case"end":return a.stop()}}),ne)}function fe(e){var t,r,a,i,c;return regeneratorRuntime.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return t=e.payload.errorMessage||strings.Message.UnexpectedError,r={id:""+oe++,message:t,severity:W.a.Error},u.next=4,Object(n.h)(o.c.addOutputLogs([r]));case 4:return u.next=6,Object(n.j)(s.f.getIsDetailsPageVisible);case 6:if(a=u.sent){u.next=12;break}return u.next=10,Object(n.h)(o.c.setCurrentPivot(Y.a.Output));case 10:return u.next=12,Object(n.h)(o.c.show());case 12:return u.next=14,Object(n.j)(s.c.getIsVisible);case 14:return i=u.sent,c=i&&!a,u.next=18,Object(n.h)(o.i.show({style:F.a.error,forceSingleLine:!0,text:strings.Message.ScriptRanWithErrorsError,buttons:c?[]:[{isPrimary:!0,text:strings.General.ViewLogs,actions:[o.c.setCurrentPivot(Y.a.Output),o.c.show()]}]}));case 18:case"end":return u.stop()}}),ae)}},833:function(e,t,r){"use strict";var n=r(650),a=r(0),i=r(1392),o=r(1341),s=r(869),c=r(1381),u=r(1339),l=r(92),d=r(125),p=Object(d.c)((function(e){var t=e.theme,r=e.isOpen,n=e.acceptFn,s=e.cancelFn,d=e.hideAuthDialog;return a.createElement(i.a,{hidden:!r,onDismiss:d,dialogContentProps:f(t),modalProps:{isBlocking:!0,styles:Object(l.b)()}},a.createElement(o.a,null,a.createElement(c.a,{onClick:function(){n(),d()},text:strings.Dialog.AuthRetryRefreshButton}),a.createElement(u.a,{onClick:function(){s(new Error("User cancelled final auth attempt")),d()},text:strings.General.CancelButtonText})))})),f=function(e){return{type:s.a.normal,title:strings.Dialog.AuthRetryTitle,styles:{title:{fontSize:e.fontSizes.large,fontWeight:e.fontWeights.semibold,color:e.colors.primary},subText:{color:e.colors.neutralPrimary}},closeButtonAriaLabel:strings.General.CloseButtonLabel,subText:strings.Dialog.AuthRetrySubtext}},g=r(663),m=r(669);t.a=Object(n.b)((function(e){return{isOpen:m.a.authDialog.getIsVisible(e),acceptFn:m.a.authDialog.getAcceptFn(e),cancelFn:m.a.authDialog.getCancelFn(e)}}),(function(e){return{dispatch:e,hideAuthDialog:function(){return e(g.a.authDialog.hide())}}}))(p)},834:function(e,t,r){"use strict";var n=r(649),a=r(640),i=r(696),o=r(3),s=r(730),c=r(731);function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var l={};t.a=Object(n.combineReducers)({scripts:function(e,t){switch(void 0===e&&(e=l),t.type){case Object(a.getType)(i.fetchScriptsFromDocument.success):return p(u({},e),t.payload.scripts,!0);case Object(a.getType)(i.mergeMetadataFromRibbon):return d(u({},e),t.payload.scripts,"Ribbon"),p(u({},e),t.payload.scripts);case Object(a.getType)(i.mergeSharedMetadataFromRibbon):return p(u({},e),t.payload.scripts,!0);case Object(a.getType)(i.fetchMetadataFromStorage.success):return d(u({},e),t.payload.scripts,"Service"),p(u({},e),t.payload.scripts);case Object(a.getType)(i.fetchSamples.success):return p(u({},e),t.payload.scripts,!0);case Object(a.getType)(i.update):return f(u({},e),t.payload);case Object(a.getType)(i.remove.request):var r=u({},e);return delete r[t.payload.storageScript.id],r;case Object(a.getType)(i.remove.success):var n=u({},e);return delete n[t.payload.script.storageScript.id],n;case Object(a.getType)(i.remove.failure):return f(u({},e),t.payload.fallbackValue);default:return e}},hasLoadedAttachedScripts:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(a.getType)(i.fetchScriptsFromDocument.success):case Object(a.getType)(i.fetchScriptsFromDocument.failure):case Object(a.getType)(i.mergeSharedMetadataFromRibbon):return!0;default:return e}},hasReceivedMetadata:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(a.getType)(i.publishedScriptMetadataReceived):return!0;default:return e}},scriptsSavingStatus:function(e,t){switch(void 0===e&&(e={}),t.type){case Object(a.getType)(i.updateSavingStatus):var r=u({},e);return r[t.payload.id]=t.payload.status,r;default:return e}},scriptsAttachingStatus:function(e,t){switch(void 0===e&&(e={}),t.type){case Object(a.getType)(i.updateAttachingStatus):var r=u({},e);return r[t.payload.id]=t.payload.status,r;default:return e}},scriptsIsStorageCallInProgress:function(e,t){switch(void 0===e&&(e={}),t.type){case Object(a.getType)(i.storageCallInProgress):var r=u({},e);return r[t.payload.id]=!0,r;case Object(a.getType)(i.storageCallComplete):var n=u({},e);return n[t.payload.id]=!1,n;default:return e}},scriptsIsAnyStorageCallInProgress:function(e,t){switch(void 0===e&&(e=!1),t.type){case Object(a.getType)(i.storageCallInProgress):return!0;case Object(a.getType)(i.storageCallComplete):return!1;default:return e}},scriptsIsConsented:function(e,t){switch(void 0===e&&(e={}),t.type){case Object(a.getType)(i.updateConsent):var r=u({},e);return r[t.payload.id]=t.payload.value,r;default:return e}}});function d(e,t,r){var n=function(e,t){var r=t.filter((function(e){return!!e.dateLastPublished})),n=0,a=e.filter((function(e){var t=r.find((function(t){return e.id===t.id}));return!!t&&(n+=e.name===t.name?0:1,!0)})),i=e.length-a.length,o=r.length-a.length;return{sameScripts:a.length,renamed:n,deleted:o,added:i,match:0===o&&0===i&&0===n}}(t.map((function(e){return e.storageScript})),Object.values(e).map((function(e){return e.storageScript})));Object(o.h)({eventName:"LocalMetaCache",eventType:"System",data:u({dataSource:r},n)})}function p(e,t,r){var n=u({},e),a=new Set;return t.forEach((function(t){var r=e[t.storageScript.id],i=Object(c.a)({incomingScript:t,existingScript:r}).selectedScript;e=f(e,i),delete n[t.storageScript.id],t.storageScript.isCreator&&a.add(t.storageScript.name)})),r||Object.values(n).forEach((function(t){Object(o.j)(t,"mergeScriptLists"),t.storageScript.dateLastPublished&&!t.localUpdates.shareId&&delete e[t.storageScript.id],a.has(t.storageScript.name)&&(delete e[t.storageScript.id],Object(s.a)(t.storageScript.id),Object(o.h)({eventName:"DuplicateScriptName",eventType:"System",data:{logLevel:o.a.Debug,storageId:t.storageScript.id}}))})),e}function f(e,t){var r=e[t.storageScript.id];return r?(e[t.storageScript.id]={localUpdates:t.localUpdates,storageScript:u({},t.storageScript,{path:r.storageScript.path})},e):(e[t.storageScript.id]=t,e)}},835:function(e,t,r){"use strict";r.d(t,"a",(function(){return O}));var n=r(32),a=r(665),i=r(6),o=r(3),s=r(684),c=r(80),u=r(167),l=r(41),d=r(715),p=r(762),f=r(57),g=r(678),m=r(22);function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function b(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function v(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){b(i,n,a,o,s,"next",e)}function s(e){b(i,n,a,o,s,"throw",e)}o(void 0)}))}}var S=function(){Object.defineProperty(this,"getScripts",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=v(regeneratorRuntime.mark((function e(){var t,r,n,a,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new o.b("FetchMetadataFromStorage","System"),e.prev=1,r=Object(s.b)(i.getScripts,t,u.e),e.next=5,r;case 5:return n=e.sent,a=n.map((function(e){return Object(c.a)(h({},e,{isCreator:!0}))})),t.end(!0,o.a.Information,{scriptCount:a.length}),e.abrupt("return",a);case 11:throw e.prev=11,e.t0=e.catch(1),d=Object(m.a)(u.e,u.a)(e.t0),t.end(!1,d||Object(u.b)(e.t0)?o.a.Warning:o.a.Error,{ErrorText:Object(l.a)(e.t0)},e.t0),e.t0;case 16:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(){return e.apply(this,arguments)}}()}),Object.defineProperty(this,"saveScript",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=v(regeneratorRuntime.mark((function e(t,r){var n,a,g,b,v,S,y,O,x,j,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new o.b("PublishScript","User"),a=Object(d.a)(t),g=Object.keys(r),b=1===g.length&&"name"===g[0]&&!a,v=1==g.length&&"description"===g[0],e.prev=5,S=Object(p.a)(t,r),y=a||f.b?function(e){return Object(i.saveScript)(S,e)}:b?function(e){return Object(i.updateScriptName)(S,e)}:function(e){return Object(i.updateScriptContents)(S,e)},e.next=10,Object(s.b)(y,n,Object(m.a)(u.g,u.e));case 10:return O=e.sent,x=Object(c.a)(b?h({},O,S):O,{shareId:t.localUpdates.shareId}),n.end(!0,o.a.Information,{draftId:Object(d.a)(t)?t.storageScript.id:void 0,storageId:x.storageScript.id,apiInfo:t.storageScript.apiInfo,isDraft:a,operationType:a?"PublishNew":b?"UpdateName":v?"UpdateDescription":"UpdateContent"}),e.abrupt("return",x);case 16:throw e.prev=16,e.t0=e.catch(5),j=Object(u.e)(e.t0),w=Object(u.g)(e.t0)||Object(u.b)(e.t0)||Object(u.i)(e.t0)||j?o.a.Warning:o.a.Error,n.end(!1,w,{storageId:t.storageScript.id,apiInfo:t.storageScript.apiInfo,isDraft:a,ErrorText:Object(l.a)(e.t0),operationType:a?"PublishNew":b?"UpdateName":v?"UpdateDescription":"UpdateContent"},e.t0),e.t0;case 22:case"end":return e.stop()}}),e,null,[[5,16]])})));return function(t,r){return e.apply(this,arguments)}}()}),Object.defineProperty(this,"getScript",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=v(regeneratorRuntime.mark((function e(t,r){var n,a,d,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new o.b("FetchScriptFromStorage","System"),e.prev=1,e.next=4,Object(s.b)((function(e){return Object(i.getScript)(t,e)}),n,u.f);case 4:return a=e.sent,d=Object(c.a)(h({},a,{isCreator:!0}),{shareId:r}),n.end(!0,o.a.Information,{storageId:t}),e.abrupt("return",d);case 10:throw e.prev=10,e.t0=e.catch(1),p=Object(u.f)(e.t0)||Object(u.b)(e.t0)?o.a.Warning:o.a.Error,n.end(!1,p,{storageId:t,ErrorText:Object(l.a)(e.t0)},e.t0),e.t0;case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,r){return e.apply(this,arguments)}}()}),Object.defineProperty(this,"removeScript",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=v(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new o.b("DeleteScript","User"),e.prev=1,!Object(g.a)(t)){e.next=5;break}return e.next=5,Object(s.b)((function(e){return Object(i.removeScript)(t.storageScript.id,e)}),r,Object(m.a)(u.k,u.o));case 5:return r.end(!0,o.a.Information,{storageId:t.storageScript.id}),e.abrupt("return",t);case 9:if(e.prev=9,e.t0=e.catch(1),n=Object(u.k)(e.t0)?o.a.Information:Object(u.o)(e.t0)||Object(u.b)(e.t0)?o.a.Warning:o.a.Error,r.end(!1,n,{storageId:t.storageScript.id,ErrorText:Object(l.a)(e.t0)}),n!==o.a.Information){e.next=15;break}return e.abrupt("return",t);case 15:throw e.t0;case 16:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(t){return e.apply(this,arguments)}}()})};function y(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}var O=function(){};Object.defineProperty(O,"_instance",{configurable:!0,enumerable:!0,writable:!0,value:void 0}),Object.defineProperty(O,"instance",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e,t=(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!O._instance){e.next=2;break}return e.abrupt("return",O._instance);case 2:e.t0=Object(n.c)(),e.next=e.t0===n.b.makerserviceprodnew||e.t0===n.b.makerserviceint||e.t0===n.b.makerservicetest||e.t0===n.b.makerservicelocal?5:e.t0===n.b.localstorage?6:7;break;case 5:return e.abrupt("return",O._instance=new S);case 6:return e.abrupt("return",Object(a.a)("LocalStorageScript",(function(){return r.e(8).then(r.bind(null,1402))})).then((function(e){return O._instance=new e.LocalStorageScript})));case 7:throw new Error(n.a);case 8:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){y(i,n,a,o,s,"next",e)}function s(e){y(i,n,a,o,s,"throw",e)}o(void 0)}))});return function(){return t.apply(this,arguments)}}()})},836:function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(32),a=r(6),i=r(3),o=r(41),s=r(718),c=r(167),u=r(22),l=r(80),d=r(684),p=r(763);function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function g(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function m(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){g(i,n,a,o,s,"next",e)}function s(e){g(i,n,a,o,s,"throw",e)}o(void 0)}))}}var h=function(){var e=this;Object.defineProperty(this,"_makerStorageWorkbook",{configurable:!0,enumerable:!0,writable:!0,value:new p.a}),Object.defineProperty(this,"fetchAllDocAttachedScripts",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=m(regeneratorRuntime.mark((function t(r){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Promise.all(r.map(function(){var t=m(regeneratorRuntime.mark((function t(r){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getSharedScript(r.shareId,r.storageId).catch((function(){})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())),a=n.then((function(e){return e.filter((function(e){return void 0!==e}))})),t.abrupt("return",a);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}),Object.defineProperty(this,"getSharedScript",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=m(regeneratorRuntime.mark((function t(r,n){var p,g,m,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return p=new i.b("FetchSharedScriptFromStorage","System"),t.prev=1,t.next=4,Object(d.b)((function(e){return Object(a.getSharedScript)(r,e)}),p,Object(u.a)(c.h,c.j));case 4:return g=t.sent,m=f({},Object(l.a)(g,{shareId:r})),p.end(!0,i.a.Information,{storageId:m.storageScript.id,isOwner:m.storageScript.isCreator}),t.abrupt("return",m);case 10:throw t.prev=10,t.t0=t.catch(1),n&&Object(c.a)(t.t0)&&e._makerStorageWorkbook.detachScriptFromWorkbook(Object(s.a)(n,r),"Cleanup").catch((function(){})),h=Object(u.a)(c.a,c.j)(t.t0)?i.a.Information:Object(c.h)(t.t0)||Object(c.b)(t.t0)?i.a.Warning:i.a.Error,p.end(!1,h,{ErrorText:Object(o.a)(t.t0)},t.t0),t.t0;case 16:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e,r){return t.apply(this,arguments)}}()}),Object.defineProperty(this,"shareScript",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new i.b("ShareScript","User"),e.prev=1,e.next=4,Object(d.b)((function(e){return Object(a.shareScript)(t,e)}),r,c.h);case 4:return n=e.sent,r.end(!0,i.a.Information,{storageId:t}),e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(1),r.end(!1,Object(c.h)(e.t0)||Object(c.b)(e.t0)?i.a.Warning:i.a.Error,{storageId:t,ErrorText:Object(o.a)(e.t0)},e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(t){return e.apply(this,arguments)}}()}),Object.defineProperty(this,"unshareScriptFromAllWorkbooks",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=m(regeneratorRuntime.mark((function t(r){var n,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new i.b("UnshareScriptFromAllWorkbooks","User"),t.prev=1,s=e._makerStorageWorkbook.detachScriptFromWorkbook(r).catch((function(){return null})),t.next=5,Object(d.b)((function(e){return Object(a.unshareScript)(r,e)}),n,c.e);case 5:return t.next=7,s;case 7:n.end(!0,i.a.Information,{storageId:r}),t.next=14;break;case 10:throw t.prev=10,t.t0=t.catch(1),n.end(!1,Object(c.e)(t.t0)||Object(c.b)(t.t0)?i.a.Warning:i.a.Error,{storageId:r,ErrorText:Object(o.a)(t.t0)}),t.t0;case 14:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}()})},b=function(){function e(){}return e.instance=function(){if(!e._instance)switch(Object(n.c)()){case n.b.makerserviceprodnew:case n.b.makerserviceint:case n.b.makerservicetest:case n.b.makerservicelocal:case n.b.localstorage:e._instance=new h;break;default:throw new Error(n.a)}return e._instance},e}();Object.defineProperty(b,"_instance",{configurable:!0,enumerable:!0,writable:!0,value:void 0})},964:function(e,t,r){var n=r(783),a=r(673);e.exports=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return a(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),n(e,t,{leading:i,maxWait:t,trailing:o})}},965:function(e,t,r){var n=r(667);e.exports=function(){return n.Date.now()}},966:function(e,t,r){var n=r(673),a=r(967),i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var r=s.test(e);return r||c.test(e)?u(e.slice(2),r?2:8):o.test(e)?NaN:+e}},967:function(e,t,r){var n=r(693),a=r(687);e.exports=function(e){return"symbol"==typeof e||a(e)&&"[object Symbol]"==n(e)}}}]);
//# sourceMappingURL=editor.40a1f895.chunk.js.map