define("metaserver/static/js/modules/clean/flux/base_store",["require","exports","metaserver/static/js/modules/clean/flux/dispatcher","metaserver/static/js/modules/core/assert"],(function(e,t,s,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Store=void 0;const i=(function(){let e=!1;const t=[];return s.Dispatcher.dispatch_begin=()=>e=!0,s.Dispatcher.dispatch_end=function(){e=!1;try{return Array.from(t).map(e=>e())}finally{t.length=0}},function(s){return e?Array.from(t).includes(s)?void 0:t.push(s):s()}})();class r{constructor(e){"function"==typeof this._init&&this._init(),this._change_listeners=[],this._dispatcher=e||s.Dispatcher,this.dispatchToken=this._dispatcher.register(this._new_payload_wrapper.bind(this))}destructor(){this._dispatcher.unregister(this.dispatchToken),this.remove_all_change_listeners()}emit_change(){for(const e of this._change_listeners)i(e)}add_change_listener(e){o.assert(!this._change_listeners.includes(e),"adding duplicate change listener not allowed"),this._change_listeners.push(e)}remove_change_listener(e){this._change_listeners=this._change_listeners.filter(t=>t!==e)}remove_all_change_listeners(){this._change_listeners.length=0}_new_payload_wrapper(e){var t,s;(null===(s=null===(t=e)||void 0===t?void 0:t.action)||void 0===s?void 0:s.type)===this.constructor.WIPE_TYPE&&"function"==typeof this._init&&this._init(),this._new_payload(e)}_new_payload(e){throw new Error("Abstract method - must be implemented")}}t.Store=r,r.WIPE_TYPE="WIPE_ALL"})),define("metaserver/static/js/modules/clean/downloads",["require","exports","tslib","metaserver/static/js/api_v2/user_client","metaserver/static/js/modules/clean/filepath/filepath","metaserver/static/js/modules/clean/metrics/index","metaserver/static/js/modules/clean/react/snackbar","metaserver/static/js/modules/core/browser_detection","metaserver/static/js/modules/core/assert","metaserver/static/js/modules/core/html","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/core/uri"],(function(e,t,s,o,i,r,n,a,l,d,u,c,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.get_zip=t.getZipDownloadUrl=t.showGetZipUrlErrorSnackbar=t.zip_batch_by_ns_id=t.get_blockserver_link=t.get=void 0,i=s.__importStar(i),a=s.__importStar(a);const h=["dl-web.dropbox.com","dl.dropboxusercontent.com"],_=u.intl.formatMessage({id:"L64bdq",defaultMessage:"There was an error downloading your file."});let m=!1,f={};function b({source:e,type:t}){r.getMetricsReporter().createStats({ns:"web_file_actions",name:"download/failed"},{source:e,type:t}).record(1)}t.get=({url:e,error:t,source:s="unknown"})=>{const o=p.URI.parse(e),i=o.getAuthority();(function({source:e}){r.getMetricsReporter().createStats({ns:"web_file_actions",name:"download/attempt"},{source:e}).record(1)})({source:s});const n=h.includes(i)||i.endsWith(".dropboxusercontent.com")||"www.dropbox.com"===i;n||b({source:s,type:"download_non_block_server"}),l.assert(n,"attempt to download from a non-blockserver domain",{exc_extra:{domain:i,url:e}}),m||(m=!0,f={},window.addEventListener("message",y));const d=(function(){let e="";for(let t=1;t<=4;t++)e+=String(Math.random()).split(".")[1];return e})();o.updateQuery({_download_id:d,_notify_domain:window.location.host});return g({downloadUri:o,downloadId:d,error:t,downloadDomain:i,onLoad:()=>{setTimeout(()=>{const e=f[d];null!=e&&(a.chrome&&(c.Notify.error(_),e.error&&(e.error(),b({source:e.source,type:"download_failed"}))),v(d))},100)},source:s}),!1};const g=({downloadUri:e,downloadId:t,error:s,downloadDomain:o,onLoad:i,source:r})=>{const n=document.createElement("iframe");n.setAttribute("src",String(e)),n.style.display="none",i&&n.addEventListener("load",i),f[t]={origin:o,error:s,iframe:n,source:r},document.body.appendChild(n),window.setTimeout(()=>v(t),9e4)};function y(e){const t=p.URI.parse(e.origin);if("https"!==t.getScheme())return;if(!h.includes(t.getAuthority())&&!t.getAuthority().endsWith(".dropboxusercontent.com"))return;let s;try{s=JSON.parse(e.data)}catch(e){return}if(!s||!s.download_id)return;const o=f[s.download_id];if(null!=o&&t.getAuthority()===o.origin&&e.source===o.iframe.contentWindow){if("failed"===s.status){const e=(s.message||_)+''+u.intl.formatMessage({id:"WYQtmB",defaultMessage:"More info"})+"";c.Notify.error(new d.HTML(e)),o.error&&(o.error(),b({source:o.source,type:"download_failed"}))}v(s.download_id)}}function v(e){const t=f[e];null!=t&&(t.iframe.remove(),delete f[e])}t.get_blockserver_link=function({url:e,ns_id:s,ns_path:o,inside_admin_console:i,legal_hold_export_gid:r,revision_id:n,error:a}){const d=p.URI.parse(e);return d.setScheme("https"),i?(d.updateQuery({dl:"1",inside_admin_console:"true"}),r&&d.updateQuery({legal_hold_export_gid:r})):d.updateQuery({dl:"1"}),null!=s&&(l.assert("string"==typeof o,`Namespace ID was passed with invalid path, got: ${o}`),d.updateQuery({nsid:String(s),path:o})),null!=n&&d.updateQuery({revision_id:n}),l.assert("dl-web.dropbox.com"===d.getAuthority(),`download_blockserver_url expects a blockserver resource, got: ${e}`),t.get({url:d.toString(),error:a,source:"get_blockserver_link"})},t.zip_batch_by_ns_id=function({parent_ns_id:e,parent_ns_path:t,files:s,subject_uid:o,block_hash:r}){const n=new p.URI({scheme:"https",authority:"dl-web.dropbox.com",path:"/zip_batch_by_ns_id",query:{_subject_uid:String(o),parent_ns_id:String(e),parent_ns_path:t||"/"}}).toString(),a=document.createElement("form");a.setAttribute("action",n),a.setAttribute("method","post");for(const e of s){const s=`${t}/${i.filename(e.fq_path)}`,o=document.createElement("input");o.setAttribute("name","ns_paths"),o.setAttribute("value",s),a.appendChild(o)}const l=document.createElement("input");l.setAttribute("name","w"),l.setAttribute("value",r),a.appendChild(l),document.body.appendChild(a),a.submit(),a.remove()},t.showGetZipUrlErrorSnackbar=e=>{let t;t="too_many_files"===e[".tag"]?u.intl.formatMessage({id:"ZvH26K",defaultMessage:"Attempted to zip too many files."}):"too_much_data"===e[".tag"]?u.intl.formatMessage({id:"Qq4R12",defaultMessage:"Attempted to zip too much data."}):"file_not_found"===e[".tag"]?u.intl.formatMessage({id:"XSR4O8",defaultMessage:"File not found."}):"unauthorized_user"===e[".tag"]?u.intl.formatMessage({id:"tUjhJf",defaultMessage:"Unauthorized user."}):"unauthorized_namespace"===e[".tag"]?u.intl.formatMessage({id:"zR9JV2",defaultMessage:"Unauthorized namespace."}):u.intl.formatMessage({id:"ItwtZa",defaultMessage:"Zip download failed."}),n.Snackbar.fail(t,"zip-download-status")},t.getZipDownloadUrl=({block_hash:e,fq_paths:t,parent_path:i,flat_mode:r,subjectUserId:n,root_ns_id:a})=>s.__awaiter(void 0,void 0,void 0,(function*(){try{const s=new o.UserApiV2Client;return{result:yield s.ns("browse_zip_downloads").rpc("get_zip_download_url",{block_hash:e,unnormalized_files:[...t],parent_path:i,flat_mode:r,root_ns_id:a},{subjectUserId:n}),isError:!1}}catch(e){return{isError:!0,error:{".tag":"undefined_error"}}}})),t.get_zip=function({fq_paths:e,subject_uid:o,block_hash:i,parent_path:r,flat_zip_mode:n,source:a="unknown",root_ns_id:l}){return s.__awaiter(this,void 0,void 0,(function*(){""===r&&(r="/");const s=yield t.getZipDownloadUrl({block_hash:i,fq_paths:[...e],parent_path:r,flat_mode:!!n,subjectUserId:o,root_ns_id:l});if(s.isError)t.showGetZipUrlErrorSnackbar(s.error),b({source:a,type:"zip_download_error"});else{const{url:e}=s.result;t.get({url:e,source:a})}}))}})),define("metaserver/static/js/modules/clean/deprecated_ajax/ajax_as_promised_jquery",["require","exports","tslib","metaserver/static/js/modules/clean/deprecated_ajax/ajax_jquery","metaserver/static/js/modules/clean/deprecated_ajax/ajax_jquery"],(function(e,t,s,o,i){"use strict";function r(e){return t=>new Promise((s,o)=>{const r=e(Object.assign(Object.assign({},t),{success:(e,o,i)=>{t.success&&t.success(e,o,i),s(e)},error:(e,i,r)=>{t.error&&t.error(e,i,r),200===e.status?(t.success&&t.success(e.responseText,"success",e),s(e.responseText)):o({jqXHR:e,textStatus:i,errorThrown:r})}}));if(t.signal){const e=()=>{const e=i.getFakeJQXHR();e.readyState=XMLHttpRequest.DONE,e.responseText="Aborted",e.status=500,e.statusText="abort",r.abort(),o({jqXHR:e,textStatus:"aborted",errorThrown:"Aborted"})};t.signal.aborted?e():t.signal.addEventListener("abort",e)}})}Object.defineProperty(t,"__esModule",{value:!0}),t.WebProgressRequest=t.FormWebRequest=t.WebRequestOref=t.WebRequest=t.SilentBackgroundRequest=t.Request=t.BackgroundRequest=void 0,o=s.__importStar(o),t.BackgroundRequest=r(o.BackgroundRequest),t.Request=r(o.Request),t.SilentBackgroundRequest=r(o.SilentBackgroundRequest),t.WebRequest=r(o.WebRequest),t.WebRequestOref=r(o.WebRequestOref),t.FormWebRequest=r(o.FormWebRequest),t.WebProgressRequest=r(o.WebProgressRequest)})),define("metaserver/static/js/modules/clean/avatar/viewer_avatar",["require","exports","tslib","react","metaserver/static/js/modules/clean/avatar/photo_avatar","metaserver/static/js/modules/clean/css/css","metaserver/static/js/modules/core/uri","metaserver/static/js/modules/clean/event_handler"],(function(e,t,s,o,i,r,n,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o=s.__importDefault(o),r=s.__importStar(r);let l=class extends o.default.Component{constructor(e){super(e),this.state={photoUrl:this.props.photoUrl}}componentDidMount(){r.require_css("/static/css/scooter/scooter-scoped-vflRoCzLn.css"),this.events.on(document,"db:account_photo:photo_set",(e,t)=>{const s=2*this.props.dimension,o=`${s}x${s}`,i=n.URI.parse(t.saved_photo_url).updateQuery({size:o}).toString();this.setState({photoUrl:i})}),this.events.on(document,"db:account_photo:photo_deleted",()=>{this.setState({photoUrl:null})}),!this.hasPhotoAvatar()&&this.props.onLoad&&this.props.onLoad()}hasPhotoAvatar(){return null!=this.state.photoUrl}render(){return this.state.photoUrl?o.default.createElement(i.PhotoAvatar,{alt:this.props.alt,dimension:this.props.dimension,onClick:this.props.onPhotoClick,photo:this.state.photoUrl,optionalClass:this.props.optionalClass,onLoad:this.props.onLoad,onError:this.props.onError,shape:"CIRCLE"}):this.props.defaultAvatar}};l.displayName="ViewerAvatar",l=s.__decorate([a.eventHandler],l),t.default=l})),define("metaserver/static/js/modules/clean/browse_interface",["require","exports","metaserver/static/js/modules/clean/viewer","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/uri","metaserver/static/js/modules/clean/browse_uri_interface","metaserver/static/js/modules/clean/browse_uri_interface"],(function(e,t,s,o,i,r,n){"use strict";function a(e){return s.Viewer.get_viewer().is_paired?s.Viewer.get_root_name(e):o.intl.formatMessage({id:"bObFEu",defaultMessage:"Files"})}Object.defineProperty(t,"__esModule",{value:!0}),t.getFileHistoryUrlForNsPath=t.getFileHistoryUrl=t.get_all_browse_roots=t.get_browse_root_name=t.browse_uri_for_fq_path=t.preview_uri_for_fq_path=t.href_for_file=t.get_browse_root=void 0,Object.defineProperty(t,"get_browse_root",{enumerable:!0,get:function(){return r.get_browse_root}}),Object.defineProperty(t,"href_for_file",{enumerable:!0,get:function(){return r.href_for_file}}),Object.defineProperty(t,"preview_uri_for_fq_path",{enumerable:!0,get:function(){return r.preview_uri_for_fq_path}}),Object.defineProperty(t,"browse_uri_for_fq_path",{enumerable:!0,get:function(){return r.browse_uri_for_fq_path}}),t.get_browse_root_name=a,t.get_all_browse_roots=function(){return s.Viewer.get_viewer().get_users().map(e=>({name:a(e),path:n.get_browse_root(e)}))},t.getFileHistoryUrl=function({fqPath:e,userId:t},s){const o=Object.assign(Object.assign({},null==s?{}:s),{undelete:"1",_subject_uid:String(t)});return e=e.replace(/^[/]/,""),new i.URI({path:`/history/${e}`}).updateQuery(o).toString()},t.getFileHistoryUrlForNsPath=function({nsPath:e,nsId:t,userId:s},o){const r=Object.assign(Object.assign({},null!=o?o:{}),{ns_id:`${t}`,undelete:"1",_subject_uid:String(s)});return e=e.replace(/^[/]/,""),new i.URI({path:`/history/${e}`}).updateQuery(r).toString()}})),define("metaserver/static/js/modules/clean/bolt/bolt_nodeps",["require","exports","tslib","lodash","metaserver/static/js/modules/core/exception"],(function(e,t,s,o,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThunderClient=t.BoltClient=t.ChannelPayloads=t.Payload=t.SignedChannelState=t.ChannelId=void 0,o=s.__importStar(o),i=s.__importStar(i);class r{constructor(e,t){this.app_id=e,this.unique_id=t}static from_json(e){return new r(e.app_id,e.unique_id)}}t.ChannelId=r;class n{constructor(e,t,s,o){this.app_id=e,this.unique_id=t,this.revision=s,this.token=o}to_json(){var e;return{channel_id:{app_id:this.app_id,unique_id:this.unique_id},revision:null!==(e=this.revision)&&void 0!==e?e:"",token:this.token}}static from_json(e){return new n(e.channel_id.app_id,e.channel_id.unique_id,e.revision,e.token)}}t.SignedChannelState=n;class a{constructor(e,t){this.revision=e,this.payload=t}}t.Payload=a;class l{constructor(e,t){this.channel_state=e,this.payloads=t}}t.ChannelPayloads=l;const d=e=>JSON.stringify(e);class u{constructor(e,t,s,n){this._find_state=e=>this._signed_channel_states[d(e)],this._long_poll=()=>{this._sequence_num++;const e=this._sequence_num,t=new XMLHttpRequest;t.open("POST",this._subscribe_url(),!0),t.setRequestHeader("Content-Type","application/json; charset=utf-8"),Object.keys(this._additional_headers).forEach(e=>{t.setRequestHeader(e,this._additional_headers[e])}),t.timeout=12e4,t.withCredentials=!0,t.responseType="json";const s=()=>this._handle_poll_error(e);t.addEventListener("load",()=>{const{status:s}=t;s>=200&&s<300||304===s?this._handle_poll_success(e,t):this._handle_poll_error(e)}),t.addEventListener("timeout",s),t.addEventListener("error",s),t.addEventListener("abort",s),t.send(JSON.stringify({channel_states:this._signed_channel_states_keys.map(e=>this._signed_channel_states[e])})),this._long_poll_xhr=t},this._must_find_state=e=>{const t=this._find_state(e);if(null==t){const t=`Bolt returned unknown channel id ${e}`;i.reportStack(t)}return t},this._handle_poll_data=(e,t)=>{throw i.reportStack("Method must be implemented."),new Error("Method must be implemented.")},this._handle_poll_success=(e,t)=>{if(e!==this._sequence_num)return;if(this._long_poll_xhr=void 0,!this._started)return;const s=t.response,i=this._handle_poll_data(s,t);if(i.length>0&&o.defer(()=>this._update_callback(i)),null!=s.invalid_channels&&s.invalid_channels.length>0){const e=s.invalid_channels.map(r.from_json);o.defer(()=>this._refresh_callback(e))}else this._backoff_window=1e3,this._timeout_id=window.setTimeout(this._long_poll,0)},this._handle_poll_error=e=>{if(e!==this._sequence_num)return;if(this._long_poll_xhr=void 0,!this._started)return;const t=Math.random()*this._backoff_window;this._backoff_window=Math.min(2*this._backoff_window,3e5),this._timeout_id=window.setTimeout(this._long_poll,t)},this._update_callback=t,this._refresh_callback=s,this._hostname=n,this._signed_channel_states={},this._signed_channel_states_keys=[],this._started=!1,this._sequence_num=0,this._backoff_window=1e3,this._additional_headers={},this.update_states(e)}_compare_revisions(e,t){const s=Math.max(e.length,t.length),o=Array(s-e.length+1).join("0")+e,i=Array(s-t.length+1).join("0")+t;return oi?1:0}update_states(e){for(const t of e){const e=t.to_json(),s=this._find_state(e.channel_id);if(null==s){const t=d(e.channel_id);this._signed_channel_states[t]=e,this._signed_channel_states_keys.push(t)}else this._compare_revisions(e.revision,s.revision)>=0&&(s.revision=e.revision,s.token=e.token)}}start(){this._started||(this._started=!0,this._long_poll())}unsubscribe(){this._started=!1,null!=this._long_poll_xhr&&this._long_poll_xhr.abort(),this._long_poll_xhr=void 0,window.clearTimeout(this._timeout_id),this._timeout_id=void 0}_subscribe_url(){return`https://${this._hostname}${this._subscribe_endpoint()}`}_subscribe_endpoint(){throw i.reportStack("Method must be implemented."),new Error("Method must be implemented.")}}t.BoltClient=class extends u{constructor(e,t,s){super(e,t,s,"bolt.dropbox.com"),this._handle_poll_data=(e,t)=>{const s=[];if(null!=e.channel_states)for(const t of e.channel_states){const e=this._must_find_state(t.channel_id);this._compare_revisions(t.revision,e.revision)>0&&(e.revision=t.revision,e.token=t.token,s.push(n.from_json(t)))}return s}}_subscribe_endpoint(){return"/2/notify/subscribe"}};t.ThunderClient=class extends u{constructor(e,t,s){super(e,t,s,"thunder.dropbox.com"),this._handle_poll_data=(e,t)=>{const s=[];this._additional_headers={};const o=t.getResponseHeader("X-Bolt-Session");if(o&&(this._additional_headers["X-Bolt-Session"]=o),null!=e.channel_payloads)for(const t of e.channel_payloads){const e=t.channel_state,o=this._must_find_state(e.channel_id),i=n.from_json(t.channel_state),r=[];for(const e of t.payloads)this._compare_revisions(e.revision,o.revision)>0&&r.push(new a(e.revision,e.payload));r.length>0&&s.push(new l(i,r)),this._compare_revisions(e.revision,o.revision)>0&&(o.revision=e.revision,o.token=e.token)}return s}}unsubscribe(){return delete this._additional_headers["X-Bolt-Session"],super.unsubscribe()}_subscribe_endpoint(){return"/2/payloads/subscribe"}}})),define("metaserver/static/js/modules/clean/event_handler",["require","exports","tslib","jquery"],(function(e,t,s,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventHandler=t.EventHandlerMixin=t.eventHandler=void 0,o=s.__importDefault(o),t.eventHandler=function(e){const s=e.prototype.componentWillMount,o=e.prototype.componentWillUnmount;e.prototype.componentWillMount=function(){t.EventHandlerMixin.componentWillMount.apply(this),s&&"function"==typeof s&&s.apply(this)},e.prototype.componentWillUnmount=function(){o&&"function"==typeof o&&o.apply(this),t.EventHandlerMixin.componentWillUnmount.apply(this)}},t.EventHandlerMixin={componentWillMount(){this.events=new i},componentWillUnmount(){this.events.removeAll()}};class i{on(e,t,s,i,r){"string"!=typeof s&&(r=i,i=s,s=void 0),r&&(i=o.default.proxy(i,r)),this.handlers||(this.handlers=[]),e=o.default(e),s?e.on(t,s,i):e.on(t,i),this.handlers.push({element:e,event:t,selector:s,callback:i})}removeAll(){this.handlers&&(this.handlers.forEach((function(e){e.selector?e.element.off(e.event,e.selector,e.callback):e.element.off(e.event,e.callback)})),this.handlers=null)}}t.EventHandler=i})),define("metaserver/static/js/modules/clean/event_dispatcher",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventDispatcher=void 0;t.EventDispatcher=class{constructor(){this.listeners={},this.addListener=(e,t)=>{var s;const o=null!==(s=this.listeners[e])&&void 0!==s?s:[];o.push(t),this.listeners[e]=o},this.removeListener=(e,t)=>{var s;const o=null!==(s=this.listeners[e])&&void 0!==s?s:[],i=o.indexOf(t);i>-1&&o.slice(i,1)},this.trigger=(e,t)=>{var s;for(const o of null!==(s=this.listeners[e])&&void 0!==s?s:[])o(t)}}}})),define("metaserver/static/js/modules/clean/fuzzy",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={simpleFilter:(e,t)=>t.filter(t=>s.test(e,t)),test:(e,t)=>null!==s.match(e,t),match(e,t,s){s=s||{};let o=0;const i=[],r=t.length;let n=0,a=0;const l=s.pre||"",d=s.post||"",u=s.caseSensitive&&t||t.toLowerCase();let c=void 0;e=s.caseSensitive&&e||e.toLowerCase();let p=0;const h=[];let _=0,m=0;for(;p{this.ttiComponents.push({name:e,isReady:!1})}),this.ttiMarked=!1,this.extraColumns=i}componentReady(e){if(this.ttiMarked)return;let t=!1;for(let s=0;st.POSITION_TO_CSS_CLASS_MAP[this.props.position],this._adjustArrowPosition=(e=!1)=>{if(!this.props.shouldShowArrow)return;const t=r.findDOMNode(this.refs.bubbleArrowContainer);if(t){switch(this.props.position){case u.StickyPosition.TOP_ALIGN_LEFT:case u.StickyPosition.BOTTOM_ALIGN_LEFT:t.style.left=this.props.targetNode.offsetWidth/2+"px";break;case u.StickyPosition.TOP_ALIGN_RIGHT:case u.StickyPosition.BOTTOM_ALIGN_RIGHT:t.style.right=this.props.targetNode.offsetWidth/2+"px";break;case u.StickyPosition.LEFT_ALIGN_TOP:case u.StickyPosition.RIGHT_ALIGN_TOP:t.style.top=this.props.targetNode.offsetHeight/2+"px";break;case u.StickyPosition.LEFT_ALIGN_BOTTOM:case u.StickyPosition.RIGHT_ALIGN_BOTTOM:t.style.bottom=this.props.targetNode.offsetHeight/2+"px"}if((!e||e&&this.props.shouldArrowDecrement)&&(this.props.verticalArrowOffset||this.props.horizontalArrowOffset)){const e=getComputedStyle(t);this._getArrowStyleFromPosition().match(/^(top|bottom)/)&&(t.style.left=String(parseFloat(e.left)-this.props.horizontalArrowOffset)+"px"),this._getArrowStyleFromPosition().match(/^(left|right)/)&&(t.style.top=String(parseFloat(e.top)-this.props.verticalArrowOffset)+"px")}}}}componentDidMount(){return this._adjustArrowPosition()}componentDidUpdate(){return this._adjustArrowPosition(!0)}render(){return i.default.createElement("div",{className:this.props.isMaestroDesign?"maestro":""},i.default.createElement("div",{ref:"dropdown",className:o.default("bubble-dropdown-v2",`bubble-dropdown-v2--${this._getArrowStyleFromPosition()}`,this.props.className),"aria-labelledby":this.props.targetNode.id},this.props.children,this.props.shouldShowArrow?i.default.createElement("div",{ref:"bubbleArrowContainer",className:"bubble-arrow-container"},i.default.createElement("div",{className:"bubble-arrow-border"}),i.default.createElement("div",{className:"bubble-arrow"})):null))}}t.BubbleDropdownContents=c,c.displayName="BubbleDropdownContents",c.propTypes={targetNode:n.default.instanceOf(HTMLElement).isRequired,position:n.default.oneOf([u.StickyPosition.TOP_LEFT,u.StickyPosition.TOP,u.StickyPosition.TOP_RIGHT,u.StickyPosition.LEFT_TOP,u.StickyPosition.LEFT,u.StickyPosition.LEFT_BOTTOM,u.StickyPosition.RIGHT_TOP,u.StickyPosition.RIGHT,u.StickyPosition.RIGHT_BOTTOM,u.StickyPosition.BOTTOM_LEFT,u.StickyPosition.BOTTOM,u.StickyPosition.BOTTOM_RIGHT,u.StickyPosition.TOP_ALIGN_LEFT,u.StickyPosition.TOP_ALIGN_RIGHT,u.StickyPosition.LEFT_ALIGN_TOP,u.StickyPosition.LEFT_ALIGN_BOTTOM,u.StickyPosition.RIGHT_ALIGN_TOP,u.StickyPosition.RIGHT_ALIGN_BOTTOM,u.StickyPosition.BOTTOM_ALIGN_LEFT,u.StickyPosition.BOTTOM_ALIGN_RIGHT]),verticalArrowOffset:n.default.number,horizontalArrowOffset:n.default.number,shouldShowArrow:n.default.bool,shouldArrowDecrement:n.default.bool,className:n.default.string,isMaestroDesign:n.default.bool},c.defaultProps={verticalArrowOffset:0,horizontalArrowOffset:0,shouldShowArrow:!0,shouldArrowDecrement:!0,className:null,isMaestroDesign:!1};class p extends i.default.Component{constructor(){super(...arguments),this.state={isVisible:!1,targetNode:null,shouldAutoFocusDropdownContent:!1},this.hasOnShowNotBeenCalledSinceLastOpened=!1,this.updateTargetNode=()=>{const e=r.findDOMNode(this.refs.bubbleDropdownContainer).childNodes[0];return e&&(e.setAttribute("aria-expanded",this.state.isVisible),e.hasAttribute("id")||e.setAttribute("id",`bubbleDropdownTarget-${a.uniqueId()}`)),this.setState({targetNode:e})},this.showDropdown=()=>{if(!this.props.disabled)return this.setState({isVisible:!0})},this.hideDropdown=()=>{if(!this.props.disabled)return this.setState({isVisible:!1})},this._handleClick=e=>{const t=!(e.clientX>0&&e.clientY>0);return this.setState({shouldAutoFocusDropdownContent:t},this._toggle)},this._toggle=()=>{if(!this.props.disabled)return this.setState({isVisible:!this.state.isVisible})},this._hasShown=()=>{if(this.hasOnShowNotBeenCalledSinceLastOpened)return this.state.targetNode.setAttribute("aria-expanded",!0),this.props.onShowDropdown(),this.hasOnShowNotBeenCalledSinceLastOpened=!1},this._hasHidden=()=>(this.state.targetNode.setAttribute("aria-expanded",!1),this.props.onHideDropdown())}componentDidMount(){return this.updateTargetNode()}UNSAFE_componentWillUpdate(e,t){this.state.isVisible&&!this.props.disabled||!t.isVisible||e.disabled||(this.hasOnShowNotBeenCalledSinceLastOpened=!0)}componentDidUpdate(e,t){if(t.isVisible!==this.state.isVisible&&(this.state.isVisible||this._hasHidden()),r.findDOMNode(this.refs.bubbleDropdownContainer).childNodes[0]!==this.state.targetNode)return this.updateTargetNode()}render(){const{targetNode:e}=this.state;return i.default.createElement("div",{className:"bubble-dropdown-v2-container",onClick:this._handleClick,ref:"bubbleDropdownContainer"},this.props.targetButton,this.state.isVisible&&!this.props.disabled&&e?i.default.createElement(d.PositionedOverlay,{targetNode:e,isTargetPositionFixed:this.props.targetFixed,shouldTrapKeyboardFocus:this.props.shouldTrapKeyboardFocus,shouldAutoFocusOverlayContent:this.state.shouldAutoFocusDropdownContent,position:this.props.position,positionOffset:{horizontal:this.props.horizontalDisplacement,vertical:this.props.verticalDisplacement},onRendered:()=>this._hasShown(),onBlur:()=>this.hideDropdown()},i.default.createElement(c,{ref:"bubbleDropdownContents",targetNode:e,position:this.props.position,verticalArrowOffset:this.props.verticalDisplacement,horizontalArrowOffset:this.props.horizontalDisplacement,shouldShowArrow:this.props.shouldShowArrow,className:this.props.className,shouldArrowDecrement:this.props.shouldArrowDecrement,isMaestroDesign:this.props.isMaestroDesign},this.props.children)):void 0)}}p.displayName="BubbleDropdown",p.propTypes={targetButton(e,t,s){if(null==e.targetButton||"button"!==e.targetButton.type)return new Error("BubbleDropdown's targetButton must be a `