define("metaserver/static/js/modules/clean/avatar/contact_avatar",["require","exports","tslib","react","metaserver/static/js/modules/clean/avatar/avatar_with_default","metaserver/static/js/modules/clean/avatar/initials_avatar","metaserver/static/js/modules/clean/avatar/size","metaserver/static/js/modules/clean/contacts/types","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/user_i18n"],(function(e,t,s,n,i,r,a,o,l,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n=s.__importDefault(n),i=s.__importDefault(i),o=s.__importDefault(o),c=s.__importStar(c);const d=n.default.createElement;class u extends n.default.Component{render(){let e,t;const{contact:s}=this.props,n=s.name||s.email||"";let u=s.photo_url;s.type===o.default.FB&&(u=`https://graph.facebook.com/${s.fb_id}/picture`);let h="";this.props.dimension!==a.AvatarSize.XSMALL&&(h=c.getInitials(n)),s.type===o.default.NEW_STYLE_GROUP?(e=l.intl.formatMessage({id:"FxoGBv",defaultMessage:"Group"}),t="SQUARE"):(e=l.intl.formatMessage({id:"n4ojia",defaultMessage:"User"}),t="CIRCLE");const _={alt:e,dimension:this.props.dimension,photoUrl:u,shape:t,optionalClass:this.props.optionalClass,defaultAvatar:d(r.InitialsAvatarWithColorDerivedFromName,{alt:e,dimension:this.props.dimension,name:n,initials:h,shape:t,optionalClass:this.props.optionalClass})};return d(i.default,_)}}u.displayName="ContactAvatar",t.default=u})),define("metaserver/static/js/modules/clean/components/title_bubble",["require","exports","tslib","classnames","react","react-dom","prop-types","jquery","metaserver/static/js/modules/clean/react/components/css"],(function(e,t,s,n,i,r,a,o,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n=s.__importDefault(n),i=s.__importDefault(i),r=s.__importStar(r),a=s.__importDefault(a),o=s.__importDefault(o);class c extends i.default.Component{constructor(){super(...arguments),this.state={isChildFocused:!1}}componentDidMount(){o.default(r.findDOMNode(this)).on("focusin.title-bubble",e=>this.setState({isChildFocused:!0})).on("focusout.title-bubble",e=>this.setState({isChildFocused:!1})).on("mouseenter.title-bubble",()=>"function"==typeof this.props.onMouseEnter?this.props.onMouseEnter():void 0)}componentWillUnmount(){o.default(r.findDOMNode(this)).off("focusin.title-bubble").off("focusout.title-bubble").off("mouseenter.title-bubble")}render(){const e={"c-title-bubble":!0,"is-child-focused":this.state.isChildFocused,"c-title-bubble--respect-line-break":this.props.respectLineBreaks};return e[`c-title-bubble--${this.props.direction.slice(0,1)}`]=!0,i.default.createElement("div",{className:n.default([e,this.props.className]),"data-title":this.props.text,onClick:e=>{if(e.detail>0)return this.setState({isChildFocused:!1})},onMouseLeave:()=>this.setState({isChildFocused:!1})},this.props.children)}}c.displayName="TitleBubble",c.propTypes={text:a.default.string.isRequired,direction:a.default.oneOf(["north","south","east","west"]).isRequired,onMouseEnter:a.default.func,respectLineBreaks:a.default.bool,className:a.default.string};const d=l.requireCssWithComponent(c,["/static/css/scooter/scooter-scoped-vflRoCzLn.css"]);t.default=d})),define("metaserver/static/js/modules/clean/contacts/bloodhound_contacts_v2",["require","exports","tslib","bloodhound","metaserver/static/js/modules/clean/contacts/config","metaserver/static/js/modules/clean/contacts/contact","metaserver/static/js/modules/clean/profile_services/profile_services_link","metaserver/static/js/modules/clean/viewer","metaserver/static/js/modules/core/cookies"],(function(e,t,s,n,i,r,a,o,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BloodhoundContactsV2=void 0,n=s.__importDefault(n),i=s.__importStar(i),a=s.__importStar(a);const c={};function d(e,t){(function(e,t){if(!(e.id in c))return;const s=c[e.id];t=t.filter(r.ContactCommon.is_valid),s.clearRemoteCache(),s.clear(),s.add(t)})(e,t.includeForUser(e.id).contacts)}function u(e){const t=document.createElement("a");t.href=e;const s=t.hostname||window.location.hostname;if(-1===s.indexOf(".dropbox.com",s.length-".dropbox.com".length))throw new Error("Cannot send the CSRF token to "+s);return e}t.BloodhoundContactsV2={getOrCreateForUser(e){if(e.id in c)return c[e.id];const t=i.getSearchConfigForUser(e);let s;if(t.remoteEndpoint){const n=String(e.id);s={url:u(t.remoteEndpoint),prepare:(e,t)=>(t.type="POST",t.headers={"X-CSRF-Token":l.Cookies.read("__Host-js_csrf"),"X-Dropbox-Uid":n},t.data={query:JSON.stringify(e)},t.data._subject_uid=n,t),rateLimitBy:"debounce",rateLimitWait:t.remoteDebounceWait}}const h=new n.default({datumTokenizer:r.ContactCommon.get_index_tokens,queryTokenizer:n.default.tokenizers.whitespace,identify:r.ContactCommon.get_key,sufficient:t.sufficientResults,sorter:r.ContactCommon.sorter,local:[],remote:s});if(c[e.id]=h,o.Viewer.get_viewer().is_user_signed_in(e)){const s=t.localCacheStore.getOrCreateForUser(e);s.load_contacts(!1,t=>{d(e,t),s.register_for_updates("bloodhound_contacts_v2",t=>{d(e,t)})})}return a.LinkedProfileServices.get_linked_profile_services_for_user(e.id).register_for_service_changes("bloodhound_contacts_v2",e=>{h.clearRemoteCache()}),c[e.id]},search(e,s,n,r){const a=t.BloodhoundContactsV2.getOrCreateForUser(e),o=i.getSearchConfigForUser(e);if(!s)return n([]),void(r&&o.remoteEndpoint&&r([]));const l=o.localCacheStore.getOrCreateForUser(e);l.is_loaded()?a.search(s,n,r):l.load_contacts(!1,e=>{a.search(s,n,r)}),l.refresh_contacts(!1)},getAll:e=>t.BloodhoundContactsV2.getOrCreateForUser(e).all()}})),define("metaserver/static/js/modules/clean/contacts/cache",["require","exports","tslib","metaserver/static/js/modules/clean/deprecated_ajax/ajax_jquery","metaserver/static/js/modules/clean/bolt/bolt_nodeps","metaserver/static/js/modules/clean/contacts/cache_type","metaserver/static/js/modules/clean/contacts/list","metaserver/static/js/modules/clean/viewer","metaserver/static/js/modules/core/assert"],(function(e,t,s,n,i,r,a,o,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PerUserBoltContactsCache=t.ContactsCacheProto=t.BoltContactsCache=void 0,n=s.__importStar(n),i=s.__importStar(i),a=s.__importDefault(a);class c{constructor(e){this.callbacks={},this.one_time_callbacks=[],this.cached_contacts=null,this._cache_download_name=e,this.should_force_refresh=!1,this.request_perf_records=[],this._config=null}static initClass(){this.MAX_REQUEST_PERF_RECORDS=20}register_for_updates(e,t){this.callbacks[e]=t}unregister_for_updates(e){null!=this.callbacks[e]&&delete this.callbacks[e]}get_contacts_count(){return null!=this.cached_contacts?this.cached_contacts.length():0}get_downloaded_time(){const e=window.performance.getEntriesByName(this._get_contacts_downloaded_mark_name());return e&&e.length?e[0].startTime:null}get_request_perf_records(){return this.request_perf_records}_is_contact_get_or_check_ajax_request(e){const{initiatorType:t}=e,{name:s}=e;return"xmlhttprequest"===t&&s.endsWith(this._config.getUrl)}_find_last_perf_entry(e=500){const t=window.performance.getEntriesByType("resource");if(t.length){for(let s=Math.min(t.length-1,e);s>=0;s--)if(this._is_contact_get_or_check_ajax_request(t[s]))return t[s]}return null}_record_perf_stats(e={}){const t=this._find_last_perf_entry();if(t&&(e.ttfb=t.responseStart-t.requestStart,e.downloading_time=t.responseEnd-t.responseStart,e.duration=t.duration,this.request_perf_records.push(e),this.request_perf_records.length>c.MAX_REQUEST_PERF_RECORDS))return this.request_perf_records=this.request_perf_records.slice(this.request_perf_records.length-1)}_get_request_url(){throw new Error("method unimplemented")}_get_request_params(){throw new Error("method unimplemented")}_contacts_loaded_callback(e){throw new Error("method unimplemented")}_fetch_contacts(){return n.BackgroundRequest({url:this._get_request_url(),data:this._get_request_params(),success:(e,t,s)=>{const n=JSON.parse(e);if(this._contacts_loaded_callback(n),this._schedule_fetch)return this._schedule_fetch()}})}_get_versioned_params(e,t=!0){const s={version:e};return t&&(s.force_refresh=this.should_force_refresh,this.should_force_refresh=!1),null!=this.digest&&(s.digest=this.digest),null!=this.limit&&(s.limit=this.limit),s}_get_contacts_downloaded_mark_name(){return`${this._cache_download_name}-${this.instance}`}_is_page_hidden(){return null!=window.document.visibilityState&&window.document.hidden}_add_one_time_callback(e){if(null!=e&&!Array.from(this.one_time_callbacks).includes(e))return this.one_time_callbacks.push(e)}_invoke_all_callbacks(e){return this._invoke_callbacks(this.one_time_callbacks,e,!0),this._invoke_callbacks(this.callbacks,e,!1)}_invoke_one_time_callbacks(e){return this._invoke_callbacks(this.one_time_callbacks,e,!0)}_invoke_callbacks(e,t,s){return(()=>{const n=[];for(const i of Array.from(Object.keys(e)))e[i](t),s?n.push(delete e[i]):n.push(void 0);return n})()}}t.ContactsCacheProto=c,c.initClass();class d extends c{constructor(e,t=null,s=null){super("BoltContactsCache download"),this.bolt_update_callback=this.bolt_update_callback.bind(this),this.bolt_refresh_callback=this.bolt_refresh_callback.bind(this),this.cache_type=e,this.limit=t,this.user_id=s,this.instance=d.INSTANCE++,this.loading_state=d.BOLT_NEED_TO_SEND_REQUEST,this._config=r.CONTACT_CACHE_TYPE_TO_CONFIG[r.ContactCacheType[this.cache_type]],this.current_bolt_states=null,this._notified_states={},this._bolt=null,this._last_refresh_ts=null}static initClass(){this.INSTANCE=0,this.BOLT_NEED_TO_SEND_REQUEST=0,this.BOLT_REQUEST_SENT=1,this.REFRESH_THRESHOLD=36e5}load_contacts(e,t){o.Viewer.get_viewer().is_signed_in&&(this._add_one_time_callback(t),(this.loading_state===d.BOLT_NEED_TO_SEND_REQUEST||e)&&(this.loading_state=d.BOLT_REQUEST_SENT,e&&(this.should_force_refresh=!0),this._fetch_contacts()),!this._should_update_contacts()&&this.is_loaded()&&this._invoke_one_time_callbacks(this.cached_contacts))}refresh_contacts(e=!1){const t=window.performance.now();if(this._last_refresh_ts||(e=!0),!(!e&&this._last_refresh_ts&&t-this._last_refresh_tst.sort_key?-1:e.sort_keythis.processMatches(s,t,e),t=>this.processMatches(t,s,e))}searchBatch(e,t,s){const n=this.searchConfig.localCacheStore.getOrCreateForUser(this.user);if(n.is_loaded())return this.searchBatchInternal(e,t,s);n.load_contacts(!0,()=>this.searchBatchInternal(e,t,s))}searchBatchInternal(e,t,s){const n=e.map(this.normalizeQuery).filter(e=>e.length>0),r={};for(const e of n){const t=t=>{r[e]=this.processMatches(t,void 0,e)};i.BloodhoundContactsV2.search(this.user,e,t)}if(t(r),!this.searchConfig.remoteBatchEndpoint)return;this.searchRemoteBatch(n,e=>{if(!s)return;const t={};for(const s in e)if(e.hasOwnProperty(s)){const n=r[s].map(a.ContactCommon.get_key),i=e[s].filter(e=>{const t=a.ContactCommon.get_key(e);return n.every(e=>e!==t)});t[s]=this.processMatches(i)}s(t)})}normalizeQuery(e){return e.trim().toLowerCase()}isSearchLocalOnly(){return-1!==r.LOCAL_ONLY_SEARCH_MODES.indexOf(this.searchMode)}getStats(){const e=this.searchConfig.localCacheStore.getOrCreateForUser(this.user);return{numLocalContacts:e.get_contacts_count(),localContactsDownloadedTime:e.get_downloaded_time()}}searchRemoteBatch(e,t){n.WebRequest({url:this.searchConfig.remoteBatchEndpoint,type:"post",subject_user:this.user.id,dataType:"json",data:{queries:JSON.stringify(e)},success:t})}isTeamContact(e){return this.user.is_team&&null!=e.team&&e.team}static isDirectoryRestrictedContact(e,t){const s=!!e.is_directory_restricted,n=t&&t===e.email;return s&&!n}processMatches(e,t,s){const n=[];for(const t of e){s&&(t.nameMatch=l.default.match(s,t.name||""),t.emailMatch=l.default.match(s,t.email||"")),t.on_team=!(t.type===o.default.FB||!this.isTeamContact(t));const e=new a.Contact(t);e.pending=!1;const i=this.excludeDomainContacts&&e.domain_contact,r=this.excludeDirectoryRestrictedContacts&&c.isDirectoryRestrictedContact(e,s);i||r||this.filterFunc&&!this.filterFunc(e)||n.push(e)}return t&&t(n),n}getAll(e){const t=this.searchConfig.localCacheStore.getOrCreateForUser(this.user);if(t.is_loaded()){const t=i.BloodhoundContactsV2.getAll(this.user).map(e=>new a.Contact(e)),s=this.filterFunc?t.filter(this.filterFunc):t;e(s)}else t.load_contacts(!0,t=>{if(t){const s=t.contacts,n=this.filterFunc?s.filter(this.filterFunc):s;e(n)}})}}t.ContactsDataSourceV2=c})),define("metaserver/static/js/modules/clean/contacts/list",["require","exports","tslib","metaserver/static/js/modules/clean/contacts/types"],(function(e,t,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n=s.__importDefault(n);class i{constructor(e,t){this.filterContacts=this.filterContacts.bind(this),this.length=this.length.bind(this),this.slice=this.slice.bind(this),this.includeForUser=this.includeForUser.bind(this),this.includeForViewer=this.includeForViewer.bind(this),this.excludeByEmail=this.excludeByEmail.bind(this),this.excludeMe=this.excludeMe.bind(this),this.excludeNewStyleGroups=this.excludeNewStyleGroups.bind(this),this.excludeFacebook=this.excludeFacebook.bind(this),this.excludeTeamMembers=this.excludeTeamMembers.bind(this),this.excludePairedUserDuplicates=this.excludePairedUserDuplicates.bind(this),this.excludeNonTeam=this.excludeNonTeam.bind(this),this.excludeNonTeamActive=this.excludeNonTeamActive.bind(this),this.excludeSuspended=this.excludeSuspended.bind(this),this.sortByTeamFirst=this.sortByTeamFirst.bind(this),this._excludeType=this._excludeType.bind(this),this._lowercaseContact=this._lowercaseContact.bind(this),this.contacts=e,this.owningUserId=t,this.lcontacts=Array.from(this.contacts).map(e=>this._lowercaseContact(e))}static create_contacts_list(e){return new i(e,null)}static create_per_user_contacts_list(e,t){return new i(e,t)}filterContacts(e){const t=this.contacts.filter(e);return new i(t,this.owningUserId)}length(){return this.contacts.length}slice(e,t){return new i(this.contacts.slice(e,t),this.owningUserId)}includeForUser(e){if(null!=this.owningUserId)return this.owningUserId===e?this:new i([],e);{const t=this.contacts.filter(t=>t.owning_user_id===e);return new i(t,e)}}includeForViewer(e){const t=e.get_user_ids();return this.filterContacts(e=>Array.from(t).includes(e.owning_user_id))}excludeByEmail(e){return e=e?e.toLowerCase():"",this.filterContacts(t=>!(e===t.email.toLowerCase()))}excludeMe(){return this.filterContacts(e=>!e.is_owner)}excludeNewStyleGroups(){return this._excludeType(n.default.NEW_STYLE_GROUP)}excludeFacebook(){return this._excludeType(n.default.FB)}excludeTeamMembers(){return this.filterContacts(e=>!e.team)}excludePairedUserDuplicates(){return this.filterContacts(e=>!e.paired_user_duplicate)}excludeNonTeam(){return this.filterContacts(e=>e.team)}excludeNonTeamActive(){return this.filterContacts(e=>e.team&&"active"===e.join_state)}excludeSuspended(){return this.filterContacts(e=>"suspended"!==e.join_state)}sortByTeamFirst(){return new i(i.sortContactsByTeamFirst(this.contacts),this.owningUserId)}static sortContactsByTeamFirst(e){const t=[],s=[];for(const n of Array.from(e))n.team?t.push(n):s.push(n);return t.concat(s)}_excludeType(e){return this.filterContacts(t=>t.type!==e)}_lowercaseContact(e){const t={};for(const s in e){let n=e[s];("string"==typeof n||n instanceof String)&&(n=n.toLowerCase()),t[s]=n}return t}}t.default=i})),define("metaserver/static/js/modules/clean/contacts/tokenizer",["require","exports","tslib","classnames","react","prop-types","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/avatar/contact_avatar","metaserver/static/js/modules/clean/contacts/config","metaserver/static/js/modules/clean/contacts/contact","metaserver/static/js/modules/clean/contacts/contact_token_state","metaserver/static/js/modules/clean/contacts/data_v2","metaserver/static/js/modules/clean/contacts/typeahead","metaserver/static/js/modules/clean/contacts/types","metaserver/static/js/modules/clean/em_string","metaserver/static/js/modules/clean/tokenizer","metaserver/static/js/modules/clean/validators/validators","metaserver/static/js/modules/core/i18n","dig-components/text_fields","dig-components/buttons","dig-components/icons","dig-components/icons/src"],(function(e,t,s,n,i,r,a,o,l,c,d,u,h,_,p,m,f,g,y,v,b,w){"use strict";let k,M;Object.defineProperty(t,"__esModule",{value:!0}),t.SLOW_CONTACT_SEARCH_THRESHOLD=t.ContactTokenState=t.ContactTokenValidator=t.ContactsTokenizer=void 0,n=s.__importDefault(n),i=s.__importDefault(i),r=s.__importDefault(r),o=s.__importDefault(o),l=s.__importStar(l),_=s.__importDefault(_),Object.defineProperty(t,"ContactTokenState",{enumerable:!0,get:function(){return d.ContactTokenState}});t.SLOW_CONTACT_SEARCH_THRESHOLD=100;class S extends i.default.Component{constructor(){super(...arguments),this._getTokenName=()=>{switch(this.props.contact.type){case _.default.FB:return"fb_ids";case _.default.EMAIL:return"emails";case _.default.NEW_STYLE_GROUP:return"new_style_group_ids";default:return"invalids"}},this._getTokenValue=()=>{switch(this.props.contact.type){case _.default.FB:return this.props.contact.fb_id;case _.default.NEW_STYLE_GROUP:return this.props.contact.group_id;default:return this.props.contact.email}},this._renderIcon=()=>this.props.contact.type===_.default.FB?i.default.createElement("img",{className:"token-icon",src:"/static/images/icons/fb_16-vflbiYTkC.png"}):this.props.contact.type===_.default.NEW_STYLE_GROUP||this.props.contact.dbx_account_id||this.props.contact.photo_url?i.default.createElement(o.default,{dimension:16,contact:this.props.contact,optionalClass:"token-icon"}):"",this._renderInput=()=>i.default.createElement("input",{type:"hidden",name:this._getTokenName(),value:this._getTokenValue()}),this._renderText=()=>{const e=this.props.tokenMaxLength||22,t=this.props.contact.name||this.props.contact.email;return p.Emstring.em_snippet(t,e)},this._makeCloseButton=()=>this.props.onRemove?i.default.createElement(v.IconButton,{variant:"transparent",onClick:e=>{e.preventDefault(),e.stopPropagation(),this.props.onRemove(this.props.contact)},size:"small",color:"faint"},i.default.createElement(b.UIIcon,{src:w.CloseLine,size:"small","aria-label":g.intl.formatMessage({id:"eEXkA6",defaultMessage:"Clear contact"})})):""}render(){const e={"tokenizer-token":!0,"contact-token":!0,invalid:this.props.tokenState===d.ContactTokenState.invalid,warned:this.props.tokenState===d.ContactTokenState.warn,pending:this.props.tokenState===d.ContactTokenState.pending};e[this.props.customClass]=null!=this.props.customClass,e[this.props.className]=null!=this.props.className;const t=n.default(e);return i.default.createElement("a",Object.assign({tabIndex:-1},this.props,{className:t}),this._renderInput(),this._renderIcon(),this._renderText(),this._makeCloseButton())}}S.displayName="ContactsToken",S.propTypes={customClass:r.default.string,className:r.default.string,contact:r.default.object.isRequired,onRemove:r.default.func,tabIndex:r.default.number,tokenState:r.default.oneOf((()=>{const e=[];for(k in d.ContactTokenState)M=d.ContactTokenState[k],e.push(M);return e})()).isRequired,tokenMaxLength:r.default.number};const E={basic(e){const t=e.name&&!e.invalid&&e.email!==e.name;return{state:e.invalid?d.ContactTokenState.invalid:d.ContactTokenState.ok,msg:t?e.email:null}},warn:e=>({state:e.pending?d.ContactTokenState.pending:e.on_team?d.ContactTokenState.ok:e.invalid?d.ContactTokenState.invalid:d.ContactTokenState.warn,msg:null}),forbid:e=>({state:e.pending?d.ContactTokenState.pending:e.on_team?d.ContactTokenState.ok:d.ContactTokenState.invalid,msg:null})};t.ContactTokenValidator=E;class C extends i.default.Component{constructor(e){super(e),this._initContactsDataSource=e=>{const{user:t,customContactFilter:s,excludeDomainContacts:n,customContactsDataSourceFactory:i}=e;return i?i(t,s):new u.ContactsDataSourceV2(t,s,n)},this._validateTokens=(e,t=!1)=>{if((null!=e?e.length:void 0)>0)return(()=>{const s=[];for(const n of Array.from(e))n.type===_.default.EMAIL&&(n.invalid=!f.validateEmail(n.email)),t?(n.query=n.query||n.email||n.name,s.push(n.pending=!0)):s.push(void 0);return s})()},this.finishLogging=e=>{const t=this.contactsDataSource.getStats().numLocalContacts;if(this._flush_unfinished_queries_cache(),this.props.shouldLogContactSearch)return this.contact_search_logger.log_records(this.props.user.id,e,t)},this._logTokenChangeEvent=(e,t=!1,s={})=>{if(this.contact_search_logger){if(t)return this.contact_search_logger.flag_record_as_removed(e.getContactID());{const t={context:this._getLoggingContext(),contact_type:e.type,contact_id:e.getContactID(),contact_name:e.name,sort_variant:null,event_ts:window.performance.now()};for(k in s)M=s[k],t[k]=M;return this.contact_search_logger.add_record(t)}}},this._logSearchComplete=(e,t,s=!0)=>{if(!this._shouldLogSearch()||!e)return;const n=window.performance.now();let i=this.unfinished_contact_search_queries[e];if(!i)return;const r=i.begin_time;!("ttfr"in i)&&t>0&&(i.ttfr=Math.floor(n-r)),s?(i.local_duration=Math.floor(n-r),i.num_local_results=t):(i.remote_duration=Math.floor(n-r),i.num_additional_remote_results=t),i.num_results+=t;return(()=>this.contactsDataSource.isSearchLocalOnly()&&s||!s)()?(i=this._prepareSearchStatsForLogging(i,e,n,!0),this.contact_search_logger.add_timing_record(i),this.contact_search_logger.count_search(i.is_slow),delete this.unfinished_contact_search_queries[e]):void 0},this._logSearchBegin=e=>{if(!this._shouldLogSearch()||!e)return;const t=window.performance.now();return this._flush_unfinished_queries_cache(t),this.unfinished_contact_search_queries[e]={begin_time:t,num_results:0}},this._shouldLogSearch=()=>this.props.shouldLogContactSearch&&null!=this.contact_search_logger,this._flush_unfinished_queries_cache=e=>{if(this._shouldLogSearch()){null==e&&(e=window.performance.now());for(const t in this.unfinished_contact_search_queries){let s=this.unfinished_contact_search_queries[t];e-s.begin_time{const i=e.begin_time;e.duration=Math.floor(s-i),"ttfr"in e?e.is_slow=e.ttfr>100:n&&0===e.num_results?e.is_slow=!1:e.is_slow=e.duration>100;const r=this.contactsDataSource.getStats().localContactsDownloadedTime;return e.started_before_download=null==r||i{let e="react_tokenizer";return null!=this.props.context&&(e+=`_${this.props.context}`),e},this.addExternalContacts=e=>this.refs.tokenizer.addExternalTokens(e),this._renderToken=e=>i.default.createElement(S,{contact:e,tabIndex:this.props.disableAdditionalInput?0:-1,tokenState:this.props.customContactValidator(e).state,tokenMaxLength:this.props.tokenMaxLength}),this._renderTokenHover=e=>this.props.customContactValidator(e).msg,this._autoSelectMatch=(e,t)=>{if(!t||!e)return null;e=this.contactsDataSource.normalizeQuery(e);const s={email:[],name:[]};for(const n of Array.from(t)){const t=n.email?this.contactsDataSource.normalizeQuery(n.email):null,i=n.name?this.contactsDataSource.normalizeQuery(n.name):null;e===t?s.email.push(n):e===i&&s.name.push(n)}for(const e of["email","name"])if(1===s[e].length)return s[e][0];return null},this._queryTokens=(e,t)=>{const s=e.filter(e=>e.pending&&e.query);if(!s.length)return;const n=Array.from(s).map(e=>e.query),i=[],r=s=>{const n=[];e=[];const r=this.serializeInputData(t).tokens;for(const t of Array.from(r)){let r=t;if(t.pending&&t.query){const e=this.contactsDataSource.normalizeQuery(t.query),n=this._autoSelectMatch(e,s[e]);n&&(r=n,i.push(n))}k=r.getKey(),Array.from(n).includes(k)||(n.push(k),e.push(r))}return i.length>0&&Promise.resolve(this._asyncValidateContacts(i)),t.replaceTokens(e)},a=r,o=r;return this.contactsDataSource.searchBatch(n,a,o)},this.tokenizeEmails=(e,t=!1)=>{let s;const n=/[,|;\n]+/,i=e.split(/[,|;\n ]+/);2===i.length&&f.validateEmail(i[0]+i[1])?(s=[i[0]+i[1]],t=!0):s=2===i.length&&f.validateEmail(i[0])&&""===i[1]?i:e.split(n);let r="";t||(r=s.pop());const a=[];for(const e of Array.from(s)){const t=e.trim();""!==t&&a.push(new c.Contact({name:t,email:t,type:_.default.EMAIL,invalid:!f.validateEmail(t),on_team:!1,pending:!0,query:t}))}return Promise.resolve(this._asyncValidateContacts(a)),{tokens:a,value:r}},this._asyncValidateContacts=e=>s.__awaiter(this,void 0,void 0,(function*(){this.props.asyncValidateContacts&&e.length>0&&(yield this.props.asyncValidateContacts(e))})),this._postSelect=e=>{this._asyncValidateContacts([e])},this.getInputValue=e=>(e||this.refs.tokenizer).getInputValue(),this.getContacts=()=>{const{tokens:e,value:t}=this.serializeInputData(),s=this.tokenizeEmails(t,!0);return e.concat(s.tokens)},this.removeAllTokens=()=>{const{tokens:e}=this.serializeInputData();this.refs.tokenizer.removeTokens(e)},this.tokenizeAll=()=>this.refs.tokenizer.tokenizeAll(),this.serializeInputData=this.serializeInputData.bind(this)}componentWillReceiveProps(e){e.user===this.props.user&&e.customContactFilter.toString()===this.props.customContactFilter.toString()||(this.contactsDataSource=this._initContactsDataSource(e)),this._validateTokens(null!=e.populatedInputData?e.populatedInputData.tokens:void 0)}componentWillMount(){this.contactsDataSource=this._initContactsDataSource(this.props),this._validateTokens(null!=this.props.populatedInputData?this.props.populatedInputData.tokens:void 0,!0)}componentDidMount(){const{shouldLogContactSearch:e,populatedInputData:t,onContentsChange:s}=this.props;if(e&&(this.contact_search_logger=new a.ContactSearchLogger(this._getLoggingContext(),this.contactsDataSource.searchModeName),this.unfinished_contact_search_queries={}),t.tokens&&t.tokens.length||t.value&&t.value.length){const{tokens:e,value:t}=this.serializeInputData();"function"==typeof s&&s(e,t)}}render(){return i.default.createElement(m.Tokenizer,{ref:"tokenizer",dataSource:this.contactsDataSource,customClass:this.props.customClass,initialInputText:this.props.populatedInputData.value,placeholderText:this.props.placeholder,renderSelector:()=>i.default.createElement(h.ContactsTypeaheadSelector,{showContactImport:this.props.showContactImport,teamGroupInfo:this.props.teamGroupInfo,user:this.props.user,listHeight:this.props.listHeight}),renderInput:()=>i.default.createElement(y.TextArea,{className:"contacts-tokenizer-input",id:this.props.id,rows:1,"aria-labelledby":`${this.props.label} ${this.props.id}`}),renderToken:this._renderToken,renderTokenHover:this._renderTokenHover,onContentsChange:this.props.onContentsChange,onTokensAdd:this._queryTokens,stringTokenizer:this.tokenizeEmails,populatedTokenData:this.props.populatedInputData.tokens,tabIndex:this.props.tabIndex,tokenSpacing:this.props.tokenSpacing,focusOnMount:this.props.focusOnMount,logSearchBegin:this._logSearchBegin,logSearchComplete:this._logSearchComplete,logTokenChangeEvent:this._logTokenChangeEvent,disableAdditionalInput:this.props.disableAdditionalInput,disabled:this.props.disabled,resetTokenData:this.props.resetTokenData,tokenizeOnOutOfFocus:this.props.tokenizeOnOutOfFocus,postSelect:this._postSelect,validatedTokenMap:this.props.validatedContactMap},this.props.children)}serializeInputData(e){return(e=e||this.refs.tokenizer).serializeInputData()}}t.ContactsTokenizer=C,C.displayName="ContactsTokenizer",C.propTypes={user:r.default.object.isRequired,context:r.default.string,customClass:r.default.string,customContactFilter:r.default.func,excludeDomainContacts:r.default.bool,customContactValidator:r.default.func,focusOnMount:r.default.bool,id:r.default.string,label:r.default.string,onContentsChange:r.default.func,placeholder:r.default.string,populatedInputData:r.default.shape({tokens:r.default.array,value:r.default.string}),tabIndex:r.default.number,showContactImport:r.default.bool,shouldLogContactSearch:r.default.bool,teamGroupInfo:r.default.shape({id:r.default.string,name:r.default.string}),tokenSpacing:r.default.number,disableAdditionalInput:r.default.bool,disabled:r.default.bool,resetTokenData:r.default.bool,customContactsDataSourceFactory:r.default.func,listHeight:r.default.number,tokenizeOnOutOfFocus:r.default.bool,asyncValidateContacts:r.default.func,validatedContactMap:r.default.object,tokenMaxLength:r.default.number},C.defaultProps={customContactFilter:e=>!0,customContactValidator:E.basic,excludeDomainContacts:!0,focusOnMount:!1,id:null,placeholder:g.intl.formatMessage({id:"dpTWyj",defaultMessage:"Invite more people"}),populatedInputData:{tokens:[],value:""},tokenSpacing:4,showContactImport:!1,shouldLogContactSearch:!1,teamGroupInfo:null,disableAdditionalInput:!1,disabled:!1,resetTokenData:!1,tokenizeOnOutOfFocus:!1,asyncValidateContacts:null,validatedContactMap:null,tokenMaxLength:22}})),define("metaserver/static/js/modules/clean/contacts/typeahead",["require","exports","tslib","classnames","create-react-class","react","prop-types","lodash","metaserver/static/js/modules/clean/avatar/contact_avatar","metaserver/static/js/modules/clean/contacts/types","metaserver/static/js/modules/clean/contacts/util","metaserver/static/js/modules/clean/css/css","metaserver/static/js/modules/clean/em_string","metaserver/static/js/modules/clean/profile_services/popup_handler","metaserver/static/js/modules/clean/profile_services/profile_services_constants","metaserver/static/js/modules/clean/profile_services/profile_services_link","metaserver/static/js/modules/clean/react/flag","metaserver/static/js/modules/clean/react/image","metaserver/static/js/modules/clean/react/paging_list","metaserver/static/js/modules/clean/react/sprite","metaserver/static/js/modules/clean/react/title_bubble","metaserver/static/js/modules/clean/static_urls","metaserver/static/js/modules/clean/typeahead","metaserver/static/js/modules/core/assert","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/clean/react/sticky_position"],(function(e,t,s,n,i,r,a,o,l,c,d,u,h,_,p,m,f,g,y,v,b,w,k,M,S,E,C){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThirdPartyImportOption=t.ExpandImportOption=t.ContactsTypeaheadSelectorOption=t.ContactsTypeaheadSelector=void 0,n=s.__importDefault(n),i=s.__importDefault(i),r=s.__importDefault(r),a=s.__importDefault(a),o=s.__importStar(o),l=s.__importDefault(l),c=s.__importDefault(c),d=s.__importDefault(d),u=s.__importStar(u),p=s.__importDefault(p),f=s.__importStar(f),y=s.__importDefault(y);const A=(e,t)=>o.assignIn({},e,t),D=A(k.TypeaheadSelectorMixin,{getOptions(){if(null==this.props.queryOptions)return[];if(this.state.importsExpanded)return Array.from(p.default.importable_contact_services()).map(e=>new P({provider:e,connected:this.profile_services.service_is_connected(e)}));const e=this.props.queryOptions.slice();return this.props.teamGroupInfo?e.push(d.default.teamGroupInfoToContact(this.props.teamGroupInfo)):(null!=this.profile_services?this.profile_services.has_unconnected_services(!0):void 0)&&e.push(new R),e},renderOption(e){return e instanceof R?r.default.createElement(x,null):e instanceof P?r.default.createElement(L,{import:e}):this.props.renderQueryOption(e)},onSelect(e){if(e instanceof R)return this._changeSelectionIndex(0),this.setState({importsExpanded:!0});if(e instanceof P){let t;if(M.assert((t=e.provider,Array.from(p.default.importable_contact_services()).includes(t)),`invalid party contact provider ${e.provider}`),this.profile_services.service_is_connected(e.provider)){const t=S.intl.formatMessage({id:"68wybz",defaultMessage:"You're already connected to {service_name}"},{service_name:p.default.to_name(e.provider)});return void E.Notify.success(t)}return this.link_handler.auth_service_with_user(e.provider,this.props.user.id,e=>m.ProfileServicesLinkingHandler.show_import_notifications(e))}return this.props.onSelect(e)},reset(){return this._changeSelectionIndex(0),this.setState({importsExpanded:!1})}}),I=i.default({displayName:"ContactsTypeaheadSelector",mixins:[D],propTypes:{customClass:a.default.string,onSelect:a.default.func.isRequired,queryOptions:a.default.array,renderQueryOption:a.default.func.isRequired,showContactImport:a.default.bool,teamGroupInfo:a.default.shape({id:a.default.string,name:a.default.string}),user:a.default.object.isRequired,listHeight:a.default.number},componentWillMount(){if(this.link_handler=new m.ProfileServicesLinkingHandler,this.profile_services=null,null===this.props.teamGroupInfo&&this.props.showContactImport&&null!=this.props.user)return this.profile_services=m.LinkedProfileServices.get_linked_profile_services_for_user(this.props.user.id)},componentWillReceiveProps(e){return 0===(null!=e.queryOptions?e.queryOptions.length:void 0)?this._changeSelectionIndex(-1):(null!=e.queryOptions?e.queryOptions.length:void 0)>0&&-1===this.state.selectionIndex?this._changeSelectionIndex(0):void 0},shouldComponentUpdate(e,t){return!o.isEqual(e,this.props)||!o.isEqual(t,this.state)},getDefaultProps:()=>({showContactImport:!1,teamGroupInfo:null,onSelect(e){},renderQueryOption:e=>r.default.createElement(T,{contact:e})}),onSelectionIndexChange(e){return null!=this.refs.pagingList?this.refs.pagingList.scrollAround(e):void 0},render(){if(u.require_css("/static/css/react/contacts_typeahead-vflS2VeQH.css"),!this.getOptions().length)return r.default.createElement("div",null);const e={"typeahead-selector":!0,"contacts-selector":!0};e[this.props.customClass]=null!=this.props.customClass;const{listHeight:t}=this.props;return r.default.createElement(y.default,{customClass:n.default(e),pageSize:4,itemSize:54,ref:"pagingList",listHeight:t},this.renderOptions())}});t.ContactsTypeaheadSelector=I;class T extends r.default.Component{constructor(){super(...arguments),this._renderPrimary=()=>this._renderMatch(this.props.contact.name,this.props.contact.nameMatch),this._renderSecondary=()=>{switch(this.props.contact.type){case c.default.EMAIL:return this.props.contact.email===this.props.contact.name?"":this._renderMatch(this.props.contact.email,this.props.contact.emailMatch);case c.default.FB:return S.intl.formatMessage({id:"k5ONol",defaultMessage:"Facebook message"});case c.default.NEW_STYLE_GROUP:return this.props.contact.members;default:return""}},this._renderMatch=(e,t)=>{if(e&&(e=h.Emstring.em_snippet(e,22)),!t)return e;const s=e.indexOf("…");let n=0;const i=[];for(const[a,o]of Array.from(t.highlighted)){a>n&&i.push(e.slice(n,a));let t=a+o;t>s&&-1!==s&&(t=s);const l=e.slice(a,t);i.push(r.default.createElement("strong",{key:`highlight-${l}-${a}`},l)),n=t}return nr.default.createElement("div",{className:"u-pad-right-xs"},r.default.createElement(l.default,{dimension:32,contact:this.props.contact,optionalClass:"contact-icon"})),this._renderDomainTooltip=()=>r.default.createElement("div",{className:"u-pad-right-xs"},r.default.createElement(b.TitleBubble,{content:S.intl.formatMessage({id:"r+IKuD",defaultMessage:"Suggested contact from your domain"}),position:C.StickyPosition.BOTTOM},r.default.createElement(v.Sprite,{group:"web",name:"info",alt:S.intl.formatMessage({id:"0BRgfC",defaultMessage:"Domain contact"})})))}render(){let e;e={"contacts-typeahead-option":!0},e[this.props.customClass]=null!=this.props.customClass,null!=this.props.className&&(e[this.props.className]=!0);let t={primary:this._renderPrimary(),secondary:this._renderSecondary()};return t=o.pickBy(t,e=>""!==e),r.default.createElement("li",Object.assign({},A(this.props,{className:n.default(e)})),r.default.createElement(f.Flag,{leftAttachment:this._renderIcon(),rightAttachment:this.props.contact.domain_contact?this._renderDomainTooltip():void 0},(()=>{const s=[];for(const i in t){const a=t[i];e={"option-only":1===o.size(t)},e[`option-${i}`]=!0,s.push(r.default.createElement("div",{className:n.default(e),key:`option-${i}`},a))}return s})()))}}t.ContactsTypeaheadSelectorOption=T,T.displayName="ContactsTypeaheadSelectorOption",T.propTypes={contact:a.default.object.isRequired,customClass:a.default.string};class R{constructor(){}getKey(){return"expand-importer"}}class x extends r.default.Component{render(){const e={"expand-imports-option":!0,"contacts-typeahead-option":!0};return null!=this.props.className&&(e[this.props.className]=!0),r.default.createElement("li",Object.assign({},A(this.props,{className:n.default(e)})),r.default.createElement(f.Flag,{leftAttachment:r.default.createElement(g.Image,{className:"u-pad-right-xs",src:w.static_url("/static/images/icons/icon-import-vflOL9sCs.png"),srcHiRes:w.static_url("/static/images/icons/icon-import@2x-vfluE8TBO.png")})},r.default.createElement("div",{className:"option-primary option-only"},S.intl.formatMessage({id:"Zq8VvX",defaultMessage:"Import contacts"}))))}}t.ExpandImportOption=x,x.displayName="ExpandImportOption";class P{constructor({provider:e,connected:t}){this.provider=e,this.connected=t}getKey(){return`third-party-import${this.provider}`}}class L extends r.default.Component{constructor(){super(...arguments),this.state={showSpinner:!1},this.show_contact_import_spinner=e=>{if(this.props.import.provider===e.provider)return this.setState({showSpinner:!0})}}componentDidMount(){return this.authCompleteListenerToken=_.addAuthCompleteListener(this.show_contact_import_spinner)}componentWillUnmount(){return _.removeAuthCompleteListener(this.authCompleteListenerToken)}render(){const{provider:e,connected:t}=this.props.import;let s=p.default.to_name(e);!t&&this.state.showSpinner&&(s=S.intl.formatMessage({id:"95l3d4",defaultMessage:"Importing {service_name} Contacts"},{service_name:s}));const i=t?S.intl.formatMessage({id:"wvm3tI",defaultMessage:"Connected"}):"",a={"third-party-option":!0,"contacts-typeahead-option":!0};return null!=this.props.className&&(a[this.props.className]=!0),r.default.createElement("li",Object.assign({},A(this.props,{className:n.default(a)})),!t&&this.state.showSpinner?r.default.createElement("div",{className:"option-spinner"},r.default.createElement("img",{src:"/static/images/icons/ajax-loading-small-blue-vflVk_QNP.gif"})):void 0,r.default.createElement(f.Flag,{spacing:"xs",leftAttachment:r.default.createElement(g.Image,{alt:"",src:w.static_url(p.default.to_img_legacy(e)[0]),srcHiRes:w.static_url(p.default.to_img_legacy(e)[1])})},r.default.createElement("div",{className:n.default({"option-primary":!0,"option-only":!t})},s,t?r.default.createElement("div",{className:"option-secondary u-font-meta"},i):void 0)))}}t.ThirdPartyImportOption=L,L.displayName="ThirdPartyImportOption",L.propTypes={import:a.default.object.isRequired}})),define("metaserver/static/js/modules/clean/contacts/types",["require","exports"],(function(e,t){"use strict";var s;Object.defineProperty(t,"__esModule",{value:!0}),(function(e){e[e.EMAIL=0]="EMAIL",e[e.FB=1]="FB",e[e.INVALID_ID=2]="INVALID_ID",e[e.NEW_STYLE_GROUP=4]="NEW_STYLE_GROUP",e[e.DBX_ID=5]="DBX_ID"})(s||(s={})),t.default=s})),define("metaserver/static/js/modules/clean/contacts/util",["require","exports","tslib","metaserver/static/js/modules/clean/contacts/contact","metaserver/static/js/modules/clean/contacts/types"],(function(e,t,s,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i=s.__importDefault(i);t.default=class{static activityUserToContact(e,t=0){return{dbx_account_id:e.unique_id,fname:e.fname,lname:e.lname,name:e.display_name,name_tokens:[e.fname,e.lname],email:e.email,type:i.default.DBX_ID,priority:t,photo_url:e.photo_circle_url}}static teamGroupInfoToContact(e){return new n.Contact({group_id:e.id,group_size:e.group_size,type:i.default.NEW_STYLE_GROUP,name:e.name,on_team:!0,pending:!1})}}})),define("metaserver/static/js/modules/clean/react/calendar",["require","exports","tslib","classnames","spectrum/dropdown_button/index","react","react-dom","metaserver/static/js/modules/clean/datetime/datetime","metaserver/static/js/modules/clean/react/components/css","metaserver/static/js/modules/clean/react/sprite","metaserver/static/js/modules/core/i18n"],(function(e,t,s,n,i,r,a,o,l,c,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Calendar=t.CalendarView=t.CalendarComponent=void 0,n=s.__importDefault(n),r=s.__importDefault(r),a=s.__importStar(a),o=s.__importStar(o);const u=37,h=38,_=39,p=40,m=()=>{};let f=0;const g=(e=new Date)=>{const t=new Date(e.getTime());t.setFullYear(t.getFullYear()-1);const s=new Date(e.getTime());return s.setFullYear(s.getFullYear()+1),{disabled:!1,isMaestroDesign:!1,firstDay:t,lastDay:s,alignAtLeft:!0,onDateChange:m,calendarIsInitiallyVisible:!1}};class y extends r.default.Component{constructor(){super(...arguments),this.state={currentDate:this.props.initDate,calendarIsVisible:this.props.calendarIsInitiallyVisible},this.setCalendarDateViewRef=e=>{this.refCalendarDateView=a.findDOMNode(e)},this.setCalendarViewRef=e=>{this.refCalendarView=a.findDOMNode(e)},this._handleDocumentClick=e=>{if(this.refCalendarView&&this.refCalendarDateView){const t=e.target;!this.state.calendarIsVisible||this.refCalendarView.contains(t)||this.refCalendarDateView.contains(t)||(e.preventDefault(),e.stopPropagation(),this.closeCalendar())}},this.toggleCalendarView=()=>{this.setState({calendarIsVisible:!this.state.calendarIsVisible})},this.handleDateSelected=e=>{this.setState({currentDate:e}),this.props.onDateChange(e),this.closeCalendar()},this.closeCalendar=()=>{this.setState({calendarIsVisible:!1}),this.refCalendarDateView&&this.refCalendarDateView.focus(),this.props.onCalendarClose&&this.props.onCalendarClose()},this._startOfDay=e=>{const t=new Date(e.getTime());return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},this._getDateViewText=()=>{const e=e=>o.format_date(e,o.localized_date_format);return this.props.placeholderText&&!this.props.initDate?this.props.placeholderText:this.state.currentDate?e(this.state.currentDate):e(new Date)}}componentDidMount(){document.addEventListener("click",this._handleDocumentClick)}componentWillUnmount(){document.removeEventListener("click",this._handleDocumentClick)}render(){const e={"c-datepicker":!0,"scooter-css u-l-fl clearfix":!this.props.isMaestroDesign};let t;return this.state.calendarIsVisible&&(t=r.default.createElement(w,{ref:this.setCalendarViewRef,alignAtLeft:this.props.alignAtLeft,firstDay:this._startOfDay(this.props.firstDay),lastDay:this._startOfDay(this.props.lastDay),initDate:this.state.currentDate||new Date,onDateChange:this.handleDateSelected,onCalendarClose:this.props.onCalendarClose,onEscapePressed:this.closeCalendar})),r.default.createElement("div",{className:n.default(e)},r.default.createElement(b,{buttonText:this._getDateViewText(),ref:this.setCalendarDateViewRef,calendarVisible:this.state.calendarIsVisible,disabled:this.props.disabled,isMaestroDesign:this.props.isMaestroDesign,onClick:this.toggleCalendarView,label:this.props.label,id:this.props.id}),t)}}function v(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}t.CalendarComponent=y,y.displayName="Calendar",y.__updateDefaultProps=e=>{y.defaultProps=g(e)},y.defaultProps=g();class b extends r.default.Component{constructor(){super(...arguments),this.renderLegacyCaret=()=>r.default.createElement(c.Sprite,{group:"web",name:"calendar_view_month",className:"u-l-fr",alt:this.props.description})}render(){const e={"is-active":this.props.calendarVisible,"c-input":!this.props.isMaestroDesign,"filter-item__filter-input":this.props.isMaestroDesign};if(this.props.isMaestroDesign)return r.default.createElement(i.DropdownButton,{disabled:this.props.disabled,onClick:this.props.onClick,"aria-expanded":this.props.calendarVisible,id:this.props.id,"aria-labelledby":`${this.props.label} ${this.props.id}`},this.props.buttonText);{const t=r.default.createElement("span",{className:"c-calendar__date-text"},this.props.buttonText);return r.default.createElement("button",{className:n.default(e),disabled:this.props.disabled,onClick:this.props.onClick,"aria-expanded":this.props.calendarVisible,id:this.props.id,"aria-labelledby":`${this.props.label} ${this.props.id}`},this.renderLegacyCaret(),t)}}}b.displayName="CalendarDateView",b.defaultProps={isMaestroDesign:!1,calendarVisible:!0,onClick:()=>{},disabled:!1,description:d.intl.formatMessage({id:"iOUGcl",defaultMessage:"Change deadline"})};class w extends r.default.Component{constructor(e){super(e),this.state={viewDate:this.props.initDate,currentlyActiveDate:this.props.initDate},this.clampToFirstLastDate=e=>{ethis.props.lastDay&&e.setTime(this.props.lastDay.getTime())},this.getDaysInMonth=e=>new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),this.setPrevMonthButtonRef=e=>{this.refPrevButton=e},this.setNextMonthButtonRef=e=>{this.refNextButton=e},this.setCurrentDayButtonRefAndMaintainFocus=e=>{const t=document.activeElement&&document.activeElement.getAttribute("data-day-in-month");this.refCurrentDayButton=e,this.refCurrentDayButton&&t&&this.refCurrentDayButton.focus()},this.handleDayClicked=e=>{const t=e.target,s=parseInt(t.getAttribute("data-day-in-month")||"",10),n=new Date(this.state.viewDate.getFullYear(),this.state.viewDate.getMonth(),s);this.setState({currentlyActiveDate:n}),this.props.onDateChange(n)},this.handleKeyDownOnDay=e=>{if(27===e.which)return this.props.onEscapePressed(),void e.preventDefault();if(9===e.which){let t;const s=this.refNextButton.classList.contains("u-l-dn")?null:this.refNextButton,n=this.refPrevButton.classList.contains("u-l-dn")?null:this.refPrevButton;return t=e.shiftKey?s||n:n||s,t&&t.focus(),void e.preventDefault()}if(-1!==[h,_,p,u].indexOf(e.which)){const t=1,s=this.getDaysInMonth(this.props.initDate),n=(this.state.currentlyActiveDate||this.props.initDate).getDate();let i=null;switch(e.which){case h:i=Math.max(t,n-7);break;case _:i=Math.min(s,n+1);break;case p:i=Math.min(s,n+7);break;case u:i=Math.max(t,n-1)}if(null!=i){const e=new Date(this.state.viewDate.getTime());e.setDate(i),this.clampToFirstLastDate(e),this.setState({currentlyActiveDate:e})}e.preventDefault()}},this.renderDay=(e,t)=>{const s=!t;this.props.lastDay&&(t=t||e>this.props.lastDay),this.props.firstDay&&(t=t||e{const e=[],t=new Date(this.state.viewDate.getFullYear(),this.state.viewDate.getMonth(),1);for(let s=t.getDay();s>0;s--){const n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-s),e.push(this.renderDay(n,!0))}let s=new Date(this.state.viewDate.getFullYear(),this.state.viewDate.getMonth(),1);for(;s.getMonth()===this.state.viewDate.getMonth();)e.push(this.renderDay(s)),s=new Date(this.state.viewDate.getFullYear(),this.state.viewDate.getMonth(),s.getDate()+1);let n=new Date(this.state.viewDate.getFullYear(),this.state.viewDate.getMonth()+1,0);for(;6!==n.getDay();)n=new Date(n.getFullYear(),n.getMonth(),n.getDate()+1),e.push(this.renderDay(n,!0));const i=[];let a=[];return e.forEach((e,t)=>{a.push(e),(t+1)%7==0&&(i.push(r.default.createElement("tr",{key:`week-${t}`},a)),a=[])}),i},this.offsetViewDateByMonth=e=>{this.setState({viewDate:new Date(this.state.viewDate.getFullYear(),this.state.viewDate.getMonth()+e,1)})},this.handleClickNextMonth=()=>{this.offsetViewDateByMonth(1)},this.handleClickPrevMonth=()=>{this.offsetViewDateByMonth(-1)},this.handleKeyDownMonthButton=e=>{if(27===e.which)return this.props.onEscapePressed(),void e.preventDefault();if(9===e.which){const t=!e.shiftKey;let s;const n=this.refNextButton.classList.contains("u-l-dn")?null:this.refNextButton,i=this.refPrevButton.classList.contains("u-l-dn")?null:this.refPrevButton,r=this.refCurrentDayButton;s=e.target===this.refPrevButton?t?n||r:r||n:t?r||i:i||r,s&&s.focus(),e.preventDefault()}},this.renderMonthChangers=()=>{const e=[],t=new Date(this.state.viewDate.getFullYear(),this.state.viewDate.getMonth(),1),s=new Date(this.state.viewDate.getFullYear(),this.state.viewDate.getMonth(),this.getDaysInMonth(this.state.viewDate)),i={"arrow-select":!0,"u-l-dn":t<=this.props.firstDay,"ax-focusable":!0,"u-l-fl":!0};e.push(r.default.createElement("button",{className:n.default(i),onClick:this.handleClickPrevMonth,ref:this.setPrevMonthButtonRef,onKeyDown:this.handleKeyDownMonthButton},r.default.createElement("span",{className:"c-arrow c-arrow--left u-thide"},d.intl.formatMessage({id:"RqKZIV",defaultMessage:"Previous month"}))));const a={"arrow-select":!0,"u-l-dn":s>=this.props.lastDay,"ax-focusable":!0,"u-l-fr":!0};return e.push(r.default.createElement("button",{className:n.default(a),onClick:this.handleClickNextMonth,ref:this.setNextMonthButtonRef,onKeyDown:this.handleKeyDownMonthButton},r.default.createElement("span",{className:"c-arrow c-arrow--right u-thide"},d.intl.formatMessage({id:"ir988d",defaultMessage:"Next month"})))),e},this.renderWeekdayRows=()=>[d.intl.formatMessage({id:"vF3QRb",defaultMessage:"Sunday"}),d.intl.formatMessage({id:"ky7rEH",defaultMessage:"Monday"}),d.intl.formatMessage({id:"QuQ7YS",defaultMessage:"Tuesday"}),d.intl.formatMessage({id:"Vla5t5",defaultMessage:"Wednesday"}),d.intl.formatMessage({id:"dgMd35",defaultMessage:"Thursday"}),d.intl.formatMessage({id:"0WboRK",defaultMessage:"Friday"}),d.intl.formatMessage({id:"FwY8UG",defaultMessage:"Saturday"})].map(e=>r.default.createElement("th",{key:e},r.default.createElement("abbr",{title:e},e.slice(0,3)))),this.calendarId=++f}componentDidMount(){this.refCurrentDayButton&&this.refCurrentDayButton.focus()}UNSAFE_componentWillUpdate(e,t){if(t.viewDate&&t.viewDate.getMonth()!==this.state.viewDate.getMonth()){const e=new Date(t.viewDate.getTime()),s=this.getDaysInMonth(t.viewDate);e.setDate(Math.min(s,this.state.currentlyActiveDate.getDate())),this.clampToFirstLastDate(e),this.setState({currentlyActiveDate:e})}}render(){const e={"c-calendar":!0,"c-card":!0,"u-pad-xs":!0,"u-left":this.props.alignAtLeft,"u-right":!this.props.alignAtLeft},t=`calendar-header-${++this.calendarId}`,[s,i]=this.renderMonthChangers(),a=r.default.createElement("strong",{id:t,"aria-live":"assertive","aria-atomic":"true"},d.intl.formatDate(this.state.viewDate,{year:"numeric",month:"long"}));return r.default.createElement("div",{className:n.default(e)},r.default.createElement("div",{className:"c-calendar__nav u-mar-bottom-s u-font-center u-cf"},s,i,a),r.default.createElement("table",{className:"c-calendar__picker"},r.default.createElement("thead",{className:"ax-visually-hidden"},r.default.createElement("tr",null,this.renderWeekdayRows())),r.default.createElement("tbody",null,this.renderDays())))}}t.CalendarView=w,w.displayName="CalendarView",w.defaultProps={onDateChange:m,onEscapePressed:m,alignAtLeft:!1},t.Calendar=l.requireCssWithComponent(y,["/static/css/scooter/scooter-scoped-vflRoCzLn.css","/static/css/components/calendar-vflL_rFOa.css"])})),define("metaserver/static/js/modules/clean/react/pass/constants",["require","exports"],(function(e,t){"use strict";var s;Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_FACEPILE_CLASSNAME=t.PRESENCE_RECEIVED_CLASSNAME=t.FACEPILE_CLASSNAME=t.MAX_OVERFLOW_BUTTON_INDICATOR=t.MAX_FACES_NORMAL=t.fetchingStatusIsError=t.fetchingStatusIsComplete=t.fetchingStatusIsSuccessful=t.fetchingStatusCanLogAsShown=t.fetchingStatusSeenStateIsComplete=t.PassPlatform=t.PassFetchingStatus=t.LoggingActions=t.EventTypes=t.ActionTypes=void 0,t.ActionTypes={PASS_PERMISSION_REQUEST:"PASS_PERMISSION_REQUEST",UPDATE_PERMISSIONS:"UPDATE_PERMISSIONS",FETCH_PASS_CONCLUDED:"FETCH_PASS_CONCLUDED",FETCH_PASS_ERROR:"FETCH_PASS_ERROR",UPDATE_USER_TEAM_INTERACTION_INFO:"UPDATE_USER_TEAM_INTERACTION_INFO",RECEIVE_PRESENCE_DELTA:"RECEIVE_PRESENCE_DELTA",RECEIVE_PRESENCE_SNAPSHOT:"RECEIVE_PRESENCE_SNAPSHOT",RESET_PASS_INFO:"RESET_PASS_INFO",UPDATE_SEEN_STATE_INFO:"UPDATE_SEEN_STATE_INFO",UPDATE_SEEN_STATE_INFO_CONTINUE:"UPDATE_SEEN_STATE_INFO_CONTINUE",DISCONTINUE_SEEN_STATE_INFO:"DISCONTINUE_SEEN_STATE_INFO",UPDATE_SEEN_STATE_UNAVAILABLE:"FETCH_SEEN_STATE_UNAVAILABLE"},t.EventTypes={PASS_CLICK:"PASS_CLICK",PASS_SHOWN:"PASS_SHOWN",PASS_HOVER:"PASS_HOVER"},t.LoggingActions={STATUS_BEGIN:"status_begin",STATUS_RECEIVE:"status_receive",SEEN_STATE_BEGIN:"seen_state_begin",SEEN_STATE_RECEIVE:"seen_state_receive",SEEN_STATE_USERS_BEGIN:"seen_state_users_begin",SEEN_STATE_USERS_RECEIVE:"seen_state_users_receive",TRANSMITTER_TOKEN_BEGIN:"transmitter_token_begin",TRANSMITTER_TOKEN_RECEIVE:"transmitter_token_receive",RECEIVER_TOKEN_BEGIN:"receiver_token_begin",RECEIVER_TOKEN_RECEIVE:"receiver_token_receive",PRESENCE_RECEIVE:"presence_receive",MEMBER_COUNTS_BEGIN:"member_counts_begin",MEMBER_COUNTS_RECEIVE:"member_counts_receive",LIST_MEMBERS_BEGIN:"list_members_begin",LIST_MEMBERS_RECEIVE:"list_members_receive",LIST_MEMBERS_NO_SEEN_STATE:"list_members_no_seen_state"},(function(e){e[e.NOT_YET_KNOWN=0]="NOT_YET_KNOWN",e[e.FETCHING=1]="FETCHING",e[e.ERROR=2]="ERROR",e[e.SEEN_STATE_SUCCESS=3]="SEEN_STATE_SUCCESS",e[e.SEEN_STATE_DISALLOWED=4]="SEEN_STATE_DISALLOWED",e[e.PRESENCE_SUCCESS=5]="PRESENCE_SUCCESS",e[e.PASS_SUCCESS=6]="PASS_SUCCESS",e[e.PASS_MIXED_SUCCESS=7]="PASS_MIXED_SUCCESS",e[e.CONCLUDED=8]="CONCLUDED"})(s=t.PassFetchingStatus||(t.PassFetchingStatus={})),(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEB=1]="WEB",e[e.MOBILE=2]="MOBILE",e[e.DESKTOP=3]="DESKTOP"})(t.PassPlatform||(t.PassPlatform={})),t.fetchingStatusSeenStateIsComplete=function(e){return-1!==[s.SEEN_STATE_SUCCESS,s.SEEN_STATE_DISALLOWED,s.PASS_SUCCESS,s.PASS_MIXED_SUCCESS,s.CONCLUDED].indexOf(e)},t.fetchingStatusCanLogAsShown=function(e){return e===s.PASS_SUCCESS||e===s.PASS_MIXED_SUCCESS},t.fetchingStatusIsSuccessful=function(e){return-1!==[s.PASS_SUCCESS,s.PASS_MIXED_SUCCESS,s.CONCLUDED].indexOf(e)},t.fetchingStatusIsComplete=function(e){return-1!==[s.PASS_SUCCESS,s.PASS_MIXED_SUCCESS,s.ERROR,s.CONCLUDED].indexOf(e)},t.fetchingStatusIsError=function(e){return e===s.ERROR},t.MAX_FACES_NORMAL=5,t.MAX_OVERFLOW_BUTTON_INDICATOR=99,t.FACEPILE_CLASSNAME="react-pass__facepile",t.PRESENCE_RECEIVED_CLASSNAME="facepile-presence-received",t.EMPTY_FACEPILE_CLASSNAME="react-pass__facepile--empty"})),define("metaserver/static/js/modules/clean/react/pass/utils",["require","exports","tslib","lodash","metaserver/static/js/modules/clean/react/pass/constants","metaserver/static/js/modules/core/user_i18n","metaserver/static/js/modules/core/browser","metaserver/static/js/modules/core/uri"],(function(e,t,s,n,i,r,a,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.navigateToSuggestModal=t.navigateToInviteModal=t.shouldIncrementOverflowBasisForAccessType=t.parsePlatformString=t.AnonymousViewerUtils=void 0,n=s.__importStar(n),r=s.__importStar(r),a=s.__importStar(a),(function(e){function t(e){return e.startsWith("dbafvid:")}e.isAnonymousUserId=t,e.isAnonymousSeenState=function(e){return t(e.seen_state_user.user_id)},e.getAnonymousUserIds=function(e){return n.filter(e,t)},e.filterAnonymousUserIds=function(e){return n.reject(e,t)},e.getAnonymousViewerInitials=function(e){return r.isCjkLocale()&&1===e.split(" ").length?e.substring(0,1):r.getInitials(e)}})(t.AnonymousViewerUtils||(t.AnonymousViewerUtils={})),t.parsePlatformString=function(e){switch(e){case"web":return i.PassPlatform.WEB;case"mobile":return i.PassPlatform.MOBILE;case"desktop":return i.PassPlatform.DESKTOP}return i.PassPlatform.UNKNOWN},t.shouldIncrementOverflowBasisForAccessType=function(e){if(e)switch(e.type){case"link_only":case"view_link_access":case"edit_link_access":return!0;case"view_member_access":case"edit_member_access":return e.value.group_access_only}return!1},t.navigateToInviteModal=function(e=[]){const t={};return e.length>0&&btoa?t.invite_emails=btoa(e.join(",")):t.show_invite_members="1",a.redirect(new o.URI({path:"/team/admin/members",query:t}))},t.navigateToSuggestModal=function(e=[]){const t={suggest_members:"1"};return e.length>0&&btoa&&(t.invite_emails=btoa(e.join(","))),a.redirect(new o.URI({path:"/team",query:t}))}})),define("metaserver/static/js/modules/clean/react/select",["require","exports","tslib","classnames","create-react-class","react","react-dom","prop-types","lodash","jquery","ts-keycode-enum","metaserver/static/js/modules/clean/react/form_error_mixin","metaserver/static/js/modules/clean/react/hidden","metaserver/static/js/modules/clean/react/sprite","metaserver/static/js/modules/clean/react/util","metaserver/static/js/modules/core/dom"],(function(e,t,s,n,i,r,a,o,l,c,d,u,h,_,p,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.option=t.input=void 0,n=s.__importDefault(n),i=s.__importDefault(i),r=s.__importDefault(r),a=s.__importStar(a),o=s.__importDefault(o),l=s.__importStar(l),c=s.__importDefault(c),u=s.__importDefault(u),p=s.__importStar(p),m=s.__importStar(m);const f=o.default.oneOfType([o.default.string,o.default.number]);class g extends r.default.Component{constructor(){super(...arguments),this.state={id:l.uniqueId("option")}}UNSAFE_componentWillReceiveProps(e){if(null!=e.id)return this.setState({id:e.id})}render(){const e={"list-item":!0,"select-option":!0,"select-option-disabled":this.props.disabled};null!=this.props.className&&(e[this.props.className]=!0);const t=this.props.value;return r.default.createElement("div",Object.assign({},this.props,{"data-value":t,id:this.state.id,role:"option",className:n.default(e),"aria-disabled":this.props.disabled}),this.props.children)}}t.option=g,g.displayName="selectOption",g.propTypes={id:o.default.string,className:o.default.string,disabled:o.default.bool,title:o.default.string,value:f,error:o.default.shape({message_text:o.default.string,message_html:o.default.string})};const y=i.default({displayName:"selectInput",mixins:[u.default],mouseInput:!0,propTypes:{name:o.default.string,onChange:o.default.func,defaultValue:f,style:o.default.object,value:f,variant:o.default.string,className:o.default.string,ariaLabelId:o.default.string,ariaDescriptionId:o.default.string,valueLink:o.default.object,isDisabled:o.default.bool,headerElement:o.default.element},getDefaultProps:()=>({errorWrapperClassName:"select-input-error-wrapper",ariaLabelId:"",ariaDescriptionId:"",style:null,headerElement:null}),getInitialState(){return{open:!1,focused:null,keyboarsSelectPrefix:"",selectOptionId:l.uniqueId("selected-option"),listboxId:l.uniqueId("listbox"),value:this.props.defaultValue}},_getFilteredChildren(){return l.isArray(this.props.children)?l.filter(this.props.children,e=>e):this.props.children},render(){const e={"select-input":!0,"select-input-dropdown-shown":this.state.open,"select-input-disabled":this.props.isDisabled};this.props.variant&&(e[this.props.variant]=!0),this.props.className&&(e[this.props.className]=!0);const t={"list-menu":!0,"select-input-dropdown":!0,"select-input-disable-error":this.props["disable-errors"]},s=this.renderErrorIfEnabled();let i=this.props.ariaDescriptionId;((null!=this.props.error?this.props.error.message_text:void 0)||null!=(null!=this.props.error?this.props.error.message_html:void 0))&&(i=s.props.id);const a=this.selectedOption();return r.default.createElement("div",{className:n.default(e),style:this.props.style,ref:"wrapperDiv"},s,r.default.createElement("button",{className:"select-input-button","aria-expanded":this.state.open,"aria-describedby":i,"aria-controls":this.state.listboxId,"aria-labelledby":this.props.ariaLabelId+" "+a.props.id,ref:"selectButton",tabIndex:0,onClick:this.handleClickOnInputButton},r.default.createElement("div",{className:"select-input-input filter-item__filter-input",ref:"label"},a,r.default.createElement("div",{className:"select-input-dropdown-arrow"},r.default.createElement(_.Sprite,{group:"web",name:"arrow-down-gray",alt:""})))),r.default.createElement(h.HiddenSelect,{name:this.props.name,defaultValue:this.props.defaultValue,value:this.getValue(),options:(()=>{const e=[];return r.default.Children.forEach(this._getFilteredChildren(),t=>e.push(t.props.value)),e})()}),r.default.createElement("div",{className:"hidden-option-container"},r.default.createElement("div",{id:this.state.listboxId,className:n.default(t),role:"listbox",onKeyDown:this.handleKeydown,onMouseMove:this.handleMouseMove,tabIndex:-1,ref:"dropdown"},this.menuChildren())))},handleMouseMove(e){let t;if(!this.props.isDisabled){e.pageX===s&&e.pageY===t||(this.mouseInput=!0);var s=e.pageX;return e.pageY}},_commonPrefixLen(e,t){e=e.trim().toLowerCase(),t=t.trim().toLowerCase();let s=0;for(;s=this._commonPrefixLen(e,n.text)?this.setState({keyboarsSelectPrefix:e,focused:s.value}):this.setState({keyboarsSelectPrefix:e,focused:n.value})},handleKeydown(e){if(!this.props.isDisabled){switch(this.mouseInput=!1,e.keyCode){case d.Key.Tab:return this.setState({open:!1,focused:null}),!0;case d.Key.Enter:case d.Key.Space:this.state.open&&this.state.focused?(this.setValue(this.state.focused),this.setState({open:!1})):this.toggle();break;case d.Key.Escape:if(this.state.open){const e=this.getValue();this.setValue(e),this.setState({open:!1})}break;case d.Key.UpArrow:this.state.open?this.setState({focused:this.prev(this.state.focused)}):this.setState({open:!0});break;case d.Key.DownArrow:this.state.open?this.setState({focused:this.next(this.state.focused)}):this.setState({open:!0});break;default:if(!this.state.open)return!0;if(!l.values(d.Key).includes(e.keyCode)){const t=String.fromCharCode(e.which),s=this.state.keyboarsSelectPrefix+t;this._keyboardSelect(s),this._keyboardSelect_timeout&&clearTimeout(this._keyboardSelect_timeout),this._keyboardSelect_timeout=setTimeout(()=>(this.setState({keyboarsSelectPrefix:""}),this._keyboardSelect_timeout=null),500)}}return!1}},prev(e){let t=null,s=null;return r.default.Children.forEach(this._getFilteredChildren(),n=>{if(s||n.props.disabled||(s=n),n.props.value===e&&(t=s),!n.props.disabled)return s=n}),null!=t?t.props.value:void 0},next(e){var t;let s=null,n=null;return r.default.Children.forEach(this._getFilteredChildren(),t=>{if(!t.props.disabled)return(null!=n?n.props.value:void 0)===e&&(s=t),n=t}),null===(t=s||n)||void 0===t?void 0:t.props.value},menuChildren(){const e=this.getValue();return r.default.Children.map(this._getFilteredChildren(),t=>r.default.cloneElement(t,{onMouseEnter:()=>{if(m.scroll_lock_document(),this.mouseInput)return this.setState({focused:t.props.value})},onMouseOut:()=>m.scroll_unlock_document(),onClick:()=>{if(!t.props.disabled)return this.setState({open:!1}),this.setValue(t.props.value)},className:n.default({"focused-option":null!=this.state.focused&&this.state.focused===t.props.value,"selected-option":e===t.props.value},t.props.className)}))},componentWillMount(){const e=r.default.Children.map(this._getFilteredChildren(),e=>({value:e.props.value,text:p.getText(e).trim().toLowerCase()}));return this.sortedOptions=l.sortBy(e,"text")},componentDidMount(){return this.globalMenuCloser=e=>{if(this.state.open){const t=c.default(e.target).closest(".select-input");if(!t.length||t[0]!==a.findDOMNode(this.refs.wrapperDiv))return this.setState({open:!1,focused:null})}},c.default(document).on("click",this.globalMenuCloser)},componentWillUnmount(){return c.default(document).off("click",this.globalMenuCloser)},componentDidUpdate(e,t){let s;const n=c.default(a.findDOMNode(this.refs.dropdown)),i=c.default(a.findDOMNode(this.refs.selectButton));this.state.open&&(s=n.find(`[data-value='${this.state.focused}']`),n.attr("aria-activedescendant",s.attr("id"))),this.state.open&&this.state.focused&&null==this.props.headerElement&&(s=n.find(`[data-value='${this.state.focused}']`),n.attr("aria-activedescendant",s.attr("id")),(function(e,t){const s=e.scrollTop(),n=s+e.height(),i=t.position().top+s,r=i+t.height();in&&e.scrollTop(r-e.height())})(n,s));const r=t.open&&!this.state.open;if(!t.open&&this.state.open&&n.focus(),r)return i.focus()},selectedOption(){let e=null;return null!=this.props.headerElement?this.props.headerElement:(r.default.Children.forEach(this._getFilteredChildren(),t=>{if(e||(e=t),(null!=t?t.props.value:void 0)===this.getValue())return e=t}),e?r.default.cloneElement(e,{id:this.state.selectOptionId}):null)},handleClickOnInputButton(e){return e.preventDefault(),this.toggle()},toggle(){if(!this.props.isDisabled)return this.state.open?this.setState({open:!1,focused:null}):this.setState({open:!0,focused:this.getValue()})},getValue(){let e,t;return null!=(e=null!=(t=null!=this.props.value?this.props.value:null!=this.props.valueLink?this.props.valueLink.value:void 0)?t:this.state.value)?e:this.props.defaultValue},setValue(e){const t=this.getValue();if(this.props.valueLink?this.props.valueLink.requestChange(e):this.setState({value:e}),t!==e||null!=this.props.headerElement)return"function"==typeof this.props.onChange?this.props.onChange(t,e):void 0}});t.input=y})),define("metaserver/static/js/modules/clean/sharing/api/client",["require","exports","tslib","immutable","lodash","metaserver/static/js/api_v2/error","metaserver/static/js/api_v2/types","metaserver/static/js/api_v2/user_client","metaserver/static/js/modules/clean/sharing/api/types/metadata","metaserver/static/js/modules/clean/sharing/api/util/types","metaserver/static/js/modules/clean/sharing/access_level","spectrum-sharing/utils/sharing_constants","metaserver/static/js/modules/clean/viewer","metaserver/static/js/modules/core/assert","metaserver/static/js/modules/constants/sharing"],(function(e,t,s,n,i,r,a,o,l,c,d,u,h,_,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShareApiClient=t.ShareError=t.MockShareApiClient=t.FolderShareApiClient=t.FileShareApiClient=void 0,n=s.__importStar(n),i=s.__importStar(i);class m extends Error{constructor(e){super(),this.message=e,this.name="ShareError",this.stack=(new Error).stack}}t.ShareError=m;class f extends o.UserApiV2Client{constructor({userId:e,isNonUserRelativeContext:t},s){super(s),null==t&&(t=!1),this.userId=e,t&&null==this.teamMemberId&&(this.teamMemberId=h.Viewer.get_viewer().work_user.team_member_id)}static initClass(){this.prototype._getAccountBatchCache={},this.prototype._getCurrentAccountCache=null}_headers(e){return null!=this.teamMemberId?Object.assign({[a.ApiV2HeaderNames.DropboxApiSelectAdmin]:this.teamMemberId},super._headers(e)):super._headers(e)}targetsSearch(e,t){return this.ns("sharing").rpc("targets/search",e,{signal:t,subjectUserId:this.userId})}validateMembers({contentId:e,accessLevel:t,members:s}){throw new TypeError("Not implemented")}_validateMembers({contentId:e,contentType:t,accessLevel:s,members:n}){return this.ns("sharing").rpc("targets/validate",{access_level:c.accessLevelConstToApi(s),content_type:t,content_id:e,members:n},{subjectUserId:this.userId})}addMembers({contentId:e,members:t,accessLevel:s,customMessage:n=null,quiet:i=!1,addMessageAsComment:r}){throw new TypeError("Not implemented")}addMembersWithAccessLevel({contentId:e,members:t,customMessage:s=null,quiet:n=!1}){throw new TypeError("Not implemented")}removeMember({contentId:e,memberId:t}){throw new TypeError("Not implemented")}getMetadata({contentId:e,isInSharedFolder:t,actions:s=[]}){throw new TypeError("Not implemented")}getMetadataInternal({contentId:e,actions:t=[]}){throw new TypeError("Not implemented")}getMetadataAlpha({contentId:e,actions:t=[]}){throw new TypeError("Not implemented")}listMembers({contentId:e,isAlpha:t}){throw new TypeError("Not implemented")}listMembersContinue({cursor:e,isAlpha:t}){throw new TypeError("Not implemented")}getMemberCounts({contentId:e}){throw new TypeError("Not implemented")}getParentFolderAccess({contentId:e,memberId:t,accessLevel:s}){throw new TypeError("Not implemented")}updateMember({contentId:e,memberId:t,accessLevel:s}){throw new TypeError("Not implemented")}dismissInviteNotification({contentId:e}){return this.ns("sharing").rpc("dismiss_invite_notification",{content_id:e},{subjectUserId:this.userId})}getSharingPrefs(){return this.ns("users").rpc("get_sharing_prefs",void 0,{subjectUserId:this.userId}).then(c.sharingPrefsApiToRecord)}setSharingPrefs(e){return this.ns("users").rpc("set_sharing_prefs",e,{subjectUserId:this.userId})}claimMembership({contentUrl:e}){return this.ns("sharing").rpc("claim_membership",{content_url:e},{subjectUserId:this.userId})}checkJobStatus({jobId:e}){return this.ns("sharing").rpc("check_job_status",{async_job_id:e},{subjectUserId:this.userId})}getAccountBatch({accountIds:e}){return e.length>0?(p.SHARING_EXPERIMENTS.FIX_MAX_ACCOUNT_BATCH_SIZE&&e.length>300&&(e=e.slice(0,300)),this.ns("users").rpc("get_account_batch",{account_ids:e},{subjectUserId:this.userId}).then(e=>e.map(c.accountInfoApiToRecord))):Promise.resolve([])}getAccountBatchCached({accountIds:e}){const t=this._getAccountBatchCache,[s,n]=Array.from(i.partition(e,e=>e in t)),r=i.values(i.pick(t,s));return this.getAccountBatch({accountIds:n}).then(e=>{const s=i.zipObject(e.map(e=>e.account_id),e);return this._getAccountBatchCache=Object.assign(Object.assign({},t),s),e.concat(r)})}resetGetAccountBatchCache(){return this._getAccountBatchCache={}}getCurrentAccount(e){return this.ns("users").rpc("get_current_account",void 0,{subjectUserId:this.userId}).then(e=>c.fullAccountApiToRecord(e))}getCurrentAccountCached(e){return null==this._getCurrentAccountCache&&(this._getCurrentAccountCache=this.getCurrentAccount()),this._getCurrentAccountCache}resetGetCurrentAccountCache(){return this._getCurrentAccountCache={}}requestAccess({contentUrl:e,customMessage:t}){return this.ns("sharing").rpc("request_access",{content_url:e,custom_message:t},{subjectUserId:this.userId})}sharedLinkInfo({fileIdOrPath:e}){return _.assert(null!=e,"an fqPath or fileId must be present to retrieve shared link info"),this.ns("sharing").rpc("alpha/list_shared_links",{path:e,direct_only:!0},{subjectUserId:this.userId}).then((function(e){return e.links.map(e=>c.linkMetadataApiToRecord(e))}))}createSharedLinkNonAlpha({fileIdOrPath:e,settings:t}){return _.assert(null!=e,"an fqPath or fileId must be present to retrieve shared link info"),this.ns("sharing").rpc("create_shared_link_with_settings",{path:e,settings:t},{subjectUserId:this.userId}).then(c.linkMetadataApiToRecord)}createSharedLink({fileIdOrPath:e,settings:t}){return _.assert(null!=e,"an fqPath or fileId must be present to retrieve shared link info"),this.ns("sharing").rpc("alpha/create_shared_link_with_settings",{path:e,settings:t},{subjectUserId:this.userId}).then(c.linkMetadataApiToRecord)}modifySharedLinkSettings({url:e,settings:t,remove_expiration:s}){return this.ns("sharing").rpc("alpha/modify_shared_link_settings",{url:e,settings:t,remove_expiration:s},{subjectUserId:this.userId}).then(c.linkMetadataApiToRecord)}revokeSharedLink({url:e}){return this.ns("sharing").rpc("revoke_shared_link",{url:e},{subjectUserId:this.userId})}listReceivedContent(e=5,t){return this.ns("sharing").rpc("received",{limit:e,share_type:t},{subjectUserId:this.userId}).then(c.listContentResultApiToRecord)}listReceivedContentContinue(e,t){return this.ns("sharing").rpc("received/continue",{cursor:e,share_type:t},{subjectUserId:this.userId}).then(c.listContentResultApiToRecord)}listSentContent(e=5){return this.ns("sharing").rpc("sent",{limit:e},{subjectUserId:this.userId}).then(c.listContentResultApiToRecord)}listSentContentContinue(e){return this.ns("sharing").rpc("sent/continue",{cursor:e},{subjectUserId:this.userId}).then(c.listContentResultApiToRecord)}_addAccountsToMembership(e){return this._addAccountsToMembershipBatch(n.Map([[1,e]])).then(e=>e.get(1))}_addAccountsToMembershipBatch(e){const t=e.valueSeq().flatMap(e=>e.users.valueSeq()).map(e=>e.memberId()).toSet().toArray();return t.length>0?this.getAccountBatchCached({accountIds:t}).then((function(t){const s=n.Map(t.map(e=>[e.account_id,e]));return e.map((e,t)=>e.set("users",e.users.map(e=>{const t=s.get(e.account_id);return null!=t?e.set("account",t):e})))})):Promise.resolve(e)}}t.ShareApiClient=f,f.initClass();t.MockShareApiClient=class extends f{constructor({userId:e,isNonUserRelativeContext:t}){super({userId:e,isNonUserRelativeContext:t}),this.getMetadata=this.getMetadata.bind(this),this.getMetadataInternal=this.getMetadataInternal.bind(this),this.getMetadataAlpha=this.getMetadataAlpha.bind(this),this.validateFqPath=this.validateFqPath.bind(this),this._promises={}}targetsSearch(e,t){return this.createPromise("targetsSearch")}validateMembers({contentId:e,accessLevel:t,members:s}){return this.createPromise("validateMembers")}addMembers({contentId:e,members:t,accessLevel:s,customMessage:n=null,quiet:i=!1,addMessageAsComment:r}){return this.createPromise("addMembers")}addMembersWithAccessLevel({contentId:e,members:t,customMessage:s=null,quiet:n=!1}){return this.createPromise("addMembersWithAccessLevel")}getMetadata({contentId:e,isInSharedFolder:t,actions:s=[]}){return this.createPromise("getMetadata")}getMetadataInternal({contentId:e,actions:t=[]}){return this.createPromise("getMetadataInternal")}getMetadataAlpha({contentId:e,actions:t=[]}){return this.createPromise("getMetadataAlpha")}dismissInviteNotification({contentId:e,cursor:t=null}){return this.createPromise("dismissInviteNotification")}getSharingPrefs(){return this.createPromise("getSharingPrefs")}listMembers({contentId:e,isAlpha:t}){return this.createPromise("listMembers")}listMembersContinue({cursor:e,isAlpha:t}){return this.createPromise("listMembersContinue")}getMemberCounts({contentId:e}){return this.createPromise("getMemberCounts")}getParentFolderAccess({contentId:e,memberId:t,accessLevel:s}){return this.createPromise("getParentFolderAccess")}removeMember({contentId:e,memberId:t}){return this.createPromise("removeMember")}setLinkSettings({linkSettings:e,url:t}){return this.createPromise("setLinkSettings")}share({fqPath:e,memberPolicy:t=null,aclUpdatePolicy:s=null,sharedLinkPolicy:n=null,forceAsync:i=!1}){return this.createPromise("share")}shareInternal({fqPath:e,folderPolicy:t=null,forceAsync:s=!1,confidential:n=!1}){return this.createPromise("shareInternal")}requestAccess({contentUrl:e,customMessage:t}){return this.createPromise("requestAccess")}sharedLinkInfo({fileIdOrPath:e}){return this.createPromise("sharedLinkInfo")}transferContent({contentId:e,memberId:t}){return this.createPromise("transferContent")}createSharedLink({fileIdOrPath:e}){return this.createPromise("createSharedLink")}updateMember(){return this.createPromise("updateMember")}updatePolicyAlpha(){return this.createPromise("updatePolicyAlpha")}validateFqPath({fqPath:e,actions:t=[]}){return this.createPromise("validateFqPath")}getCurrentAccountCached(e){return this.createPromise("getCurrentAccountCached")}modifySharedLinkSettings({url:e,settings:t,remove_expiration:s}){return this.createPromise("modifySharedLinkSettings")}revokeSharedLink({url:e}){return this.createPromise("revokeSharedLink")}relinquishMembership({contentId:e,leaveACopy:t=!1}){return this.createPromise("relinquishMembership")}setConfidentiality({contentId:e,confidential:t,keep_inherited_members:s=!1}){return this.createPromise("setConfidentiality")}validatePathContinue(e,t){return this.createPromise("validatePathContinue")}createPromise(e){let t=this._promises[e];return t&&t.calledBeforeCreatePromise?(this._promises[e]=null,t.promise):(t={},t.promise=new Promise((function(e,s){return t.resolve=e,t.reject=s})),this._promises[e]=t,t.promise)}getPromise(e){return null!=this._promises[e]?this._promises[e].promise:void 0}resolvePromise(e,t,s=!1){this._promises[e]||this.createPromise(e);const n=this._promises[e];return n.calledBeforeCreatePromise=s,n.resolve.apply(null,t),n.promise}rejectPromise(e,t,s=!1){this._promises[e]||this.createPromise(e);const n=this._promises[e];return n.calledBeforeCreatePromise=s,n.reject.apply(null,t),n.promise}};t.FileShareApiClient=class extends f{constructor({userId:e,isNonUserRelativeContext:t}){super({userId:e,isNonUserRelativeContext:t}),this.getMetadata=this.getMetadata.bind(this),this.getMetadataAlpha=this.getMetadataAlpha.bind(this),this.getMetadataBatchAlpha=this.getMetadataBatchAlpha.bind(this)}validateMembers({contentId:e,accessLevel:t,members:s}){return this._validateMembers({accessLevel:t,contentId:e,members:s,contentType:l.ContentTypes.File})}addMembers({contentId:e,members:t,customMessage:s=null,quiet:n=!1,accessLevel:i,addMessageAsComment:r=!1}){null==i&&(i=d.ACCESS_LEVEL.READER);const a=c.accessLevelConstToApi(i);return 0===(null!=s?s.length:void 0)&&(s=null),this.ns("sharing").rpc("add_file_member",{file:e,members:t,custom_message:s,quiet:n,access_level:a,add_message_as_comment:r},{subjectUserId:this.userId})}removeMember({contentId:e,memberId:t}){return this.ns("sharing").rpc("remove_file_member_2",{file:e,member:c.makeMemberSelector(t)},{subjectUserId:this.userId}).then(e=>c.memberAccessLevelApiToRecord(this.userId,e))}getMetadata({contentId:e,isInSharedFolder:t,actions:s=[]}){return this.ns("sharing").rpc("get_file_metadata",{file:e,actions:s},{subjectUserId:this.userId}).then(c.fileMetadataApiToRecord)}getMetadataAlpha({contentId:e,actions:t=[],sourceURL:s}){return this.ns("sharing").rpc("alpha/get_file_metadata",{file:e,actions:t,url:s},{subjectUserId:this.userId}).then(c.fileMetadataApiToRecord)}getMetadataBatchAlpha({contentIds:e,actions:t=[]}){return this.ns("sharing").rpc("alpha/get_file_metadata/batch",{files:e,actions:t},{subjectUserId:this.userId}).then(e=>e.map(e=>c.fileMetadataApiToRecord(e.result)))}listMembers({contentId:e,url:t=null,limit:s,isAlpha:n=!1,includeSeenState:i}){null==s&&(s=100),null==i&&(i=!0);const r={file:e,actions:u.MEMBER_ACTION.ALL,include_inherited:!0,limit:s,url:n?t:void 0,include_seen_state:i},a=this.ns("sharing");return(n?a.rpc("alpha/list_file_members",r,{subjectUserId:this.userId}):a.rpc("list_file_members",r,{subjectUserId:this.userId})).then(c.membershipApiToRecord).then(this._addAccountsToMembership.bind(this))}listMembersContinue({cursor:e,url:t=null,isAlpha:s=!1}){const n={cursor:e,url:s?t:void 0},i=this.ns("sharing");return(s?i.rpc("alpha/list_file_members/continue",n,{subjectUserId:this.userId}):i.rpc("list_file_members/continue",n,{subjectUserId:this.userId})).then(e=>c.membershipApiToRecord(e,null)).then(this._addAccountsToMembership.bind(this))}listMembersBatch({contentIds:e,limit:t}){return null==t&&(t=10),this.ns("sharing").rpc("list_file_members/batch",{files:e,limit:t},{subjectUserId:this.userId}).then((function(e){const t={};for(const s of Array.from(e))"result"===s.result[".tag"]&&(t[s.file]=c.membershipApiToRecord(s.result.members,s.result.member_count));return n.Map(t)})).then(this._addAccountsToMembershipBatch.bind(this))}getMemberCounts({contentId:e,limit:t,countGroupsAsMembers:s=!1,url:n=null,runViewerInfoChecks:i=!1}){return this.ns("sharing").rpc("get_file_member_counts",{file:e,limit:t,count_groups_as_members:s,url:n,run_viewer_info_checks:i},{subjectUserId:this.userId})}getParentFolderAccess({contentId:e,memberId:t,accessLevel:s}){throw new m("Parent folder access points not implemented for files")}relinquishMembership({contentId:e}){return this.ns("sharing").rpc("relinquish_file_membership",{file:String(e)},{subjectUserId:this.userId})}listReceivedFiles({limit:e,actions:t,descending:s}){return null==e&&(e=100),null==t&&(t=[]),null==s&&(s=!1),this.ns("sharing").rpc("list_received_files",{limit:e,actions:t,descending:s},{subjectUserId:this.userId}).then(c.listFilesResultApiToRecord)}listReceivedFilesContinue({cursor:e}){return this.ns("sharing").rpc("list_received_files/continue",{cursor:e},{subjectUserId:this.userId}).then(c.listFilesResultApiToRecord)}updateMember({contentId:e,memberId:t,accessLevel:s}){return this.ns("sharing").rpc("update_file_member",{file:String(e),member:c.makeMemberSelector(t),access_level:c.accessLevelConstToApi(s)},{subjectUserId:this.userId}).then(e=>c.memberAccessLevelApiToRecord(this.userId,e))}updatePolicy({contentId:e,newPolicy:t,actions:s}){const n=c.combinedPolicyDiffToApi(t);return n.actions=s,n.file=e,this.ns("sharing").rpc("alpha/update_file_policy",n,{subjectUserId:this.userId}).then((function(e){return null!=e.metadata&&({metadata:e}=e),c.fileMetadataApiToRecord(e)}))}unshare({contentId:e}){return this.ns("sharing").rpc("unshare_file",{file:String(e)},{subjectUserId:this.userId})}};t.FolderShareApiClient=class extends f{constructor({userId:e,isNonUserRelativeContext:t}){super({userId:e,isNonUserRelativeContext:t}),this.getMetadata=this.getMetadata.bind(this),this.validateFqPath=this.validateFqPath.bind(this),this.updatePolicy=this.updatePolicy.bind(this),this.updatePolicyAlpha=this.updatePolicyAlpha.bind(this)}share({fqPath:e,folderPolicy:t,confidential:s=!1,checkFSWs:n=!1,syncSetting:i=null,should_be_new_path:r=null,intervalMs:a=1e3,timeoutMs:o=null}){const l=c.combinedPolicyDiffToApi(t);return l.path=e,l.confidentiality=s?"confidential":"not_confidential",n&&(l.fsw_request="check"),null!==i&&(l.sync_setting=i),null!==r&&(l.should_be_new_path=r),this.ns("sharing").rpc("alpha/share_folder",l,{subjectUserId:this.userId}).then(e=>("complete"===e[".tag"]?Promise.resolve(e):g(this.checkShareJobStatus.bind(this,{jobId:e.async_job_id}),{interval:a,timeout:o})).then(c.folderMetadataApiToRecord))}shareWithFsws(e){return this.share(Object.assign(Object.assign({},e),{checkFSWs:!0})).then(e=>({metadata:e})).catch(r.catchApiError(e=>{const t=(e,t)=>e&&e[".tag"]&&e[".tag"]===t;if(e&&t(e.error,"bad_path")&&t(e.error.bad_path,"file_system_warnings"))return{fsws:e.error.bad_path.details};throw e}))}shareWithoutFsws(e){return this.share(Object.assign(Object.assign({},e),{checkFSWs:!1})).then(e=>({metadata:e})).catch(r.catchApiError(e=>{throw e}))}checkShareJobStatus({jobId:e}){return this.ns("sharing").rpc("check_share_internal_job_status",{async_job_id:e},{subjectUserId:this.userId})}checkRemoveMemberJobStatus({jobId:e}){return this.ns("sharing").rpc("check_remove_member_job_status",{async_job_id:e},{subjectUserId:this.userId})}validateMembers({contentId:e,accessLevel:t,members:s}){return this._validateMembers({accessLevel:t,contentId:e,members:s,contentType:l.ContentTypes.Folder})}addMembers({contentId:e,members:t,accessLevel:s,customMessage:n=null,quiet:i=!1,addMessageAsComment:r}){const a=c.accessLevelConstToApi(s),o=Array.from(t).map(e=>({member:e,access_level:a}));return this.addMembersWithAccessLevel({contentId:e,members:o,customMessage:n,quiet:i})}addMembersWithAccessLevel({contentId:e,members:t,customMessage:s=null,quiet:n=!1}){0===(null!=s?s.length:void 0)&&(s=null);const i={shared_folder_id:String(e),members:t,custom_message:s,quiet:n};return null!=this.teamMemberId?this.ns("sharing").rpc("add_folder_member_v2",i,{subjectUserId:this.userId}):this.ns("sharing").rpc("add_folder_member",i,{subjectUserId:this.userId})}fetchNsId(e){return this.ns("files").rpc("get_metadata",{path:e},{subjectUserId:this.userId}).then(e=>null!=e.sharing_info?e.sharing_info.shared_folder_id:void 0)}getMetadata({contentId:e,isInSharedFolder:t,actions:s=[]}){return null==this.teamMemberId||t?this.ns("sharing").rpc("alpha/get_folder_metadata",{shared_folder_id:String(e),actions:s},{subjectUserId:this.userId}).then(c.folderMetadataApiToRecord):this.ns("sharing").rpc("alpha/get_folder_metadata_v2",{shared_folder_id:String(e),actions:s},{subjectUserId:this.userId}).then(c.folderMetadataApiToRecord)}_metadataAndInheritMembers(e){const{members_cursor:t}=e;return t?this.listMembersContinue({cursor:t}).then(t=>({metadata:e,inheritedMembers:t})):{metadata:e,inheritedMembers:new l.SharingMembership}}validateFqPath({fqPath:e,actions:t,listMembersArg:s,shouldParseMetadataFromError:n=!1,shareAsConfidential:i=!1}){null==t&&(t=[]),null==s&&(s={});const r=this.ns("sharing").rpc("validate_folder_path",{path:e,actions:t,list_members_arg:s,confidentiality:i?{".tag":"confidential"}:{".tag":"not_confidential"}},{subjectUserId:this.userId});return this.validatePathContinue(r,n)}validatePathContinue(e,t){return e.catch(r.catchApiError((function(e){var s,n;if("already_shared"===(null===(n=null===(s=e.error)||void 0===s?void 0:s.bad_path)||void 0===n?void 0:n[".tag"]))return e.error.bad_path;if(t&&e instanceof r.AppError&&e.error&&"no_permission"===e.error[".tag"]&&c.hasFolderMetadataRecordInMetadata(e.error))return e.error;throw e}))).then(c.folderMetadataApiToRecord).then(this._metadataAndInheritMembers.bind(this))}validateFolderPathBatch({paths:e}){return this.ns("sharing").rpc("validate_folder_path/batch",{paths:e},{subjectUserId:this.userId}).then(e=>e.entries.map((function(e){var t,s;const{result:n}=e;let i=null;"metadata"===n[".tag"]?i=n:"no_permission"===(null!=n.path_error?n.path_error[".tag"]:void 0)?i=n.path_error:"already_shared"===(null===(s=null===(t=n.path_error)||void 0===t?void 0:t.bad_path)||void 0===s?void 0:s[".tag"])&&(i=n.path_error.bad_path);let r=null;return i&&i.link_metadata&&(r=c.folderMetadataApiToRecord(i)),{path:e.path,metadata:r}})))}updatePolicy({contentId:e,newPolicy:t}){const s=t;return s.shared_folder_id=String(e),null!=this.teamMemberId?this.ns("sharing").rpc("update_folder_policy_v2",s,{subjectUserId:this.userId}).then(c.folderMetadataApiToRecord):this.ns("sharing").rpc("update_folder_policy",s,{subjectUserId:this.userId}).then(c.folderMetadataApiToRecord)}updatePolicyAlpha({contentId:e,newPolicy:t}){const s=c.combinedPolicyDiffToApi(t);return s.shared_folder_id=String(e),null!=this.teamMemberId?this.ns("sharing").rpc("alpha/update_folder_policy_v2",s,{subjectUserId:this.userId}).then(c.folderMetadataApiToRecord):this.ns("sharing").rpc("alpha/update_folder_policy",s,{subjectUserId:this.userId}).then(c.folderMetadataApiToRecord)}unshare({contentId:e,leaveACopy:t=!1}){return this.ns("sharing").rpc("unshare_folder",{shared_folder_id:String(e),leave_a_copy:t},{subjectUserId:this.userId}).then(e=>"complete"===e[".tag"]?Promise.resolve(e):g(this.checkJobStatus.bind(this,{jobId:e.async_job_id})))}listMembers({contentId:e,limit:t,isAlpha:s=!1}){return null==t&&(t=100),this.ns("sharing").rpc("list_folder_members",{shared_folder_id:String(e),actions:u.MEMBER_ACTION.ALL,limit:t},{subjectUserId:this.userId}).then(c.membershipApiToRecord).then(this._addAccountsToMembership.bind(this))}listMembersContinue({cursor:e,isAlpha:t=!1}){return this.ns("sharing").rpc("list_folder_members/continue",{cursor:e},{subjectUserId:this.userId}).then(e=>c.membershipApiToRecord(e,null)).then(this._addAccountsToMembership.bind(this))}listMountableFolders({limit:e,actions:t}={}){return null==e&&(e=100),null==t&&(t=[]),this.ns("sharing").rpc("list_mountable_folders",{limit:e,actions:t},{subjectUserId:this.userId}).then(c.listFoldersResultApiToRecord)}listMountableFoldersContinue({cursor:e}){return this.ns("sharing").rpc("list_mountable_folders/continue",{cursor:e},{subjectUserId:this.userId}).then(c.listFoldersResultApiToRecord)}listMountableFoldersAlpha({limit:e,actions:t,show_mounted:s,get_invite_data:n}={}){return null==e&&(e=100),null==t&&(t=[]),null==n&&(n=!1),this.ns("sharing").rpc("alpha/list_mountable_folders",{limit:e,actions:t,show_mounted:s,get_invite_data:n},{subjectUserId:this.userId}).then(c.listFoldersResultApiToRecord)}listMountableFoldersContinueAlpha({cursor:e}){return this.ns("sharing").rpc("alpha/list_mountable_folders/continue",{cursor:e},{subjectUserId:this.userId}).then(c.listFoldersResultApiToRecord)}getMemberCounts({contentId:e}){return null!=this.teamMemberId?this.ns("sharing").rpc("get_folder_member_counts_v2",{shared_folder_id:String(e)},{subjectUserId:this.userId}).then(c.memberCountsApiToRecord):this.ns("sharing").rpc("get_folder_member_counts",{shared_folder_id:String(e)},{subjectUserId:this.userId}).then(c.memberCountsApiToRecord)}getParentFolderAccess({contentId:e,memberId:t,accessLevel:s}){return this.ns("sharing").rpc("get_parent_folder_access",{shared_folder_id:String(e),member:c.makeMemberSelector(t),access_level:null!=s?c.accessLevelConstToApi(s):void 0},{subjectUserId:this.userId}).then(c.memberAccessLevelApiToRecord.bind(null,this.userId))}relinquishMembership({contentId:e,leaveACopy:t=!1}){return this.ns("sharing").rpc("relinquish_folder_membership",{shared_folder_id:String(e),leave_a_copy:t},{subjectUserId:this.userId}).then(e=>"complete"===e[".tag"]?Promise.resolve():g(this.checkJobStatus.bind(this,{jobId:e.async_job_id})))}removeMember({contentId:e,memberId:t,leaveACopy:s=!1}){let n;return n=null!=this.teamMemberId?this.ns("sharing").rpc("remove_folder_member_v2",{shared_folder_id:String(e),member:c.makeMemberSelector(t),leave_a_copy:s},{subjectUserId:this.userId}):this.ns("sharing").rpc("remove_folder_member",{shared_folder_id:String(e),member:c.makeMemberSelector(t),leave_a_copy:s},{subjectUserId:this.userId}),n.then(e=>"complete"===e[".tag"]?Promise.resolve(e):g(this.checkRemoveMemberJobStatus.bind(this,{jobId:e.async_job_id}))).then(e=>c.memberAccessLevelApiToRecord(this.userId,e))}transferContent({contentId:e,memberId:t}){return null!=this.teamMemberId?this.ns("sharing").rpc("transfer_folder_v2",{shared_folder_id:String(e),to_dropbox_id:t},{subjectUserId:this.userId}):this.ns("sharing").rpc("transfer_folder",{shared_folder_id:String(e),to_dropbox_id:t},{subjectUserId:this.userId})}updateMember({contentId:e,memberId:t,accessLevel:s}){let n;return n=null!=this.teamMemberId?this.ns("sharing").rpc("update_folder_member_v2",{shared_folder_id:String(e),member:c.makeMemberSelector(t),access_level:c.accessLevelConstToApi(s)},{subjectUserId:this.userId}):this.ns("sharing").rpc("update_folder_member",{shared_folder_id:String(e),member:c.makeMemberSelector(t),access_level:c.accessLevelConstToApi(s)},{subjectUserId:this.userId}),n.then(e=>c.memberAccessLevelApiToRecord(this.userId,e))}mount({contentId:e}){return this.ns("sharing").rpc("mount_folder",{shared_folder_id:String(e)},{subjectUserId:this.userId}).then(c.folderMetadataApiToRecord)}unmount({contentId:e}){return this.ns("sharing").rpc("unmount_folder",{shared_folder_id:String(e)},{subjectUserId:this.userId})}setConfidentiality({contentId:e,confidential:t,keepInheritedMembers:s=!1}){return this.ns("sharing").rpc("set_access_inheritance",{shared_folder_id:String(e),access_inheritance:t?{".tag":"no_inherit"}:{".tag":"inherit"},keep_inherited_members:s},{subjectUserId:this.userId}).then(e=>"complete"===e[".tag"]?Promise.resolve(e):g(this.checkShareJobStatus.bind(this,{jobId:e.async_job_id}))).then(c.folderMetadataApiToRecord)}checkConfidentialRelocateJobStatus({jobId:e}){return this.ns("sharing").rpc("confidential_relocate/check",{async_job_id:e},{subjectUserId:this.userId})}relocateConfidentially({fromPath:e,toPath:t}){return s.__awaiter(this,void 0,void 0,(function*(){const{result:{async_job_id:s},converted_folder_id:n}=yield this.ns("sharing").rpc("confidential_relocate",{from_path:e,to_path:t},{subjectUserId:this.userId});return{result:yield g(this.checkConfidentialRelocateJobStatus.bind(this,{jobId:s})),convertedFolderId:n}}))}};const g=function(e,t){let s=1e3,n=null;t&&t.interval&&(s=t.interval),t&&t.timeout&&(n=t.timeout);const i=null!=n?Date.now()+n:null,a=function(t,n){return null!=i&&Date.now()>i?n():e().then((function(e){switch(e[".tag"]){case"failed":return n(e);case"complete":return t(e);case"in_progress":return window.setTimeout(a,s,t,n)}})).catch(r.catchApiError(e=>n(e)))};return new Promise(a)}})),define("metaserver/static/js/modules/clean/sharing/api/types/metadata",["require","exports","tslib","immutable","metaserver/static/js/api_v2/types","metaserver/static/js/modules/clean/sharing/access_level","spectrum-sharing/utils/sharing_util"],(function(e,t,s,n,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowsePiscesBizBasicVariant=t.ContentTypes=t.AudienceRestrictingSharedFolder=t.SharingPrefs=t.LinkAudienceOption=t.LinkAudienceDisallowedReason=t.LinkVisibilityPolicy=t.LinkPermissions=t.LinkPolicy=t.LinkMetadata=t.MountLimitInfo=t.ParentFolderInfo=t.MemberAccessLevelResult=t.MemberCounts=t.MemberPermissions=t.GroupMembershipInfo=t.InviteeMembershipInfo=t.UserMembershipInfo=t.MembershipType=t.makeMemberKey=t.SharingMembership=t.ListContentResult=t.ListFilesResult=t.FilePolicy=t.FilePermissions=t.SharedFileMetadata=t.ListFoldersResult=t.FolderPermissions=t.FolderPolicy=t.SharedFolderMetadata=t.PermissionSetting=t.FullAccount=t.BasicAccount=t.TeamSharingPolicies=t.FullTeam=t.TeamMemberInfo=t.Team=t.GroupManagementType=t.LinkAudience=t.DownloadPolicy=t.ViewerInfoPolicy=t.VisibilityDisallowedReason=t.ResolvedVisibilityPolicy=t.RequestedVisibilityPolicy=t.SharedLinkCreatePolicy=t.SharedFolderJoinPolicy=t.SharedFolderMemberMemberPolicy=t.SharedLinkPolicy=t.AclUpdatePolicy=t.MemberPolicy=void 0,n=s.__importStar(n),t.MemberPolicy={team:new i.UnionScalar("team"),anyone:new i.UnionScalar("anyone")},t.AclUpdatePolicy={owner:new i.UnionScalar("owner"),editors:new i.UnionScalar("editors")},t.SharedLinkPolicy={anyone:new i.UnionScalar("anyone"),members:new i.UnionScalar("members")},t.SharedFolderMemberMemberPolicy={team:new i.UnionScalar("team"),anyone:new i.UnionScalar("anyone")},t.SharedFolderJoinPolicy={from_team_only:new i.UnionScalar("from_team_only"),from_anyone:new i.UnionScalar("from_anyone")},t.SharedLinkCreatePolicy={default_public:new i.UnionScalar("default_public"),default_team_only:new i.UnionScalar("default_team_only"),team_only:new i.UnionScalar("team_only")},t.RequestedVisibilityPolicy={policy_name:"requested_visibility",password:"password",public:"public",team_only:"team_only"},t.ResolvedVisibilityPolicy={policy_name:"resolved_visibility",only_you:"only_you",password:"password",public:"public",shared_folder_only:"shared_folder_only",team_and_password:"team_and_password",team_only:"team_only"},t.VisibilityDisallowedReason={delete_and_recreate:"delete_and_recreate",restricted_by_shared_folder:"restricted_by_shared_folder",restricted_by_team:"restricted_by_team",user_account_type:"user_account_type",user_not_on_team:"user_not_on_team",permission_denied:"permission_denied"},t.ViewerInfoPolicy={policy_name:"viewer_info_policy",enabled:"enabled",disabled:"disabled"},t.DownloadPolicy={policy_name:"download_policy",allow:"allow",disallow:"disallow"},t.LinkAudience={public:"public",team:"team",password:"password",no_one:"no_one",members:"members"},t.GroupManagementType={user_managed:new i.UnionScalar("user_managed"),company_managed:new i.UnionScalar("company_managed"),system_managed:new i.UnionScalar("system_managed")};class o extends(n.Record({id:null,name:null},"Team")){}t.Team=o;class l extends(n.Record({display_name:null,member_id:null,team_info:null},"TeamMemberInfo")){}t.TeamMemberInfo=l;class c extends(n.Record({id:null,name:null,sharing_policies:null},"FullTeam")){}t.FullTeam=c;class d extends(n.Record({shared_folder_member_policy:null,shared_folder_join_policy:null,shared_link_create_policy:null},"TeamSharingPolicies")){}t.TeamSharingPolicies=d;class u extends(n.Record({account_id:null,display_name:null,disabled:!1,email:null,email_verified:!1,familiar_name:null,given_name:null,is_teammate:!1,profile_photo_url:null,surname:null,team_member_id:null},"BasicAccount")){}t.BasicAccount=u;class h extends(n.Record({account_id:null,display_name:null,disabled:!1,email:null,email_verified:!1,familiar_name:null,given_name:null,profile_photo_url:null,surname:null,team:null,team_member_id:null,is_family_user:!1},"FullAccount")){}t.FullAccount=h;class _ extends(n.Record({allow:!1,reason:null},"PermissionSetting")){}t.PermissionSetting=_;class p extends(n.Record({access_type:null,is_confidential:!1,is_inside_team_folder:!1,is_team_folder:!1,link_metadata:null,members_cursor:null,name:null,owner_team:null,parent_shared_folder_id:null,path_lower:null,permissions:null,policy:null,preview_url:null,shared_folder_id:null,time_invited:null,can_mount:null,folder_size:null,invite_info:null,parent_folder_name:null},"SharedFolderMetadata")){contentId(){return this.shared_folder_id||this.path_lower}isFolder(){return!0}isSharedFolder(){return Boolean(this.shared_folder_id)}isNewSharedFolder(){return!this.shared_folder_id}isViewOnly(){return Boolean(this.access_type===r.ACCESS_LEVEL.READER)}nsId(){return this.isSharedFolder()?this.shared_folder_id:void 0}canCreateEditLink(){return!1}canCreateViewLink(){return!(this.is_confidential||this.is_team_folder&&this.isSharedFolder()||null===this.path_lower)}canEditInbandInvite(){return this.permissions&&this.permissions.invite_editor&&this.permissions.invite_editor.get("allow")}canViewInbandInvite(){return this.permissions&&this.permissions.invite_viewer&&this.permissions.invite_viewer.get("allow")}}t.SharedFolderMetadata=p;class m extends(n.Record({acl_update_policy:null,download_policy:null,member_policy:null,viewer_info_policy:null,resolved_member_policy:null,shared_link_policy:null},"FolderPolicy")){}t.FolderPolicy=m;class f extends(n.Record({change_options:null,disable_viewer_info:null,edit_contents:null,enable_viewer_info:null,invite_editor:null,invite_viewer:null,invite_viewer_no_comment:null,leave_a_copy:null,relinquish_membership:null,remove_download_policy:null,set_download_policy:null,update_confidentiality:null,unmount:null,unshare:null,create_link:null},"FolderPermissions")){}t.FolderPermissions=f;class g extends(n.Record({entries:n.Map(),cursor:null},"ListFoldersResult")){}t.ListFoldersResult=g;class y extends(n.Record({access_type:null,id:null,file_policy:null,link_metadata:null,name:null,owner_team:null,policy:null,parent_shared_folder_id:null,path_display:null,path_lower:null,permissions:null,preview_url:null,time_invited:null,is_cloud_doc:null,invite_info:null},"SharedFileMetadata")){contentId(){return this.id}isFolder(){return!1}isSharedFolder(){return!1}isNewSharedFolder(){return!1}nsId(){}canCreateEditLink(){return this.permissions&&this.permissions.create_edit_link&&this.permissions.create_edit_link.get("allow")}canCreateViewLink(){return this.permissions&&this.permissions.create_view_link&&this.permissions.create_view_link.get("allow")}canEditInbandInvite(){return this.permissions&&this.permissions.invite_editor&&this.permissions.invite_editor.get("allow")}canViewInbandInvite(){return this.permissions&&this.permissions.invite_viewer&&this.permissions.invite_viewer.get("allow")}}t.SharedFileMetadata=y;class v extends(n.Record({change_options:null,disable_viewer_info:null,edit_contents:null,enable_viewer_info:null,invite_viewer:null,invite_editor:null,invite_viewer_no_comment:null,relinquish_membership:null,remove_download_policy:null,set_download_policy:null,unshare:null,view_members:null,create_link:null,create_edit_link:null,create_view_link:null,share_message_as_comment:null},"FilePermissions")){}t.FilePermissions=v;class b extends(n.Record({audience:null,download_policy:null,viewer_info_policy:null},"FilePolicy")){}t.FilePolicy=b;class w extends(n.Record({entries:n.Map(),cursor:null},"ListFilesResult")){}t.ListFilesResult=w;class k extends(n.Record({contentEntries:n.Map(),cursor:null},"ListContentResult")){}t.ListContentResult=k;class M extends(n.Record({cursor:null,invitees:n.Map(),groups:n.Map(),users:n.Map(),memberCount:null},"SharingMembership")){getMemberCount(){return this.memberCount||this.invitees.count()+this.groups.count()+this.users.count()}getTotalMemberCount(e=[]){return this.groups.map(e=>e.member_count||1).reduce((e,t)=>e+t,0)+this.invitees.count()+this.users.filter(t=>!e.includes(t.memberId())).count()}isOnlyMemberInAllGroups(){const e=this.groups;return e&&e.every(e=>!(e.member_count>1)&&(0===e.member_count||e.is_member))}hasInheritedUsers(){return this.users.some(e=>e.is_inherited)}}var S;t.SharingMembership=M,t.makeMemberKey=(e,t)=>`${e}:${t}`,(function(e){e.USERS="users",e.GROUPS="groups",e.INVITEES="invitees"})(S=t.MembershipType||(t.MembershipType={}));class E extends(n.Record({access_type:null,inherited_access_type:null,account:null,account_id:null,initials:null,is_inherited:!1,permissions:null,platform_type:null,same_team:null,team_member_id:null,time_last_seen:null},"UserMembershipInfo")){memberId(){return this.account_id}memberKey(){return t.makeMemberKey(this.is_inherited,this.memberId())}displayName(){return this.account?this.account.display_name:void 0}contactId(){return this.account_id}contactType(){return"dropbox_id"}type(){return S.USERS}email(){return this.account?this.account.email:void 0}}t.UserMembershipInfo=E;class C extends(n.Record({access_type:null,inherited_access_type:null,contact:null,contact_type:null,initials:!1,is_inherited:null,permissions:null,same_team:null},"InviteeMembershipInfo")){memberId(){return`${this.contact_type}:${this.contact}`}memberKey(){return t.makeMemberKey(this.is_inherited,this.memberId())}displayName(){return this.contact}contactId(){return this.contact}contactType(){return"email"}type(){return S.INVITEES}}t.InviteeMembershipInfo=C;class A extends(n.Record({access_type:null,inherited_access_type:null,group_external_id:null,group_id:null,group_management_type:null,group_name:null,group_type:null,initials:null,is_inherited:!1,is_member:!1,is_owner:!1,member_count:null,permissions:null,same_team:!0},"GroupMembershipInfo")){memberId(){return this.group_id}memberKey(){return t.makeMemberKey(this.is_inherited,this.memberId())}displayName(){return this.group_name}contactId(){return this.group_id}contactType(){return"dropbox_id"}type(){return S.GROUPS}}t.GroupMembershipInfo=A;class D extends(n.Record({leave_a_copy:null,make_editor:null,make_owner:null,make_viewer:null,make_viewer_no_comment:null,remove:null},"MemberPermissions")){}t.MemberPermissions=D;class I extends(n.Record({total_unique_users:null,total_unique_inherited_members:null,users_outside_team:null,exceeds_count:!1},"MemberCounts")){}t.MemberCounts=I;class T extends(n.Record({access_level:null,warning:null,parentFolders:null},"MemberAccessLevelResult")){}t.MemberAccessLevelResult=T;class R extends(n.Record({name:null,shared_folder_id:null,path:null,permissions:null},"ParentFolderInfo")){}t.ParentFolderInfo=R;class x extends(n.Record({limit:null,current_count:null,new_count:null},"MountLimitInfo")){}t.MountLimitInfo=x;class P extends(n.Record({url:null,client_modified:null,content_owner_team_info:null,expires:null,require_password:null,file_type:null,id:null,link_permissions:null,name:null,path_lower:null,rev:null,server_modified:null,size:null,team_member_info:null,preview_type:null},"LinkMetadata")){isFolder(){return"folder"===this.file_type}teamInfo(){return this.content_owner_team_info?this.content_owner_team_info:this.team_member_info?this.team_member_info.team_info:void 0}accessLevel(){return this.link_permissions.link_access_level}isRighteousLink(){return a.isRighteousLink(this.link_permissions)}canChangePassword(){return Boolean(this.link_permissions&&this.link_permissions.require_password?this.link_permissions.can_remove_password:this.link_permissions.can_set_password)}canChangeExpiration(){return Boolean(null!=this.expires?this.link_permissions.can_remove_expiry:this.link_permissions.can_set_expiry)}canChangeDownload(){return Boolean(this.link_permissions&&this.link_permissions.allow_download?this.link_permissions.can_disallow_download:this.link_permissions.can_allow_download)}}t.LinkMetadata=P;class L extends(n.Record({link_password:null,expires:null,allow_download:null,audience:null,require_password:null,display_expiration_warning:null,display_password_warning:null},"LinkPolicy")){}t.LinkPolicy=L;class O extends(n.Record({allow_comments:null,can_revoke:null,allow_download:null,can_allow_download:null,can_disallow_download:null,can_set_expiry:null,can_remove_expiry:null,can_set_password:null,can_remove_password:null,require_password:null,effective_audience:null,link_access_level:null,requested_visibility:null,resolved_visibility:null,restricting_shared_folder_path:null,revoke_failure_reason:null,team_restricts_comments:null,visibility_policies:null,audience_options:null,can_use_extended_sharing_controls:null,days_to_expire_policy:null,change_shared_link_expiration_policy:null,enforce_shared_link_password_policy:null},"LinkPermissions")){canChangeDownload(){return null!=this.can_disallow_download&&null!=this.can_allow_download&&null!=this.allow_download}}t.LinkPermissions=O;class N extends(n.Record({policy:null,resolved_policy:null,allowed:null,disallowed_reason:null},"LinkVisibilityPolicy")){}t.LinkVisibilityPolicy=N,(function(e){e.DeleteAndRecreate="delete_and_recreate",e.RestrictedBySharedFolder="restricted_by_shared_folder",e.RestrictedByTeam="restricted_by_team",e.UserAccountType="user_account_type",e.UserNotOnTeam="user_not_on_team",e.PermissionDenied="permission_denied"})(t.LinkAudienceDisallowedReason||(t.LinkAudienceDisallowedReason={}));class F extends(n.Record({audience:null,allowed:null,disallowed_reason:null},"LinkAudienceOption")){}t.LinkAudienceOption=F;class U extends(n.Record({in_server_side_contact_validation_settings:!1,in_server_side_contact_search_settings:"OFF",create_nested_shared_folder_variant:"OFF",create_edit_folder_link_variant:"OFF",efl_delay_namespace_creation_enabled:!1,confidential_folder_links_enabled:!1,in_share_modal_upsell_premium_sharing:!1,in_share_modal_upsell_premium_sharing_variant:"OFF",has_seen_share_modal_upsell_premium_sharing_counter:0,exp_browse_pisces_biz_basic_variant:"OFF",invite_or_request_after_sharing_modal_variant:"not_enabled",exp_core_o21n_better_team_sharing:"OFF",exp_core_o21n_dnd_moment_pdf_word:"OFF",exp_core_o21n_dnd_moment_ppt_keynote:"OFF",exp_pg_esign_discovery_variant:"OFF",has_seen_esign_post_sharing:!1,is_in_esign_post_sharing_exclusion_period:!1,exp_pg_family_sharing_upsell_gating:"OFF",team_space_3_offteam_sharing_sprig_survey:!1,sharing_sdk_tokenizer_variant:"OFF",exp_bt_self_sign_entry_point:"OFF"},"SharingPrefs")){}t.SharingPrefs=U;class j extends(n.Record({shared_folder_id:null,name:null,audience:null},"AudienceRestrictingSharedFolder")){}t.AudienceRestrictingSharedFolder=j,t.ContentTypes={File:{".tag":"file"},Folder:{".tag":"folder"}},(function(e){e.OFF="OFF",e.CONTROL="CONTROL",e.V1_ADVANCED="V1_ADVANCED",e.V2_ADVANCED="V2_ADVANCED",e.V1_STANDARD="V1_STANDARD",e.V2_STANDARD="V2_STANDARD"})(t.BrowsePiscesBizBasicVariant||(t.BrowsePiscesBizBasicVariant={}))})),define("metaserver/static/js/modules/clean/sharing/api/util/types",["require","exports","tslib","metaserver/static/js/modules/clean/contacts/types","immutable","metaserver/static/js/api_v2/types","metaserver/static/js/modules/clean/react/pass/utils","metaserver/static/js/modules/clean/sharing/access_level","metaserver/static/js/modules/clean/sharing/link_info","metaserver/static/js/modules/clean/sharing/api/types/metadata"],(function(e,t,s,n,i,r,a,o,l,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinedPolicyDiffToApi=t.createUnionScalar=t.contactsToMembers=t.contactToMember=t.parseSharedLinkMetadata=t.makeMemberSelector=t.sharingPrefsApiToRecord=t.fullAccountApiToRecord=t.teamSharingPoliciesApiToRecord=t.accountInfoApiToRecord=t.linkMetadataApiToRecord=t.linkPermissionsApiToRecord=t.audienceOptionApiToRecord=t.visibilityPolicyApiToRecord=t.teamMemberInfoApiToRecord=t.memberAccessLevelApiToRecord=t.parentFolderInfoApiToRecord=t.memberCountsApiToRecord=t.membershipApiToRecord=t.userMembershipApiToRecord=t.groupMembershipApiToRecord=t.inviteeMembershipApiToRecord=t.memberPermissionsApiToRecord=t.listContentResultApiToRecord=t.listFilesResultApiToRecord=t.fileMetadataApiToRecord=t.getFilePolicy=t.filePermissionsApiToRecord=t.listFoldersResultApiToRecord=t.folderMetadataApiToRecord=t.folderPermissionsApiToRecord=t.parseFolderPolicy=t.audienceRestrictingSharedFolderToRecord=t.folderPolicyApiToRecord=t.hasFolderMetadataRecordInMetadata=t.platformTypeApiToConst=t.groupManagementTypeApiToConst=t.accessLevelApiToConst=t.rawAccessLevelConstToApi=t.accessLevelConstToApi=void 0,n=s.__importDefault(n),i=s.__importStar(i),t.accessLevelConstToApi=e=>{const s=t.rawAccessLevelConstToApi(e);return new r.UnionScalar(s[".tag"])},t.rawAccessLevelConstToApi=e=>{switch(e){case o.ACCESS_LEVEL.OWNER:return{".tag":"owner"};case o.ACCESS_LEVEL.WRITER:return{".tag":"editor"};case o.ACCESS_LEVEL.READER:return{".tag":"viewer"};case o.ACCESS_LEVEL.READER_NO_COMMENT:return{".tag":"viewer_no_comment"};default:throw new Error("unknown access level: "+e)}},t.accessLevelApiToConst=e=>{switch(e.type||e){case"owner":return o.ACCESS_LEVEL.OWNER;case"editor":return o.ACCESS_LEVEL.WRITER;case"viewer":return o.ACCESS_LEVEL.READER;case"viewer_no_comment":return o.ACCESS_LEVEL.READER_NO_COMMENT}},t.groupManagementTypeApiToConst=e=>{if(!e)return null;switch(e[".tag"]){case"user_managed":return c.GroupManagementType.user_managed;case"company_managed":return c.GroupManagementType.company_managed;case"system_managed":return c.GroupManagementType.system_managed;default:return}},t.platformTypeApiToConst=e=>a.parsePlatformString(e.type),t.hasFolderMetadataRecordInMetadata=e=>null!=e.path_lower&&null!=e.access_type&&null!=e.policy,t.folderPolicyApiToRecord=e=>null==e?new c.FolderPolicy:new c.FolderPolicy({acl_update_policy:e.acl_update_policy&&e.acl_update_policy[".tag"],download_policy:e.download_policy&&e.download_policy[".tag"],member_policy:e.member_policy&&e.member_policy[".tag"],resolved_member_policy:e.resolved_member_policy&&e.resolved_member_policy[".tag"],shared_link_policy:e.shared_link_policy&&e.shared_link_policy[".tag"],viewer_info_policy:e.viewer_info_policy&&e.viewer_info_policy[".tag"]});t.audienceRestrictingSharedFolderToRecord=e=>new c.AudienceRestrictingSharedFolder({shared_folder_id:e.shared_folder_id,name:e.name,audience:e.audience[".tag"]}),t.parseFolderPolicy=t.folderPolicyApiToRecord,t.folderPermissionsApiToRecord=e=>{const t=(e=>{const t={};for(const s of e)t[s.action[".tag"]]=new c.PermissionSetting({allow:s.allow,reason:s.reason?s.reason[".tag"]:void 0});return t})(e);return new c.FolderPermissions(t)},t.folderMetadataApiToRecord=e=>new c.SharedFolderMetadata({access_type:t.accessLevelApiToConst(r.Union.parse(e.access_type)),is_inside_team_folder:e.is_inside_team_folder,is_team_folder:e.is_team_folder,members_cursor:e.members_cursor,name:e.name,owner_team:null!=e.owner_team?new c.Team(e.owner_team):void 0,parent_shared_folder_id:e.parent_shared_folder_id,path_lower:e.path_lower,permissions:null!=e.permissions?t.folderPermissionsApiToRecord(e.permissions):void 0,policy:t.parseFolderPolicy(e.policy),preview_url:e.preview_url,shared_folder_id:e.shared_folder_id,time_invited:null!=e.time_invited?new Date(e.time_invited):void 0,is_confidential:null!=e.is_confidential?e.is_confidential:void 0,folder_size:null!=e.folder_size?e.folder_size:void 0,can_mount:null!=e.can_mount?e.can_mount:void 0,invite_info:null!=e.invite_info?e.invite_info:void 0,parent_folder_name:e.parent_folder_name}),t.listFoldersResultApiToRecord=e=>new c.ListFoldersResult({entries:i.Map(e.entries.map(t.folderMetadataApiToRecord).map(e=>[e.shared_folder_id,e])),cursor:e.cursor}),t.filePermissionsApiToRecord=e=>{const t={};if(e)for(const s of e)t[s.action[".tag"]]=new c.PermissionSetting({allow:s.allow,reason:s.reason&&s.reason[".tag"]});return new c.FilePermissions(t)},t.getFilePolicy=e=>{const t={};return t[c.ViewerInfoPolicy.policy_name]=e&&e.viewer_info_policy&&e.viewer_info_policy[".tag"],t[c.DownloadPolicy.policy_name]=e&&e.download_policy&&e.download_policy[".tag"]||c.DownloadPolicy.allow,new c.FilePolicy(t)},t.fileMetadataApiToRecord=e=>new c.SharedFileMetadata({access_type:null!=e.access_type?t.accessLevelApiToConst(r.Union.parse(e.access_type)):o.ACCESS_LEVEL.READER,id:e.id,file_policy:t.getFilePolicy(e.policy),is_cloud_doc:null!=e.is_cloud_doc&&e.is_cloud_doc,name:e.name,owner_team:e.owner_team&&new c.Team(e.owner_team),policy:null!=e.policy?t.parseFolderPolicy(e.policy):new c.FolderPolicy,parent_shared_folder_id:e.parent_shared_folder_id,path_display:e.path_display,path_lower:e.path_lower,permissions:t.filePermissionsApiToRecord(e.permissions),preview_url:e.preview_url,time_invited:e.time_invited&&new Date(e.time_invited),invite_info:null!=e.invite_info?e.invite_info:void 0}),t.listFilesResultApiToRecord=e=>new c.ListFilesResult({entries:i.Map(e.entries.map(e=>[e.id,t.fileMetadataApiToRecord(e)])),cursor:e.cursor}),t.listContentResultApiToRecord=e=>new c.ListContentResult({contentEntries:i.Map(e.entries.map(e=>e.shared_folder_id?[e.shared_folder_id,t.folderMetadataApiToRecord(e)]:[e.id,t.fileMetadataApiToRecord(e)])),cursor:e.has_more?e.cursor:null}),t.memberPermissionsApiToRecord=e=>{const t={};if(null!=e)for(const s of e)t[s.action[".tag"]]=new c.PermissionSetting({allow:s.allow,reason:s.reason&&s.reason[".tag"]});return new c.MemberPermissions(t)},t.inviteeMembershipApiToRecord=e=>{let s=void 0;e.inherited_access_type&&(s=t.accessLevelApiToConst(r.Union.parse(e.inherited_access_type)));const n=e.invitee[".tag"];return new c.InviteeMembershipInfo({access_type:t.accessLevelApiToConst(r.Union.parse(e.access_type)),inherited_access_type:s,contact:e.invitee[n],contact_type:n,initials:e.initials,is_inherited:e.is_inherited,permissions:t.memberPermissionsApiToRecord(e.permissions),same_team:Boolean(e.user&&e.user.same_team)})},t.groupMembershipApiToRecord=e=>{let s=void 0;return e.inherited_access_type&&(s=t.accessLevelApiToConst(r.Union.parse(e.inherited_access_type))),new c.GroupMembershipInfo({access_type:t.accessLevelApiToConst(r.Union.parse(e.access_type)),inherited_access_type:s,group_external_id:e.group.group_external_id,group_id:e.group.group_id,group_management_type:t.groupManagementTypeApiToConst(e.group.group_management_type),group_name:e.group.group_name,group_type:e.group.group_type[".tag"],initials:e.initials,is_inherited:e.is_inherited,is_member:e.group.is_member,is_owner:e.group.is_owner,member_count:e.group.member_count,permissions:t.memberPermissionsApiToRecord(e.permissions),same_team:e.group.same_team})},t.userMembershipApiToRecord=e=>{let s=void 0;return e.inherited_access_type&&(s=t.accessLevelApiToConst(r.Union.parse(e.inherited_access_type))),new c.UserMembershipInfo({access_type:t.accessLevelApiToConst(r.Union.parse(e.access_type)),inherited_access_type:s,account_id:e.user.account_id,initials:e.initials,is_inherited:e.is_inherited,permissions:t.memberPermissionsApiToRecord(e.permissions),platform_type:e.platform_type&&t.platformTypeApiToConst(r.Union.parse(e.platform_type)),same_team:e.user.same_team,team_member_id:e.user.team_member_id,time_last_seen:e.time_last_seen&&new Date(e.time_last_seen)})},t.membershipApiToRecord=(e,s=null)=>new c.SharingMembership({cursor:e.cursor,invitees:i.Map(e.invitees.map(e=>{const s=t.inviteeMembershipApiToRecord(e);return[s.memberKey(),s]})),groups:i.Map(e.groups.map(e=>{const s=t.groupMembershipApiToRecord(e);return[s.memberKey(),s]})),users:i.Map(e.users.map(e=>{const s=t.userMembershipApiToRecord(e);return[s.memberKey(),s]})),memberCount:s}),t.memberCountsApiToRecord=e=>new c.MemberCounts(e),t.parentFolderInfoApiToRecord=e=>new c.ParentFolderInfo({name:e.folder_name,shared_folder_id:e.shared_folder_id,path:e.path,permissions:t.memberPermissionsApiToRecord(e.permissions)}),t.memberAccessLevelApiToRecord=(e,s)=>{if(null==s)return new c.MemberAccessLevelResult;let n;return null!=s.access_details&&(n=s.access_details.map(e=>t.parentFolderInfoApiToRecord(e))),new c.MemberAccessLevelResult({access_level:s.access_level&&t.accessLevelApiToConst(r.Union.parse(s.access_level)),warning:s.warning,parentFolders:n})},t.teamMemberInfoApiToRecord=e=>null==e?null:new c.TeamMemberInfo({display_name:e.display_name,member_id:e.member_id,team_info:e.team_info&&new c.Team(e.team_info)}),t.visibilityPolicyApiToRecord=e=>new c.LinkVisibilityPolicy({policy:e.policy&&e.policy[".tag"],resolved_policy:e.resolved_policy&&e.resolved_policy[".tag"],allowed:e.allowed,disallowed_reason:e.disallowed_reason&&e.disallowed_reason[".tag"]}),t.audienceOptionApiToRecord=e=>new c.LinkAudienceOption({audience:e.audience[".tag"],allowed:e.allowed,disallowed_reason:e.disallowed_reason&&e.disallowed_reason[".tag"]}),t.linkPermissionsApiToRecord=e=>null==e?new c.LinkPermissions:new c.LinkPermissions({allow_download:e.allow_download,allow_comments:e.allow_comments,can_allow_download:e.can_allow_download,can_disallow_download:e.can_disallow_download,can_revoke:e.can_revoke,can_set_expiry:e.can_set_expiry,can_remove_expiry:e.can_remove_expiry,can_set_password:e.can_set_password,can_remove_password:e.can_remove_password,require_password:e.require_password,requested_visibility:e.requested_visibility&&e.requested_visibility[".tag"],resolved_visibility:e.resolved_visibility&&e.resolved_visibility[".tag"],restricting_shared_folder_path:e.restricting_shared_folder_path,revoke_failure_reason:e.revoke_failure_reason&&e.revoke_failure_reason[".tag"],team_restricts_comments:e.team_restricts_comments,visibility_policies:e.visibility_policies&&e.visibility_policies.map(t.visibilityPolicyApiToRecord),audience_options:e.audience_options&&e.audience_options.map(t.audienceOptionApiToRecord),effective_audience:e.effective_audience&&e.effective_audience[".tag"],link_access_level:e.link_access_level&&e.link_access_level[".tag"],can_use_extended_sharing_controls:e.can_use_extended_sharing_controls,days_to_expire_policy:e.days_to_expire_policy?e.days_to_expire_policy[".tag"]:"none",change_shared_link_expiration_policy:e.change_shared_link_expiration_policy?e.change_shared_link_expiration_policy[".tag"]:"allowed",enforce_shared_link_password_policy:e.enforce_shared_link_password_policy?e.enforce_shared_link_password_policy[".tag"]:"optional"}),t.linkMetadataApiToRecord=e=>new c.LinkMetadata({url:e.url,client_modified:e.client_modified&&new Date(e.client_modified),content_owner_team_info:e.content_owner_team_info&&new c.Team(e.content_owner_team_info),expires:e.expires&&new Date(e.expires),file_type:e[".tag"],id:e.id,link_permissions:t.linkPermissionsApiToRecord(e.link_permissions),name:e.name,path_lower:e.path_lower,rev:e.rev,server_modified:e.server_modified&&new Date(e.server_modified),size:e.size,team_member_info:t.teamMemberInfoApiToRecord(e.team_member_info),preview_type:e.preview_type}),t.accountInfoApiToRecord=e=>new c.BasicAccount({account_id:e.account_id,disabled:e.disabled,display_name:e.name.display_name,email:e.email,email_verified:e.email_verified,familiar_name:e.name.familiar_name,given_name:e.name.given_name,is_teammate:e.is_teammate,profile_photo_url:e.profile_photo_url,surname:e.name.surname,team_member_id:e.team_member_id}),t.teamSharingPoliciesApiToRecord=e=>e&&new c.TeamSharingPolicies({shared_folder_member_policy:e.shared_folder_member_policy&&e.shared_folder_member_policy[".tag"],shared_folder_join_policy:e.shared_folder_join_policy&&e.shared_folder_join_policy[".tag"],shared_link_create_policy:e.shared_link_create_policy&&e.shared_link_create_policy[".tag"]}),t.fullAccountApiToRecord=e=>{const s=e.team&&new c.FullTeam({id:e.team.id,name:e.team.name,sharing_policies:t.teamSharingPoliciesApiToRecord(e.team.sharing_policies)});return new c.FullAccount({account_id:e.account_id,disabled:e.disabled,display_name:e.name.display_name,email:e.email,email_verified:e.email_verified,familiar_name:e.name.familiar_name,given_name:e.name.given_name,profile_photo_url:e.profile_photo_url,surname:e.name.surname,team_member_id:e.team_member_id,team:s,is_family_user:e.is_family_user})},t.sharingPrefsApiToRecord=e=>{var t;return new c.SharingPrefs({in_server_side_contact_validation_settings:Boolean(e.in_server_side_contact_validation_settings),in_server_side_contact_search_settings:e.in_server_side_contact_search_settings,create_nested_shared_folder_variant:e.create_nested_shared_folder_variant,create_edit_folder_link_variant:e.create_edit_folder_link_variant,efl_delay_namespace_creation_enabled:e.efl_delay_namespace_creation_enabled,confidential_folder_links_enabled:e.confidential_folder_links_enabled,in_share_modal_upsell_premium_sharing:Boolean(e.in_share_modal_upsell_premium_sharing),in_share_modal_upsell_premium_sharing_variant:e.in_share_modal_upsell_premium_sharing_variant,has_seen_share_modal_upsell_premium_sharing_counter:e.has_seen_share_modal_upsell_premium_sharing_counter,exp_browse_pisces_biz_basic_variant:e.exp_browse_pisces_biz_basic_variant,invite_or_request_after_sharing_modal_variant:null===(t=e.invite_or_request_after_sharing_modal_variant)||void 0===t?void 0:t[".tag"],exp_core_o21n_better_team_sharing:e.exp_core_o21n_better_team_sharing,exp_core_o21n_dnd_moment_pdf_word:e.exp_core_o21n_dnd_moment_pdf_word,exp_core_o21n_dnd_moment_ppt_keynote:e.exp_core_o21n_dnd_moment_ppt_keynote,exp_pg_esign_discovery_variant:e.exp_pg_esign_discovery_variant,exp_pg_family_sharing_upsell_gating:e.exp_pg_family_sharing_upsell_gating,has_seen_esign_post_sharing:e.has_seen_esign_post_sharing,is_in_esign_post_sharing_exclusion_period:e.is_in_esign_post_sharing_exclusion_period,team_space_3_offteam_sharing_sprig_survey:e.team_space_3_offteam_sharing_sprig_survey,sharing_sdk_tokenizer_variant:e.sharing_sdk_tokenizer_variant,exp_bt_self_sign_entry_point:e.exp_bt_self_sign_entry_point})},t.makeMemberSelector=e=>e.startsWith("email:")?new r.UnionScalar("email",e.substr(6)):new r.UnionScalar("dropbox_id",e),t.parseSharedLinkMetadata=e=>{if(null==e)return null;const t=r.Union.parse(e.link_permissions.resolved_visibility).type,s=null!=e.team_member_info?{teamId:e.team_member_info.team_info.id,teamName:e.team_member_info.team_info.name}:{teamId:null,teamName:null},n={isFolder:"folder"===e[".tag"],url:e.url,name:e.name,expires:e.expires&&new Date(e.expires),visibility:t,isPackage:e.is_package};return new l.LinkInfo(Object.assign(Object.assign({},n),s))},t.contactToMember=(e,t=!1)=>{if(e.type===n.default.NEW_STYLE_GROUP)return{".tag":"dropbox_id",dropbox_id:e.getContactID()};if(t&&e.type===n.default.EMAIL&&e.dbx_account_id)return{".tag":"dropbox_id",dropbox_id:e.dbx_account_id};if(e.type!==n.default.INVALID_ID)return{".tag":"email",email:e.getContactID()};throw new Error("Unknown contact type")},t.contactsToMembers=(e,s=!1)=>e.map(e=>t.contactToMember(e,s)),t.createUnionScalar=(e,t)=>new r.UnionScalar(e,t),t.combinedPolicyDiffToApi=e=>{const t={};return e?(null!=e.acl_update_policy&&(t.acl_update_policy=e.acl_update_policy),null!=e.member_policy&&(t.member_policy=e.member_policy),null!=e.shared_link_policy&&(t.shared_link_policy=e.shared_link_policy),null!=e.download_policy&&(t.download_policy=e.download_policy),null!=e.viewer_info_policy&&(t.viewer_info_policy=e.viewer_info_policy),t):t}})),define("metaserver/static/js/modules/clean/sharing/link_description",["require","exports","tslib","react","metaserver/static/js/modules/constants/trademark","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/assert","metaserver/static/js/modules/clean/sharing/link_description_plain_text","metaserver/static/js/modules/clean/sharing/link_description_advanced_settings"],(function(e,t,s,n,i,r,a,o,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLinkDescriptionPlainText=t.formatLinkDescription=t.formatShmodelLinkDescription=t.formatRighteousLinkDescription=void 0,n=s.__importDefault(n);const c=function(e){return null!=e.expires?(function(e){a.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");const t=(()=>{if(null!=e.expires){let t=e.expires.getTime()-(new Date).getTime();return t<0&&(t=0),Math.floor(t/864e5)}return-1})();return(()=>{if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return r.intl.formatMessage({id:"Rt6gCQ",defaultMessage:"{count, plural, one{Anyone with the link and the password can view this folder. Expires in a day.} other{Anyone with the link and the password can view this folder. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"public":return r.intl.formatMessage({id:"THdx1D",defaultMessage:"{count, plural, one{Anyone with the link can view this folder. Expires in a day.} other{Anyone with the link can view this folder. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"shared_folder_only":return r.intl.formatMessage({id:"cVhN0Q",defaultMessage:"{count, plural, one{Members of this folder with the link can view this folder. Expires in a day.} other{Members of this folder with the link can view this folder. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"team_and_password":return r.intl.formatMessage({id:"Pfilk1",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with the link and the password can view this folder. Expires in a day.} other{Anyone on your Dropbox team with the link and the password can view this folder. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"team_only":return r.intl.formatMessage({id:"M2M2fz",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with the link can view this folder. Expires in a day.} other{Anyone on your Dropbox team with the link can view this folder. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"only_you":return r.intl.formatMessage({id:"FPEPRA",defaultMessage:"{count, plural, one{Only you can view via the link. Expires in a day.} other{Only you can view via the link. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});default:return o.formatUnknownAudience(e.link_permissions.resolved_visibility)}else switch(e.link_permissions.resolved_visibility){case"password":return r.intl.formatMessage({id:"Xphok/",defaultMessage:"{count, plural, one{Anyone with the link and the password can view this file. Expires in a day.} other{Anyone with the link and the password can view this file. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"public":return r.intl.formatMessage({id:"fMwJMT",defaultMessage:"{count, plural, one{Anyone with the link can view this file. Expires in a day.} other{Anyone with the link can view this file. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"shared_folder_only":return r.intl.formatMessage({id:"Fbyxe1",defaultMessage:"{count, plural, one{Members of the containing shared folder with the link can view this file. Expires in a day.} other{Members of the containing shared folder with the link can view this file. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"team_and_password":return r.intl.formatMessage({id:"nZtxjD",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with the link and the password can view this file. Expires in a day.} other{Anyone on your Dropbox team with the link and the password can view this file. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"team_only":return r.intl.formatMessage({id:"DuTcCA",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with the link can view this file. Expires in a day.} other{Anyone on your Dropbox team with the link can view this file. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"no_one":return r.intl.formatMessage({id:"+I73e9",defaultMessage:"{count, plural, one{Members of this file with the link can view. Expires in a day.} other{Members of this file with the link can view. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});case"only_you":return r.intl.formatMessage({id:"FPEPRA",defaultMessage:"{count, plural, one{Only you can view via the link. Expires in a day.} other{Only you can view via the link. Expires in {count} days.}}"},{count:t,strong:e=>n.default.createElement("strong",null,e)});default:return o.formatUnknownAudience(e.link_permissions.resolved_visibility)}})()})(e):(e=>(()=>{if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return r.intl.formatMessage({id:"lULsLt",defaultMessage:"Anyone with the link and password can view this folder"},{strong:e=>n.default.createElement("strong",null,e)});case"public":return r.intl.formatMessage({id:"/D+mkV",defaultMessage:"Anyone with the link can view this folder"},{strong:e=>n.default.createElement("strong",null,e)});case"no_one":case"shared_folder_only":return r.intl.formatMessage({id:"b0InwQ",defaultMessage:"Members of this folder with this link can view this folder"},{strong:e=>n.default.createElement("strong",null,e)});case"team_and_password":return r.intl.formatMessage({id:"EtOBfz",defaultMessage:"Anyone on your Dropbox team with the link and the password can view this folder"},{strong:e=>n.default.createElement("strong",null,e)});case"team_only":return r.intl.formatMessage({id:"SZVADm",defaultMessage:"Anyone on your Dropbox team with the link can view this folder"},{strong:e=>n.default.createElement("strong",null,e)});case"only_you":return r.intl.formatMessage({id:"stkqXh",defaultMessage:"Only you can view via the link."},{strong:e=>n.default.createElement("strong",null,e)});default:return o.formatUnknownAudience(e.link_permissions.resolved_visibility)}else switch(e.link_permissions.resolved_visibility){case"password":return r.intl.formatMessage({id:"Qoycwr",defaultMessage:"Anyone with the link and password can view this file"},{strong:e=>n.default.createElement("strong",null,e)});case"public":return r.intl.formatMessage({id:"7EEE7z",defaultMessage:"Anyone with the link can view this file"},{strong:e=>n.default.createElement("strong",null,e)});case"shared_folder_only":return r.intl.formatMessage({id:"T1hxp2",defaultMessage:"Members of the containing shared folder with the link can view this file"},{strong:e=>n.default.createElement("strong",null,e)});case"team_and_password":return r.intl.formatMessage({id:"DRw3WP",defaultMessage:"Anyone on your Dropbox team with the link and the password can view this file"},{strong:e=>n.default.createElement("strong",null,e)});case"team_only":return r.intl.formatMessage({id:"k3LUkX",defaultMessage:"Anyone on your Dropbox team with the link can view this file"},{strong:e=>n.default.createElement("strong",null,e)});case"no_one":return r.intl.formatMessage({id:"KmXSRG",defaultMessage:"Members of the file with the link can view"},{strong:e=>n.default.createElement("strong",null,e)});case"only_you":return r.intl.formatMessage({id:"stkqXh",defaultMessage:"Only you can view via the link."},{strong:e=>n.default.createElement("strong",null,e)});default:return o.formatUnknownAudience(e.link_permissions.resolved_visibility)}})())(e)},d=function(e){return null!=e.expires?(function(e){a.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");const t=e.expires?e.expires.getTime():0,s=(()=>{if(null!=e.expires){let e=t-(new Date).getTime();return e<0&&(e=0),Math.floor(e/864e5)}return-1})();return(()=>{if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return r.intl.formatMessage({id:"Zkr/e/",defaultMessage:"{count, plural, one{Anyone with the link and the password can view this folder. Expires in a day. Downloads disabled.} other{Anyone with the link and the password can view this folder. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"public":return r.intl.formatMessage({id:"7V9Fkg",defaultMessage:"{count, plural, one{Anyone with the link can view this folder. Expires in a day. Downloads disabled.} other{Anyone with the link can view this folder. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"no_one":case"shared_folder_only":return r.intl.formatMessage({id:"wou0NI",defaultMessage:"{count, plural, one{Members of this folder with the link can view this folder. Expires in a day. Downloads disabled.} other{Members of this folder with the link can view this folder. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"team_and_password":return r.intl.formatMessage({id:"z5N53p",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with the link and the password can view this folder. Expires in a day. Downloads disabled.} other{Anyone on your Dropbox team with the link and the password can view this folder. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"team_only":return r.intl.formatMessage({id:"quIclB",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with the link can view this folder. Expires in a day. Downloads disabled.} other{Anyone on your Dropbox team with the link can view this folder. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"only_you":return r.intl.formatMessage({id:"SeuQjt",defaultMessage:"{count, plural, one{Only you can view via the link. Expires in a day. Downloads disabled.} other{Only you can view via the link. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});default:return o.formatUnknownAudience(e.link_permissions.resolved_visibility)}else switch(e.link_permissions.resolved_visibility){case"password":return r.intl.formatMessage({id:"T/2pGm",defaultMessage:"{count, plural, one{Anyone with the link and the password can view this file. Expires in a day. Downloads disabled.} other{Anyone with the link and the password can view this file. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"public":return r.intl.formatMessage({id:"pNbN+L",defaultMessage:"{count, plural, one{Anyone with the link can view this file. Expires in a day. Downloads disabled.} other{Anyone with the link can view this file. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"shared_folder_only":return r.intl.formatMessage({id:"1Bavz9",defaultMessage:"{count, plural, one{Members of the containing shared folder with the link can view this file. Expires in a day. Downloads disabled.} other{Members of the containing shared folder with the link can view this file. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"team_and_password":return r.intl.formatMessage({id:"GbOWVs",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with the link and the password can view this file. Expires in a day. Downloads disabled.} other{Anyone on your Dropbox team with the link and the password can view this file. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"no_one":return r.intl.formatMessage({id:"57YaoK",defaultMessage:"{count, plural, one{Members of this file with the link can view. Expires in a day. Downloads disabled.} other{Members of this file with the link can view. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"team_only":return r.intl.formatMessage({id:"QCwOVh",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with the link can view this file. Expires in a day. Downloads disabled.} other{Anyone on your Dropbox team with the link can view this file. Expires in {count} days. Downloads disabled.}}"},{count:s,strong:e=>n.default.createElement("strong",null,e)});case"only_you":return r.intl.formatMessage({id:"iWlgDz",defaultMessage:"Only you can view via the link. Expires in {count, plural, one{a day} other{# days}}. Downloads disabled."},{count:s,strong:e=>n.default.createElement("strong",null,e)});default:return o.formatUnknownAudience(e.link_permissions.resolved_visibility)}})()})(e):(e=>(()=>{if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return r.intl.formatMessage({id:"3jdOlz",defaultMessage:"Anyone with the link and password can view this folder. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"public":return r.intl.formatMessage({id:"tZhi73",defaultMessage:"Anyone with the link can view this folder. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"no_one":case"shared_folder_only":return r.intl.formatMessage({id:"TybZfs",defaultMessage:"Members of this folder with this link can view this folder. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"team_and_password":return r.intl.formatMessage({id:"lGq+yR",defaultMessage:"Anyone on your Dropbox team with the link and the password can view this folder. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"team_only":return r.intl.formatMessage({id:"ovhQZO",defaultMessage:"Anyone on your Dropbox team with the link can view this folder. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"only_you":return r.intl.formatMessage({id:"FJLHLl",defaultMessage:"Only you can view via the link. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});default:return o.formatUnknownAudience(e.link_permissions.resolved_visibility)}else switch(e.link_permissions.resolved_visibility){case"password":return r.intl.formatMessage({id:"TU1rgQ",defaultMessage:"Anyone with the link and password can view this file. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"public":return r.intl.formatMessage({id:"+EsI+X",defaultMessage:"Anyone with the link can view this file. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"shared_folder_only":return r.intl.formatMessage({id:"dDgY49",defaultMessage:"Members of the containing shared folder with the link can view this file. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"team_and_password":return r.intl.formatMessage({id:"Fa+cEy",defaultMessage:"Anyone on your Dropbox team with the link and the password can view this file. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"team_only":return r.intl.formatMessage({id:"ksjqrM",defaultMessage:"Anyone on your Dropbox team with the link can view this file. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"no_one":return r.intl.formatMessage({id:"/TynTR",defaultMessage:"Members of this file with the link can view. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});case"only_you":return r.intl.formatMessage({id:"FJLHLl",defaultMessage:"Only you can view via the link. Downloads disabled."},{strong:e=>n.default.createElement("strong",null,e)});default:return o.formatUnknownAudience(e.link_permissions.resolved_visibility)}})())(e)},u=function(e){return!1===e.link_permissions.allow_download?d(e):c(e)};t.formatShmodelLinkDescription=u;const h=function(e,t){switch(e.link_permissions.link_access_level){case"editor":return _(e,t);case"viewer":return p(e,t);default:throw Error(`Unknown link access level: ${e.link_permissions.link_access_level}`)}};t.formatRighteousLinkDescription=h;t.formatLinkDescription=function(e,t){return e.isRighteousLink()?h(e,t):u(e)};t.formatLinkDescriptionPlainText=function(e,t,s){return e.isRighteousLink()?s?l.formatRighteousLinkAdvancedSettingsDescription(e,t):h(e,t):o.formatShmodelLinkDescriptionPlainText(e)};const _=function(e,t){switch(e.link_permissions.effective_audience){case"public":return r.intl.formatMessage({id:"a3Sd0R",defaultMessage:"Anyone with this link can edit the file."});case"team":return t?r.intl.formatMessage({id:"d2zmmn",defaultMessage:"Anyone on your {trademark_business} team with this link can edit the file."},{trademark_business:i.TRADEMARK_BUSINESS}):r.intl.formatMessage({id:"BjuWgM",defaultMessage:"Anyone on the {trademark_business} team with this link can edit the file."},{trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return r.intl.formatMessage({id:"+csK/m",defaultMessage:"Members of the file with this link can edit."});default:return o.formatUnknownAudience(e.link_permissions.effective_audience)}},p=function(e,t){switch(e.link_permissions.effective_audience){case"public":return r.intl.formatMessage({id:"oxZeg7",defaultMessage:"Anyone with this link can view the file."});case"team":return t?r.intl.formatMessage({id:"KQwzZb",defaultMessage:"Anyone on your {trademark_business} team with this link can view the file."},{trademark_business:i.TRADEMARK_BUSINESS}):r.intl.formatMessage({id:"1rEKxF",defaultMessage:"Anyone on the {trademark_business} team with this link can view the file."},{trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return r.intl.formatMessage({id:"qcHpky",defaultMessage:"Members of the file with this link can view."});default:return o.formatUnknownAudience(e.link_permissions.effective_audience)}}})),define("metaserver/static/js/modules/clean/sharing/link_description_advanced_settings",["require","exports","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/assert","metaserver/static/js/modules/constants/trademark"],(function(e,t,s,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatRighteousLinkAdvancedSettingsDescription=void 0;t.formatRighteousLinkAdvancedSettingsDescription=function(e,t){return!1===e.link_permissions.allow_download?null!=e.expires?!1===e.link_permissions.require_password?h(e,t):_(e,t):!1===e.link_permissions.require_password?l(e,t):a(e,t):null!=e.expires?!1===e.link_permissions.require_password?u(e,t):d(e,t):!1===e.link_permissions.require_password?c(e,t):o(e,t)};const r=function(e){const t=e.expires?e.expires.getTime():0;if(null!=e.expires){let e=t-(new Date).getTime();return e<0&&(e=0),Math.floor(e/864e5)}return-1},a=function(e,t){switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"cxrZ5f",defaultMessage:"Anyone with this link and password can edit the file. Downloads disabled."});case"team":return t?s.intl.formatMessage({id:"TQmLgY",defaultMessage:"Anyone on your {trademark_business} team with this link and password can edit the file. Downloads disabled."},{trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"2bSlge",defaultMessage:"Anyone on the {trademark_business} team with this link and password can edit the file. Downloads disabled."},{trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"whxBh0",defaultMessage:"Members of the file with this link and password can edit. Downloads disabled."});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}case"viewer":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"PqLAde",defaultMessage:"Anyone with this link and password can view the file. Downloads disabled."});case"team":return t?s.intl.formatMessage({id:"AJEVeE",defaultMessage:"Anyone on your {trademark_business} team with this link and password can view the file. Downloads disabled."},{trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"aEL0+O",defaultMessage:"Anyone on the {trademark_business} team with this link and password can view the file. Downloads disabled."},{trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"dm25xu",defaultMessage:"Members of the file with this link and password can view. Downloads disabled."});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}default:throw Error(`Unknown link access level: ${e.link_permissions.link_access_level}`)}},o=function(e,t){switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"Y/LBQu",defaultMessage:"Anyone with this link and password can edit the file."});case"team":return t?s.intl.formatMessage({id:"C4C3zD",defaultMessage:"Anyone on your {trademark_business} team with this link and password can edit the file."},{trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"QrSEbK",defaultMessage:"Anyone on the {trademark_business} team with this link and password can edit the file."},{trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"WsbIo+",defaultMessage:"Members of the file with this link and password can edit."});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}case"viewer":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"deMB/m",defaultMessage:"Anyone with this link and password can view the file."});case"team":return t?s.intl.formatMessage({id:"jRW/3Y",defaultMessage:"Anyone on your {trademark_business} team with this link and password can view the file."},{trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"pxf8F/",defaultMessage:"Anyone on the {trademark_business} team with this link and password can view the file."},{trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"gQVZHe",defaultMessage:"Members of the file with this link and password can view."});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}default:throw Error(`Unknown link access level: ${e.link_permissions.link_access_level}`)}},l=function(e,t){switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"EEvTVP",defaultMessage:"Anyone with this link can edit the file. Downloads disabled."});case"team":return t?s.intl.formatMessage({id:"3+mqzE",defaultMessage:"Anyone on your {trademark_business} team with this link can edit the file. Downloads disabled."},{trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"xBbH4N",defaultMessage:"Anyone on the {trademark_business} team with this link can edit the file. Downloads disabled."},{trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"nHOq1c",defaultMessage:"Members of the file with this link can edit. Downloads disabled."});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}case"viewer":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"hgAISZ",defaultMessage:"Anyone with this link can view the file. Downloads disabled."});case"team":return t?s.intl.formatMessage({id:"9j7wtG",defaultMessage:"Anyone on your {trademark_business} team with this link can view the file. Downloads disabled."},{trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"HwbdrG",defaultMessage:"Anyone on the {trademark_business} team with this link can view the file. Downloads disabled."},{trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"vWPrZf",defaultMessage:"Members of the file with this link can view. Downloads disabled."});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}default:throw Error(`Unknown link access level: ${e.link_permissions.link_access_level}`)}},c=function(e,t){switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"a3Sd0R",defaultMessage:"Anyone with this link can edit the file."});case"team":return t?s.intl.formatMessage({id:"d2zmmn",defaultMessage:"Anyone on your {trademark_business} team with this link can edit the file."},{trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"BjuWgM",defaultMessage:"Anyone on the {trademark_business} team with this link can edit the file."},{trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"+csK/m",defaultMessage:"Members of the file with this link can edit."});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}case"viewer":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"oxZeg7",defaultMessage:"Anyone with this link can view the file."});case"team":return t?s.intl.formatMessage({id:"KQwzZb",defaultMessage:"Anyone on your {trademark_business} team with this link can view the file."},{trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"1rEKxF",defaultMessage:"Anyone on the {trademark_business} team with this link can view the file."},{trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"qcHpky",defaultMessage:"Members of the file with this link can view."});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}default:throw Error(`Unknown link access level: ${e.link_permissions.link_access_level}`)}},d=function(e,t){n.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");const a=r(e);switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"YGF1+m",defaultMessage:"{count, plural, one{Anyone with this link and password can edit the file. Expires in a day.} other{Anyone with this link and password can edit the file. Expires in {count} days.}}"},{count:a});case"team":return t?s.intl.formatMessage({id:"FmMziB",defaultMessage:"{count, plural, one{Anyone on your {trademark_business} team with this link and password can edit the file. Expires in a day.} other{Anyone on your {trademark_business} team with this link and password can edit the file. Expires in {count} days.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"xBIzV+",defaultMessage:"{count, plural, one{Anyone on the {trademark_business} team with this link and password can edit the file. Expires in a day.} other{Anyone on the {trademark_business} team with this link and password can edit the file. Expires in {count} days.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"Iyx6hS",defaultMessage:"{count, plural, one{Members of the file with this link and password can edit. Expires in a day.} other{Members of the file with this link and password can edit. Expires in {count} days.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}case"viewer":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"ScWMex",defaultMessage:"{count, plural, one{Anyone with this link and password can view the file. Expires in a day.} other{Anyone with this link and password can view the file. Expires in {count} days.}}"},{count:a});case"team":return t?s.intl.formatMessage({id:"q2skMY",defaultMessage:"{count, plural, one{Anyone on your {trademark_business} team with this link and password can view the file. Expires in a day.} other{Anyone on your {trademark_business} team with this link and password can view the file. Expires in {count} days.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"koMmbb",defaultMessage:"{count, plural, one{Anyone on the {trademark_business} team with this link and password can view the file. Expires in a day.} other{Anyone on the {trademark_business} team with this link and password can view the file. Expires in {count} days.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"q6m+2V",defaultMessage:"{count, plural, one{Members of the file with this link and password can view. Expires in a day.} other{Members of the file with this link and password can view. Expires in {count} days.}}"},{count:a});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}default:throw Error(`Unknown link access level: ${e.link_permissions.link_access_level}`)}},u=function(e,t){n.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");const a=r(e);switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"jpA9+q",defaultMessage:"{count, plural, one{Anyone with this link can edit the file. Expires in a day.} other{Anyone with this link can edit the file. Expires in {count} days.}}"},{count:a});case"team":return t?s.intl.formatMessage({id:"aL2iGX",defaultMessage:"{count, plural, one{Anyone on your {trademark_business} team with this link can edit the file. Expires in a day.} other{Anyone on your {trademark_business} team with this link can edit the file. Expires in {count} days.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"gbta7Y",defaultMessage:"{count, plural, one{Anyone on the {trademark_business} team with this link can edit the file. Expires in a day.} other{Anyone on the {trademark_business} team with this link can edit the file. Expires in {count} days.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"1EdolK",defaultMessage:"{count, plural, one{Members of the file with this link can edit. Expires in a day.} other{Members of the file with this link can edit. Expires in {count} days.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}case"viewer":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"VGO9WL",defaultMessage:"{count, plural, one{Anyone with this link can view the file. Expires in a day.} other{Anyone with this link can view the file. Expires in {count} days.}}"},{count:a});case"team":return t?s.intl.formatMessage({id:"6+PaTo",defaultMessage:"{count, plural, one{Anyone on your {trademark_business} team with this link can view the file. Expires in a day.} other{Anyone on your {trademark_business} team with this link can view the file. Expires in {count} days.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"dShAa9",defaultMessage:"{count, plural, one{Anyone on the {trademark_business} team with this link can view the file. Expires in a day.} other{Anyone on the {trademark_business} team with this link can view the file. Expires in {count} days.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"Pa7KCD",defaultMessage:"{count, plural, one{Members of the file with this link can view. Expires in a day.} other{Members of the file with this link can view. Expires in {count} days.}}"},{count:a});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}default:throw Error(`Unknown link access level: ${e.link_permissions.link_access_level}`)}},h=function(e,t){n.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");const a=r(e);switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"CJtjRk",defaultMessage:"{count, plural, one{Anyone with this link can edit the file. Expires in a day. Downloads disabled.} other{Anyone with this link can edit the file. Expires in {count} days. Downloads disabled.}}"},{count:a});case"team":return t?s.intl.formatMessage({id:"5K8k8j",defaultMessage:"{count, plural, one{Anyone on your {trademark_business} team with this link can edit the file. Expires in a day. Downloads disabled.} other{Anyone on your {trademark_business} team with this link can edit the file. Expires in {count} days. Downloads disabled.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"2c8AqX",defaultMessage:"{count, plural, one{Anyone on the {trademark_business} team with this link can edit the file. Expires in a day. Downloads disabled.} other{Anyone on the {trademark_business} team with this link can edit the file. Expires in {count} days. Downloads disabled.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"zUmiuz",defaultMessage:"{count, plural, one{Members of the file with this link can edit. Expires in a day. Downloads disabled.} other{Members of the file with this link can edit. Expires in {count} days. Downloads disabled.}}"},{count:a});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}case"viewer":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"LhLDTC",defaultMessage:"{count, plural, one{Anyone with this link can view the file. Expires in a day. Downloads disabled.} other{Anyone with this link can view the file. Expires in {count} days. Downloads disabled.}}"},{count:a});case"team":return t?s.intl.formatMessage({id:"b/mGhH",defaultMessage:"{count, plural, one{Anyone on your {trademark_business} team with this link can view the file. Expires in a day. Downloads disabled.} other{Anyone on your {trademark_business} team with this link can view the file. Expires in {count} days. Downloads disabled.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"YxsBme",defaultMessage:"{count, plural, one{Anyone on the {trademark_business} team with this link can view the file. Expires in a day. Downloads disabled.} other{Anyone on the {trademark_business} team with this link can view the file. Expires in {count} days. Downloads disabled.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"9FCQD8",defaultMessage:"{count, plural, one{Members of the file with this link can view. Expires in a day. Downloads disabled.} other{Members of the file with this link can view. Expires in {count} days. Downloads disabled.}}"},{count:a});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}default:throw Error(`Unknown link access level: ${e.link_permissions.link_access_level}`)}},_=function(e,t){n.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");const a=r(e);switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"9DkYwJ",defaultMessage:"{count, plural, one{Anyone with this link and password can edit the file. Expires in a day. Downloads disabled.} other{Anyone with this link and password can edit the file. Expires in {count} days. Downloads disabled.}}"},{count:a});case"team":return t?s.intl.formatMessage({id:"2WlplE",defaultMessage:"{count, plural, one{Anyone on your {trademark_business} team with this link and password can edit the file. Expires in a day. Downloads disabled.} other{Anyone on your {trademark_business} team with this link and password can edit the file. Expires in {count} days. Downloads disabled.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"01SzRQ",defaultMessage:"{count, plural, one{Anyone on the {trademark_business} team with this link and password can edit the file. Expires in a day. Downloads disabled.} other{Anyone on the {trademark_business} team with this link and password can edit the file. Expires in {count} days. Downloads disabled.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"i88LS8",defaultMessage:"{count, plural, one{Members of the file with this link and password can edit. Expires in a day. Downloads disabled.} other{Members of the file with this link and password can edit. Expires in {count} days. Downloads disabled.}}"},{count:a});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}case"viewer":switch(e.link_permissions.effective_audience){case"public":return s.intl.formatMessage({id:"/Ke+Ja",defaultMessage:"{count, plural, one{Anyone with this link and password can view the file. Expires in a day. Downloads disabled.} other{Anyone with this link and password can view the file. Expires in {count} days. Downloads disabled.}}"},{count:a});case"team":return t?s.intl.formatMessage({id:"oSMrQu",defaultMessage:"{count, plural, one{Anyone on your {trademark_business} team with this link and password and password can view the file. Expires in a day. Downloads disabled.} other{Anyone on your {trademark_business} team with this link and password can view the file. Expires in {count} days. Downloads disabled.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS}):s.intl.formatMessage({id:"iN+FK7",defaultMessage:"{count, plural, one{Anyone on the {trademark_business} team with this link and password can view the file. Expires in a day. Downloads disabled.} other{Anyone on the {trademark_business} team with this link and password can view the file. Expires in {count} days. Downloads disabled.}}"},{count:a,trademark_business:i.TRADEMARK_BUSINESS});case"no_one":return s.intl.formatMessage({id:"yenocu",defaultMessage:"{count, plural, one{Members of the file with this link and password can view. Expires in a day. Downloads disabled.} other{Members of the file with this link and password can view. Expires in {count} days. Downloads disabled.}}"},{count:a});default:throw Error(`Unknown link audience: ${e.link_permissions.effective_audience}`)}default:throw Error(`Unknown link access level: ${e.link_permissions.link_access_level}`)}}})),define("metaserver/static/js/modules/clean/sharing/link_description_plain_text",["require","exports","metaserver/static/js/modules/core/assert","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/exception"],(function(e,t,s,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatUnknownAudience=t.formatShmodelLinkDescriptionPlainText=void 0;const r=function(e){const t=e.expires?e.expires.getTime():0;if(null!=e.expires){let e=t-(new Date).getTime();return e<0&&(e=0),Math.floor(e/864e5)}return-1};function a(e){return i.reportStack(`Unknown audience when building link description: ${e}`,{severity:i.SEVERITY.CRITICAL,tags:["sharing"]}),""}t.formatShmodelLinkDescriptionPlainText=function(e){return!1===e.link_permissions.allow_download?null!=e.expires?(function(e){s.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");const t=r(e);return(()=>{if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return n.intl.formatMessage({id:"vZ+Gcq",defaultMessage:"{count, plural, one{Anyone with this link and the password can view the folder. Expires in a day. Downloads disabled.} other{Anyone with this link and the password can view the folder. Expires in {count} days. Downloads disabled.}}"},{count:t});case"public":return n.intl.formatMessage({id:"OrpLrY",defaultMessage:"{count, plural, one{Anyone with this link can view the folder. Expires in a day. Downloads disabled.} other{Anyone with this link can view the folder. Expires in {count} days. Downloads disabled.}}"},{count:t});case"shared_folder_only":return n.intl.formatMessage({id:"dBd/+Q",defaultMessage:"{count, plural, one{Members of the folder with this link can view this folder. Expires in a day. Downloads disabled.} other{Members of the folder with this link can view this folder. Expires in {count} days. Downloads disabled.}}"},{count:t});case"team_and_password":return n.intl.formatMessage({id:"gSChY6",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with this link and the password can view the folder. Expires in a day. Downloads disabled.} other{Anyone on your Dropbox team with this link and the password can view the folder. Expires in {count} days. Downloads disabled.}}"},{count:t});case"team_only":return n.intl.formatMessage({id:"SkY8H3",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with this link can view the folder. Expires in a day. Downloads disabled.} other{Anyone on your Dropbox team with this link can view the folder. Expires in {count} days. Downloads disabled.}}"},{count:t});case"no_one":return n.intl.formatMessage({id:"45l3oV",defaultMessage:"{count, plural, one{Members of the folder with this link can view. Expires in a day. Downloads disabled.} other{Members of the folder with this link can view. Expires in {count} days. Downloads disabled.}}"},{count:t});case"only_you":return n.intl.formatMessage({id:"8vR+GP",defaultMessage:"{count, plural, one{Only you can view via this link. Expires in a day. Downloads disabled.} other{Only you can view via this link. Expires in {count} days. Downloads disabled.}}"},{count:t});default:return a(e.link_permissions.resolved_visibility)}else switch(e.link_permissions.resolved_visibility){case"password":return n.intl.formatMessage({id:"7v6dcE",defaultMessage:"{count, plural, one{Anyone with this link and the password can view the file. Expires in a day. Downloads disabled.} other{Anyone with this link and the password can view the file. Expires in {count} days. Downloads disabled.}}"},{count:t});case"public":return n.intl.formatMessage({id:"LhLDTC",defaultMessage:"{count, plural, one{Anyone with this link can view the file. Expires in a day. Downloads disabled.} other{Anyone with this link can view the file. Expires in {count} days. Downloads disabled.}}"},{count:t});case"shared_folder_only":return n.intl.formatMessage({id:"euxNFl",defaultMessage:"{count, plural, one{Members of the containing shared folder with this link can view the file. Expires in a day. Downloads disabled.} other{Members of the containing shared folder with this link can view this file. Expires in {count} days. Downloads disabled.}}"},{count:t});case"team_and_password":return n.intl.formatMessage({id:"8EZlSa",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with this link and the password can view the file. Expires in a day. Downloads disabled.} other{Anyone on your Dropbox team with this link and the password can view the file. Expires in {count} days. Downloads disabled.}}"},{count:t});case"team_only":return n.intl.formatMessage({id:"+sU/hx",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with this link can view the file. Expires in a day. Downloads disabled.} other{Anyone on your Dropbox team with this link can view the file. Expires in {count} days. Downloads disabled.}}"},{count:t});case"no_one":return n.intl.formatMessage({id:"9FCQD8",defaultMessage:"{count, plural, one{Members of the file with this link can view. Expires in a day. Downloads disabled.} other{Members of the file with this link can view. Expires in {count} days. Downloads disabled.}}"},{count:t});case"only_you":return n.intl.formatMessage({id:"8vR+GP",defaultMessage:"{count, plural, one{Only you can view via this link. Expires in a day. Downloads disabled.} other{Only you can view via this link. Expires in {count} days. Downloads disabled.}}"},{count:t});default:return a(e.link_permissions.resolved_visibility)}})()})(e):(e=>(()=>{if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return n.intl.formatMessage({id:"vS4Oei",defaultMessage:"Anyone with this link and password can view the folder. Downloads disabled."});case"public":return n.intl.formatMessage({id:"2q+G4r",defaultMessage:"Anyone with this link can view the folder. Downloads disabled."});case"shared_folder_only":return n.intl.formatMessage({id:"eW5qss",defaultMessage:"Members of the folder with this link can view the folder. Downloads disabled."});case"team_and_password":return n.intl.formatMessage({id:"BOIgzx",defaultMessage:"Anyone on your Dropbox team with this link and the password can view the folder. Downloads disabled."});case"team_only":return n.intl.formatMessage({id:"xzbxdc",defaultMessage:"Anyone on your Dropbox team with this link can view the folder. Downloads disabled."});case"no_one":return n.intl.formatMessage({id:"9htZoO",defaultMessage:"Members of the folder with this link can view. Downloads disabled."});case"only_you":return n.intl.formatMessage({id:"fGFHbB",defaultMessage:"Only you can view via this link. Downloads disabled."});default:return a(e.link_permissions.resolved_visibility)}else switch(e.link_permissions.resolved_visibility){case"password":return n.intl.formatMessage({id:"PqLAde",defaultMessage:"Anyone with this link and password can view the file. Downloads disabled."});case"public":return n.intl.formatMessage({id:"hgAISZ",defaultMessage:"Anyone with this link can view the file. Downloads disabled."});case"shared_folder_only":return n.intl.formatMessage({id:"GYDnJ7",defaultMessage:"Members of the containing shared folder with this link can view the file. Downloads disabled."});case"team_and_password":return n.intl.formatMessage({id:"pDYnvf",defaultMessage:"Anyone on your Dropbox team with this link and the password can view the file. Downloads disabled."});case"team_only":return n.intl.formatMessage({id:"dYMwXa",defaultMessage:"Anyone on your Dropbox team with this link can view the file. Downloads disabled."});case"no_one":return n.intl.formatMessage({id:"vWPrZf",defaultMessage:"Members of the file with this link can view. Downloads disabled."});case"only_you":return n.intl.formatMessage({id:"fGFHbB",defaultMessage:"Only you can view via this link. Downloads disabled."});default:return a(e.link_permissions.resolved_visibility)}})())(e):null!=e.expires?(function(e){s.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");const t=r(e);return(()=>{if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return n.intl.formatMessage({id:"xYXFPH",defaultMessage:"{count, plural, one{Anyone with this link and the password can view the folder. Expires in a day.} other{Anyone with this link and the password can view the folder. Expires in {count} days.}}"},{count:t});case"public":return n.intl.formatMessage({id:"xZI0xM",defaultMessage:"{count, plural, one{Anyone with this link can view the folder. Expires in a day.} other{Anyone with this link can view the folder. Expires in {count} days.}}"},{count:t});case"shared_folder_only":return n.intl.formatMessage({id:"YUkY7N",defaultMessage:"{count, plural, one{Members of the folder with this link can view the folder. Expires in a day.} other{Members of the folder with this link can view the folder. Expires in {count} days.}}"},{count:t});case"team_and_password":return n.intl.formatMessage({id:"t7SwRy",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with this link and the password can view the folder. Expires in a day.} other{Anyone on your Dropbox team with this link and the password can view the folder. Expires in {count} days.}}"},{count:t});case"team_only":return n.intl.formatMessage({id:"mY+P4M",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with this link can view the folder. Expires in a day.} other{Anyone on your Dropbox team with this link can view the folder. Expires in {count} days.}}"},{count:t});case"no_one":return n.intl.formatMessage({id:"RHtmRP",defaultMessage:"{count, plural, one{Members of the folder with this link can view. Expires in a day.} other{Members of the folder with this link can view. Expires in {count} days.}}"},{count:t});case"only_you":return n.intl.formatMessage({id:"hTH6PN",defaultMessage:"{count, plural, one{Only you can view via this link. Expires in a day.} other{Only you can view via this link. Expires in {count} days.}}"},{count:t});default:return a(e.link_permissions.resolved_visibility)}else switch(e.link_permissions.resolved_visibility){case"password":return n.intl.formatMessage({id:"RwPv2b",defaultMessage:"{count, plural, one{Anyone with this link and the password can view the file. Expires in a day.} other{Anyone with this link and the password can view the file. Expires in {count} days.}}"},{count:t});case"public":return n.intl.formatMessage({id:"VGO9WL",defaultMessage:"{count, plural, one{Anyone with this link can view the file. Expires in a day.} other{Anyone with this link can view the file. Expires in {count} days.}}"},{count:t});case"shared_folder_only":return n.intl.formatMessage({id:"GDSx6k",defaultMessage:"{count, plural, one{Members of the containing shared folder with this link can view the file. Expires in a day.} other{Members of the containing shared folder with this link can view the file. Expires in {count} days.}}"},{count:t});case"team_and_password":return n.intl.formatMessage({id:"Zeh+SK",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with this link and the password can view the file. Expires in a day.} other{Anyone on your Dropbox team with this link and the password can view the file. Expires in {count} days.}}"},{count:t});case"team_only":return n.intl.formatMessage({id:"eTrJTC",defaultMessage:"{count, plural, one{Anyone on your Dropbox team with this link can view the file. Expires in a day.} other{Anyone on your Dropbox team with this link can view the file. Expires in {count} days.}}"},{count:t});case"no_one":return n.intl.formatMessage({id:"Pa7KCD",defaultMessage:"{count, plural, one{Members of the file with this link can view. Expires in a day.} other{Members of the file with this link can view. Expires in {count} days.}}"},{count:t});case"only_you":return n.intl.formatMessage({id:"hTH6PN",defaultMessage:"{count, plural, one{Only you can view via this link. Expires in a day.} other{Only you can view via this link. Expires in {count} days.}}"},{count:t});default:return a(e.link_permissions.resolved_visibility)}})()})(e):(e=>(()=>{if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return n.intl.formatMessage({id:"sYUe0C",defaultMessage:"Anyone with this link and password can view the folder."});case"public":return n.intl.formatMessage({id:"ysL13U",defaultMessage:"Anyone with this link can view the folder."});case"shared_folder_only":return n.intl.formatMessage({id:"kKbOL4",defaultMessage:"Members of the folder with this link can view the folder."});case"team_and_password":return n.intl.formatMessage({id:"GmhVIx",defaultMessage:"Anyone on your Dropbox team with this link and the password can view the folder."});case"team_only":return n.intl.formatMessage({id:"82WU9J",defaultMessage:"Anyone on your Dropbox team with this link can view the folder."});case"no_one":return n.intl.formatMessage({id:"XqgOD/",defaultMessage:"Members of the folder with this link can view."});case"only_you":return n.intl.formatMessage({id:"MrEDaY",defaultMessage:"Only you can view via this link."});default:return a(e.link_permissions.resolved_visibility)}else switch(e.link_permissions.resolved_visibility){case"password":return n.intl.formatMessage({id:"deMB/m",defaultMessage:"Anyone with this link and password can view the file."});case"public":return n.intl.formatMessage({id:"oxZeg7",defaultMessage:"Anyone with this link can view the file."});case"shared_folder_only":return n.intl.formatMessage({id:"a6Ka8X",defaultMessage:"Members of the containing shared folder with this link can view the file."});case"team_and_password":return n.intl.formatMessage({id:"35NLW6",defaultMessage:"Anyone on your Dropbox team with this link and the password can view the file."});case"team_only":return n.intl.formatMessage({id:"xqds9K",defaultMessage:"Anyone on your Dropbox team with this link can view the file."});case"no_one":return n.intl.formatMessage({id:"qcHpky",defaultMessage:"Members of the file with this link can view."});case"only_you":return n.intl.formatMessage({id:"MrEDaY",defaultMessage:"Only you can view via this link."});default:return a(e.link_permissions.resolved_visibility)}})())(e)},t.formatUnknownAudience=a})),define("metaserver/static/js/modules/clean/sharing/link_info",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkInfo=void 0;t.LinkInfo=class{constructor({expires:e,isFolder:t,name:s,teamId:n,teamName:i,url:r,visibility:a,isPackage:o}){this.expires=e,this.isFolder=t,this.name=s,this.teamId=n,this.teamName=i,this.url=r,this.visibility=a,this.isPackage=o}}})),define("metaserver/static/js/modules/clean/teams/admin/api/admin_console_api_client",["require","exports","tslib","metaserver/static/js/api_v2/types","metaserver/static/js/modules/clean/cloud_docs/types","metaserver/static/js/modules/clean/profile_services/profile_services_constants","metaserver/static/js/api_v2/default_team_client","metaserver/static/js/modules/clean/filepath/filepath","metaserver/static/js/modules/clean/sharing/api/util/types","metaserver/static/js/modules/clean/viewer","metaserver/static/js/modules/clean/teams/admin/widgets/settings_content_management/constants/constants","metaserver/static/js/api_v2/user_client"],(function(e,t,s,n,i,r,a,o,l,c,d,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.AdminConsoleApiClient=void 0,r=s.__importDefault(r),o=s.__importStar(o);const h=e=>({".tag":"email",email:e});class _{constructor(e=!1){this.isCMForCDM=e;const t=c.Viewer.get_viewer().get_user_by_role("work");t&&(t.team_member_id&&(this.selectAdminParams={headers:{[n.ApiV2HeaderNames.DropboxApiSelectAdmin]:t.team_member_id}}),this.teamClient=new a.DefaultTeamApiV2Client(t))}teamRoutes(){return this.teamClient.ns("team")}domainRoutes(){return this.teamClient.ns("domains")}teamMembersInternal(){return this.teamClient.ns("team_members_internal")}teamInsightsRoutes(){return this.teamClient.ns("team_insights")}teamAdminAlertingRoutes(){return this.teamClient.ns("admin_alerting")}teamLogRoutes(){return this.teamClient.ns("team_log")}usersRoutes(){return this.teamClient.ns("users")}filesRoutes(){return this.teamClient.ns("files")}sharingRoutes(){return this.teamClient.ns("sharing")}federationRoutes(){return this.teamClient.ns("federation")}fileTransfersRoutes(){return this.teamClient.ns("file_transfers")}emailIngestRoutes(){return this.teamClient.ns("email_ingest")}cloudDocsRoutes(){return this.teamClient.ns("cloud_docs")}setPermanentDeletePolicy(e){return this.teamRoutes().rpc("set_permanent_delete_policy",{permanent_delete_enabled:e},{})}setContentAdministrationPolicy(e){const t={".tag":d.ContentAdministrationPolicyValue[e]};return this.teamRoutes().rpc("set_content_administration_policy",{content_administration_policy:t},{})}setRewindPolicy(e){const t={".tag":e};return this.teamRoutes().rpc("set_rewind_policy",{rewind_policy:t},{})}setCloudDocsPolicy(e,t){const s={};if(s[i.CloudDocProviderIntegration.GDD_INTEGRATION.toString()]=e?i.IntegrationCreateAndEdit:i.IntegrationViewOnly,"boolean"==typeof t){s[i.CloudDocProviderIntegration.PAPER_INTEGRATION.toString()]=t?i.IntegrationCreateAndEdit:i.IntegrationViewOnly}return this.cloudDocsRoutes().rpc("team_settings/set",{settings:s},this.selectAdminParams)}setMultipleAccountsPolicy(e){return this.teamRoutes().rpc("set_multiple_accounts_policy",{multiple_accounts_enabled:e},{})}setSendForSignaturePolicy(e){return this.teamRoutes().rpc("set_send_for_signature_policy",{send_for_signature_enabled:e},{})}setSecondaryEmailsPolicy(e){const t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("set_secondary_mails_policy",{secondary_mails_policy:t},{})}setClassificationPolicyOld(e){const t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("classification/set_classification_policy",{classification_policy:t},{})}setClassificationPolicy(e){const t=e;return this.teamRoutes().rpc("classification/set_classification_policy",{classification_policy:t},{})}generateClassificationReport(){return this.teamRoutes().rpc("classification/generate_report",void 0,{})}setCameraUploadsPolicy(e){const t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("set_camera_uploads_policy",{camera_uploads_policy:t},{})}setDesktopAppDefaults(e){const t=e;return this.teamRoutes().rpc("set_team_default_desktop_pathway",{pathway:t},{})}setFileLockingPolicy(e){const t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("set_file_locking_policy",{file_locking_policy:t},{})}setSmarterSmartSyncPolicy(e){const t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("set_smarter_smart_sync_policy",{smarter_smart_sync_policy:t},{})}setComputerBackupPolicy(e){const t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("set_computer_backup_policy",{computer_backup_policy:t},{})}setExternalDriveBackupPolicy(e){const t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("set_external_drive_backup_policy",{external_drive_backup_policy:t},{})}updateAppActionSettings(e,t){return this.teamRoutes().rpc("app_actions/update_settings",{allow_actions:e,action_state_updates:t.map(e=>({id:e.id,is_enabled:!e.isIndividuallyDisabled}))},{})}updateTeamIntegrationSettings(e){const t={},s=e.find(e=>"zoom"===e.id);s&&s.teamSettings&&(t.zoom_team_settings={meeting_recordings_disabled_by_admin:s.teamSettings.zoomMeetingRecordingsDisabledByAdmin});const n=e.find(e=>"canvas"===e.id);n&&n.teamSettings&&(t.canvas_team_settings={canvas_custom_api_domain:n.teamSettings.canvasCustomApiDomain});const i=[],a=e.find(e=>"google"===e.id);return a&&a.teamSettings&&i.push((new u.UserApiV2Client).ns("domain_contacts").rpc("disconnect",{service:r.default.to_api_service_type(r.default.GOOGLE)},{subjectUserId:c.Viewer.get_viewer().work_user.id})),(t.canvas_team_settings||t.zoom_team_settings)&&i.push(this.teamRoutes().rpc("integrations/set_team_integration_settings",t,{})),Promise.all(i)}updateCanvasIntegrationSettings(e){return this.teamRoutes().rpc("integrations/set_team_integration_settings",{canvas_team_settings:{canvas_custom_api_domain:e}},{})}updateCommunicationAppSettings(e){const t=e.find(e=>"google"===e.id);return t&&((new u.UserApiV2Client).ns("domain_contacts").rpc("set_feature",{service:r.default.to_api_service_type(r.default.GOOGLE),action:{".tag":t.isIndividuallyDisabled?"disable":"enable"}},{subjectUserId:c.Viewer.get_viewer().work_user.id}),t.preventFurtherChanges=!1),this.teamRoutes().rpc("profile_services/set_service_enabled_states",{enabled_state_updates:e.map(e=>({service:{".tag":e.id},is_enabled:!e.isIndividuallyDisabled}))},{})}updateCoordinationAppSettings(e){return this.teamRoutes().rpc("profile_services/set_service_enabled_states",{enabled_state_updates:e.map(e=>({service:{".tag":e.id},is_enabled:!e.isIndividuallyDisabled}))},{})}setFileRequestPolicy(e){return this.teamRoutes().rpc("sharing/set_file_request_policy",{file_request_enabled:e},{})}setCaptureTranscriptPolicy(e){return this.teamRoutes().rpc("ml_platform/set_team_capability_policy",{updated_capability_policies:[{capability:{".tag":"transcription"},product:{".tag":"capture"},opt_policy:{".tag":e?"opt_in":"opt_out"}}]},{})}setDropboxPasswordsPolicy(e){return this.teamRoutes().rpc("dropbox_passwords/set_dropbox_passwords_policy",{dropbox_passwords_policy:{".tag":e?"enabled":"disabled"}},{})}setEmailIngestPolicy(e){return this.emailIngestRoutes().rpc("teams/set_policy",{email_ingest_enabled:e},{})}setOfficeAddInPolicy(e){return this.teamRoutes().rpc("set_office_addin_policy",{office_addin_enabled:e},{})}setSharedLinkPolicy(e,t){const s={sharing_outside_enabled:e};return e&&(s.default_visibility=t),this.teamRoutes().rpc("sharing/set_shared_link_policy",s,{})}setSharedLinkControlPolicy(e,t){const s={days_to_expire_policy:{".tag":e.daysToExpire},change_shared_link_expiration_policy:e.changeSharedLinkExpirationPolicy?{".tag":e.changeSharedLinkExpirationPolicy}:void 0,enforce_shared_link_password_policy:t?{".tag":t}:void 0};return this.teamRoutes().rpc("sharing/set_shared_link_control_policy",s,{})}setSharedFolderSharingPolicy(e,t){return t?this.teamRoutes().rpc("sharing/set_shared_folder_sharing_policy",{sharing_outside_enabled:e,external_sharing_policy:{".tag":t}},{}):this.teamRoutes().rpc("sharing/set_shared_folder_sharing_policy",{sharing_outside_enabled:e},{})}setSharedFolderJoiningPolicy(e){return this.teamRoutes().rpc("sharing/set_shared_folder_joining_policy",{joining_outside_enabled:e},{})}setFileTransfersPolicy(e){return this.fileTransfersRoutes().rpc("teams/set_file_transfers_policy",{file_transfers_enabled:e},{})}setCommentingPolicy(e){return this.teamRoutes().rpc("sharing/set_commenting_policy",{commenting_enabled:e},{})}setPasswordStrength(e,t){const s="enabled"===e?t:"minimal_requirements";return this.teamRoutes().rpc("set_password_requirements",{password_strength_policy:s},{})}resetAllPasswords(){return this.teamRoutes().rpc("reset_all_passwords",void 0,{})}setViewerInfoSetting(e){return this.teamRoutes().rpc("set_viewer_info_policy",{viewer_info_policy:e},{})}setPaperPolicy(e,t,s,n){const i={paper_enabled:e,paper_deployment_mode:{paper_deployment_type:s,enabled_members_update:{users_to_add:this.make_user_selector_list(n.users_to_add),users_to_remove:this.make_user_selector_list(n.users_to_remove)}}};return t&&(i.dropbox_terms="agree"),this.teamRoutes().rpc("paper/set_paper_policy",i,{})}setPaperSharingPolicy(e=!0,t){const s={external_sharing_allowed:void 0===e||e,default_visibility:t};return this.teamRoutes().rpc("paper/set_paper_sharing_policy",s,{})}setPaperDefaultFolderPolicy(e){return this.teamRoutes().rpc("paper/set_paper_default_folder_policy",{default_folder_policy:e},{})}setPaperDesktopPolicy(e){return this.teamRoutes().rpc("paper/set_paper_desktop_policy",{enabled:e},{})}schedulePiFSMigration(e,t){return this.teamRoutes().rpc("paper/schedule_pifs_migration",{scheduled_migration_timestamp:e,admin_wants_team_members_notified:t},{})}removeScheduledPiFSMigration(){return this.teamRoutes().rpc("paper/remove_scheduled_pifs_migration",void 0,{})}setShowcasePolicy(e,t,s){const n={showcase_enabled:e,external_sharing_enabled:t,download_enabled:s};return this.teamRoutes().rpc("showcase/set_showcase_policy",n,{})}setRequestMembershipPolicy(e){return this.teamRoutes().rpc("set_request_membership_policy",{request_membership:e},{})}setSuggestMembersPolicy(e){return this.teamRoutes().rpc("set_suggest_members_policy",{suggest_members_enabled:e},{})}setInviteAcceptanceEmailPolicy(e){return this.teamRoutes().rpc("set_invite_acceptance_email_policy",{enable:e},{})}setMembersSendInvitePolicy(e,t,s,n){const i={member_send_invite_policy:e,can_send_invite_member_list_changes:{users_to_add:t.users_to_add.map(h),users_to_remove:t.users_to_remove.map(h)},source:s,domain_restriction_enabled:n};return this.teamRoutes().rpc("set_member_send_invite_policy",i,{})}setWatermarkingPolicy(e){return this.teamRoutes().rpc("workflows/set_watermarking_policy",{watermarking_policy:{".tag":e?"on":"off"}},{})}deviceManagementGetExcludedUsers(){return this.teamRoutes().rpc("device_management/get_excluded_users",void 0,{})}deviceManagementConfigureSettings(e){return this.teamRoutes().rpc("device_management/configure_settings",e,{})}static mapValueToRolloutMethod(e){return 0===e?"unlink_all":1===e?"unlink_most_inactive":"add_member_to_exceptions"}deviceManagementConfigureSettingsForAcf(e,t,s,n,i){const r={is_enabled:!0,can_user_remove_device:t,rollout_method:{".tag":_.mapValueToRolloutMethod(i)},users_to_add:e.users_to_add,users_to_remove:e.users_to_remove,desktop_devices_limit:-1===s?{".tag":"unlimited"}:{limited:Number(s),".tag":"limited"},mobile_devices_limit:-1===n?{".tag":"unlimited"}:{limited:Number(n),".tag":"limited"}};return this.teamRoutes().rpc("device_management/configure_settings",r,{})}deviceManagementConfigureSettingsDisable(){return this.teamRoutes().rpc("device_management/configure_settings",{is_enabled:!1},{})}deviceManagementRemoveDevice(e,t,s){return this.teamRoutes().rpc("device_management/remove_device",{user_id:e,device_id:t,delete_data:s},{})}deviceManagementRemoveClient(e,t,s,n){return this.teamRoutes().rpc("device_management/remove_client",{user_id:e,device_id:t,client_unique_identifier:s,delete_data:n},{})}webSessionManagementConfigureSettings(e,t,s){return this.teamRoutes().rpc("web_session_management/configure_settings",{remember_session_expires:e,idle_session_timeout:t,number_of_allowed_sessions:s},{})}teamFolderArchive(e,t=!1){return this.teamRoutes().rpc("team_folder/archive",{team_folder_id:String(e),force_async_off:!t},{})}teamFolderUnarchive(e){return this.teamRoutes().rpc("team_folder/activate",{team_folder_id:String(e)},{})}teamFolderCreate(e,t){const s={name:e};return void 0!==t&&(s.sync_setting=t?{".tag":"default"}:{".tag":"not_synced"}),this.teamRoutes().rpc("team_folder/create",s,{})}teamFolderUpdateSyncSetting({teamFolderId:e,syncSetting:t,fileIds:s}){const n={team_folder_id:e},i={".tag":t};return s?n.content_sync_settings=s.map(e=>({id:e,sync_setting:i})):n.sync_setting=i,this.teamRoutes().rpc("team_folder/update_sync_settings",n,{})}teamFoldersList(e=1e3){return this.teamRoutes().rpc("team_folder/list",{limit:e},{})}teamFoldersListContinue(e){return this.teamRoutes().rpc("team_folder/list/continue",{cursor:e},{})}teamNamespacesList(){return this.teamRoutes().rpc("namespaces/list",{filter:{".tag":"eligible_for_cm_top_level_page"}},{})}teamNamespacesListContinue(e){return this.teamRoutes().rpc("namespaces/list/continue",{cursor:e,filter:{".tag":"eligible_for_cm_top_level_page"}},{})}teamFolderRename(e,t){return this.teamRoutes().rpc("team_folder/rename",{team_folder_id:String(e),name:t},{})}teamFolderPermanentlyDelete(e){return this.teamRoutes().rpc("team_folder/permanently_delete",{team_folder_id:String(e)},{})}teamIntegrationSettings(){return this.teamRoutes().rpc("integrations/get_team_integration_settings",void 0,{})}setGroupsCreationPolicy(e){return this.teamRoutes().rpc("groups/set_creation_policy",{group_creation:e},{})}setNTSBlockTrafficPolicy(e){return this.teamRoutes().rpc("nts/set_block_traffic_policy",{block_traffic_enabled:e},{})}setSyncPolicy(e,t){return this.teamRoutes().rpc("set_infinite_policy",{setting:e,admin_sync_defaults_enabled:t},{})}configureSsoAndGoogleLoginPolicy(e,t,s,n,i,r){return this.teamRoutes().rpc("configure_sso_and_google_login_policy",{sso_policy:e,sign_in_url:t,sign_out_url:s,saml_cert:n,saml_nameid_format:i,google_login_enabled:r},{})}configureSso(e,t,s,n,i){return this.teamRoutes().rpc("configure_sso",{sso_policy:e,saml_cert:t,sign_in_url:s,sign_out_url:n,nameid_format:i},{})}configureDirectoryRestrictions(e){const t={users_to_add:e.users_to_add,users_to_remove:e.users_to_remove};return this.teamRoutes().rpc("directory_restrictions/configure_settings",t,{})}configureGoogleLoginPolicy(e){return this.teamRoutes().rpc("configure_google_login_policy",{google_login_enabled:e},{})}setResellerSupportSetting(e){return this.teamRoutes().rpc("change_reseller_support",{reseller_support_enabled:e},{})}setTeamBrandingPolicy(e){return this.teamRoutes().rpc("set_team_branding_policy",{team_branding_policy:{".tag":e?"enabled":"disabled"}},{})}folderCreate(e,t,s){"/"!==t&&(t+="/");const n="ns:"+e+t+s;return this.filesRoutes().rpc("create_folder",{path:n},this.selectAdminParams)}bulkFileDelete(e){const t=[];let s=null;for(let n=0,i=e.length;nContent page to manage your team’s content. More about admin roles"},{a:e=>i.default.createElement("a",{"aria-label":"content",href:"/team/admin/content?role=work",target:"_blank",rel:"noopener noreferrer"},e),b:e=>i.default.createElement("a",{"aria-label":"admin roles",href:"https://help.dropbox.com/teams-admins/admin/change-admin-rights",target:"_blank",rel:"noopener noreferrer"},e)})})),define("metaserver/static/js/modules/clean/tokenizer",["require","exports","tslib","classnames","create-react-class","react","react-dom","prop-types","lodash","jquery","ts-key-enum","metaserver/static/js/modules/clean/typeahead"],(function(e,t,s,n,i,r,a,o,l,c,d,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tokenizer=t.Token=void 0,n=s.__importDefault(n),i=s.__importDefault(i),r=s.__importDefault(r),a=s.__importStar(a),o=s.__importDefault(o),l=s.__importStar(l),c=s.__importDefault(c);class h extends r.default.Component{constructor(){super(...arguments),this._makeCloseButton=()=>this.props.onRemove?r.default.createElement("span",{className:"tokenizer-token-close",onClick:()=>(this.props.onRemove(),!1),dangerouslySetInnerHTML:{__html:" "}}):""}render(){const e={"tokenizer-token":!0};return e[this.props.className]=!0,r.default.createElement("a",Object.assign({tabIndex:-1},this.props,{className:n.default(e)}),String(this.props.data),this._makeCloseButton())}}t.Token=h,h.displayName="Token",h.propTypes={className:o.default.string,data:o.default.any,onRemove:o.default.func};const _=i.default({displayName:"Tokenizer",propTypes:{customClass:o.default.string,dataSource:o.default.object.isRequired,initialInputText:o.default.string,logSearchBegin:o.default.func,logSearchComplete:o.default.func,logTokenChangeEvent:o.default.func,onContentsChange:o.default.func,onTokensAdd:o.default.func,onTokenRemove:o.default.func,placeholderText:o.default.string,populatedTokenData:o.default.array,renderToken:o.default.func.isRequired,renderTokenHover:o.default.func,renderInput:o.default.func.isRequired,renderSelector:o.default.func.isRequired,stringTokenizer:o.default.func.isRequired,tokenSpacing:o.default.number,focusOnMount:o.default.bool,tabIndex:o.default.number,disableAdditionalInput:o.default.bool,disabled:o.default.bool,resetTokenData:o.default.bool,tokenizeOnOutOfFocus:o.default.bool,postSelect:o.default.func,validatedTokenMap:o.default.object},getDefaultProps:()=>({initialInputText:"",renderInput:()=>r.default.createElement("input",null),renderSelector:()=>r.default.createElement(u.TypeaheadSelector,null),renderToken:e=>r.default.createElement(h,{data:e}),stringTokenizer(e,t){const s=e.split(","),n=t?"":s.pop();return{tokens:s,value:n}},tokenSpacing:3,focusOnMount:!1,logSearchBegin:null,logSearchComplete:null,disableAdditionalInput:!1,disabled:!1,resetTokenData:!1,tokenizeOnOutOfFocus:!1}),getInitialState(){return this.tokenData=[],this.queryResults=null,{queryResults:this.queryResults,tokenData:this.tokenData,selectedTokenIndex:null,inputWidth:150,numLines:1}},componentDidMount(){if(setTimeout(this._resizeTokenizerInput,0),a.findDOMNode(this.refs.input).value=this.props.initialInputText,c.default(a.findDOMNode(this.refs.tokenizer_input)).on("keydown",this._proxyKeys),this.tokenizeOnOutOfFocus&&c.default(a.findDOMNode(this.refs.tokenizer_input)).on("focusout",this._tokenizeIfHasInput),document.addEventListener("click",this._handleDocumentClick,!1),this.props.focusOnMount&&setTimeout(()=>{const e=a.findDOMNode(this.refs.input);e&&e.focus()}),"function"==typeof this.props.dataSource.registerForUpdates&&this.props.dataSource.registerForUpdates(this._dataUpdatedCallback),this.props.populatedTokenData&&this.props.populatedTokenData.length)return this._addTokens(this.props.populatedTokenData,!1,null)},componentWillUnmount(){return c.default(a.findDOMNode(this.refs.tokenizer_input)).off("keydown",this._proxyKeys),document.removeEventListener("click",this._handleDocumentClick,!1)},componentDidUpdate(e,t){const{populatedTokenData:s,resetTokenData:n}=this.props;return n&&!e.resetTokenData&&0!==this.tokenData.length&&this.removeTokens(this.tokenData),(null!=s?s.length:void 0)!==(null!=e.populatedTokenData?e.populatedTokenData.length:void 0)&&(s.length>e.populatedTokenData.length?this._addTokens(s,!1,null):s.length{if(e&&"function"==typeof e.getKey&&s.has(e.getKey())){const n=s.get(e.getKey()),i=this.tokenData.slice(0,t).concat([n]).concat(this.tokenData.slice(t+1));this.tokenData=i}}),this.setState({tokenData:this.tokenData}),"function"==typeof this.props.onContentsChange&&this.props.onContentsChange(this.tokenData,null===(t=a.findDOMNode(this.refs.input))||void 0===t?void 0:t.value)}},render(){const e={"react-tokenizer":!0};null!=this.props.customClass&&(e[this.props.customClass]=null!=this.props.customClass);const t={padding:this.props.tokenSpacing,paddingRight:0,maxHeight:this.props.tokenSpacing+3*(this.props.tokenSpacing+29)+14+2},s=n.default({"tokenizer-input":!0,"tokenizer-input-disabled":this.props.disabled,"tokenizer-input-additionalInputDisabled":this.props.disableAdditionalInput});return this.state.numLines>3&&(t.overflowY="auto",t.overflowX="visible"),r.default.createElement("div",{onClick:this._handleMyClick,className:n.default(e)},r.default.createElement("div",{className:s,ref:"tokenizer_input",style:t},r.default.createElement("div",{className:"token-container",style:{marginLeft:-this.props.tokenSpacing,marginBottom:-this.props.tokenSpacing}},this._renderTokens(),this._renderInput())),this._renderSelector())},getInputValue(){return a.findDOMNode(this.refs.input).value},serializeInputData(){return{tokens:this.tokenData,value:this.getInputValue()}},tokenizeAll(){const e=a.findDOMNode(this.refs.input),{tokens:t}=this.props.stringTokenizer(e.value,!0);return t.length>0&&this._addTokens(t,!1),e.value="",this.refs.selector.close()},addExternalTokens(e){this._addTokens(e,!1,null),this.refs.selector.close()},_getCurrentValue(){const e=a.findDOMNode(this.refs.input),{value:t}=this.props.stringTokenizer(e.value);return t},queryDataSource(e){const t=t=>{let s;e||(t=null);const n=e=>("function"==typeof e.getKey?e.getKey():void 0)||String(e),i=l.map(this.tokenData,n);return t=null!=t?t.filter(e=>(s=n(e),!Array.from(i).includes(s))):null};return this.props.dataSource.query(e,s=>(s=t(s),this.queryResults=s,this.setState({queryResults:this.queryResults}),"function"==typeof this.props.logSearchComplete?this.props.logSearchComplete(e,(null!=s?s.length:void 0)||0,!0):void 0),s=>(e===this._getCurrentValue()&&(s=t(s))&&s.length&&(this.queryResults=this.queryResults?this.queryResults.concat(s):s,this.setState({queryResults:this.queryResults})),"function"==typeof this.props.logSearchComplete?this.props.logSearchComplete(e,(null!=s?s.length:void 0)||0,!1):void 0))},_dataUpdatedCallback(){if(this.isMounted()){const n=Boolean(this.state.queryResults);return e=this.refs.selector,t="reset",s=e=>e.reset(),null!=e&&"function"==typeof e[t]&&s(e,t),n&&a.findDOMNode(this.refs.input).focus(),this.queryDataSource(this.getInputValue())}var e,t,s},_addTokens(e,t=!1,s=null){var n;const i=e=>("function"==typeof e.getKey?e.getKey():void 0)||String(e),r=l.map(this.tokenData,i),o=[];for(const t of Array.from(e)){const e=i(t);Array.from(r).includes(e)||(o.push(t),r.push(e))}this.tokenData=this.tokenData.concat(o),this.setState({tokenData:this.tokenData}),"function"==typeof this.props.onTokensAdd&&this.props.onTokensAdd(o,this),"function"==typeof this.props.onContentsChange&&this.props.onContentsChange(this.tokenData,null===(n=a.findDOMNode(this.refs.input))||void 0===n?void 0:n.value);const c=t?{search_expr:s,selected_pos:(null!=this.refs.selector?this.refs.selector.state.selectionIndex:void 0)||0,num_query_results:null!=this.state.queryResults?this.state.queryResults.length:void 0,did_select_suggestion:!0}:{did_select_suggestion:!1};return(()=>{const e=[];for(const t of Array.from(o))e.push("function"==typeof this.props.logTokenChangeEvent?this.props.logTokenChangeEvent(t,!1,c):void 0);return e})()},_addToken(e,t=!1,s=null){return this._addTokens([e],t,s)},removeTokens(e){let{selectedTokenIndex:t}=this.state;const s=[];for(const n of Array.from(e)){const e=this.tokenData.indexOf(n);-1!==e&&(t===e?t=null:t>e&&(t-=1),this.tokenData.splice(e,1),s.push(n))}const n=a.findDOMNode(this.refs.input);n.focus(),this._setSelectedToken(t),this.queryResults=null,this.setState({tokenData:this.tokenData,queryResults:this.queryResults});for(const e of Array.from(s))"function"==typeof this.props.onTokenRemove&&this.props.onTokenRemove(e);for(const e of Array.from(s))"function"==typeof this.props.logTokenChangeEvent&&this.props.logTokenChangeEvent(e,!0);return"function"==typeof this.props.onContentsChange?this.props.onContentsChange(this.tokenData,n.value):void 0},removeToken(e){return this.removeTokens([e])},replaceTokens(e){var t;const s=e=>("function"==typeof e.getKey?e.getKey():void 0)||String(e);if(e.length!==this.tokenData.length||!l.every(l.zip(this.tokenData,e),(function(...e){const[t,n]=Array.from(e[0]);return s(t)===s(n)})))return this.tokenData=e,this.setState({tokenData:e}),"function"==typeof this.props.onContentsChange?this.props.onContentsChange(this.tokenData,null===(t=a.findDOMNode(this.refs.input))||void 0===t?void 0:t.value):void 0},_renderTokens(){const e=[],t=e=>("function"==typeof e.getKey?e.getKey():void 0)||String(e);for(let s=0;sr;i?t++:t--)n.push(t);return n})(0,this.state.tokenData.length,!1).map(e=>this.refs[`token${e}`]).filter(e=>e)},_setSelectedToken(e){return null!=e?(a.findDOMNode(this.refs[`token${e}`]).focus(),this.refs.selector.close()):a.findDOMNode(this.refs.input).focus(),this.setState({selectedTokenIndex:e})},_resizeTokenizerInput(){const e=e=>{var t;return null===(t=a.findDOMNode(e))||void 0===t?void 0:t.clientWidth},t=e(this._getTokenizerInput());if(null==t)return;const s=this.props.tokenSpacing+2,n=this.props.tokenSpacing;let i=0;const r=this._getTokenComponents();let o=1;for(const a of Array.from(r)){const r=e(a)+s;i+r+n>t&&(o+=1,i=0),i+=r}let l=t-i-n-2;return l<80&&(o+=1,l=t-n),l!==this.state.inputWidth&&this.setState({inputWidth:l}),o!==this.state.numLines?this.setState({numLines:o}):void 0},_onSelect(e){const t=a.findDOMNode(this.refs.input);return t.focus(),this._addToken(e,!0,t.value),t.value="",this.queryResults=null,"function"==typeof this.props.postSelect&&this.props.postSelect(e),this.setState({queryResults:this.queryResults})},_handleMyClick:e=>"function"==typeof e.nativeEvent.stopImmediatePropagation?e.nativeEvent.stopImmediatePropagation():void 0,_handleDocumentClick(e){return this.refs.selector.close()},_proxyKeys(e){if(e.key===d.Key.Backspace&&""===this._getCurrentValue()&&e.preventDefault(),this._shouldListenForTokenNavigation()){const t=this.state.selectedTokenIndex;switch(e.key){case d.Key.Backspace:return void(null===t?(this._setSelectedToken(this.state.tokenData.length-1),a.findDOMNode(this.refs.input).focus()):this.removeToken(this.state.tokenData[t]));case d.Key.ArrowLeft:return void(null===t?this._setSelectedToken(this.state.tokenData.length-1):t>0&&this._setSelectedToken(t-1));case d.Key.ArrowRight:if(null!==t)return void(t>=this.state.tokenData.length-1?this._setSelectedToken(null):this._setSelectedToken(t+1));break;case d.Key.Delete:if(null!==t)return void this.removeToken(this.state.tokenData[t])}}this.refs.selector.onKeyDown(e),e.isDefaultPrevented()||e.key===d.Key.Tab&&""!==this.getInputValue()&&this.tokenizeAll()},_tokenizeIfHasInput(e){if(""!==this.getInputValue())return this.tokenizeAll(),e.preventDefault()},_shouldListenForTokenNavigation(){if(!this.state.tokenData.length)return!1;const e=a.findDOMNode(this.refs.input);return 0===e.selectionStart&&0===e.selectionEnd},_textUpdated(e){const t=a.findDOMNode(this.refs.input),s=e.target.value,{tokens:n,value:i}=this.props.stringTokenizer(s);return"function"==typeof this.props.logSearchBegin&&this.props.logSearchBegin(i),i!==s&&(t.value=i,i||this.refs.selector.close()),n.length>0?this._addTokens(n,!1):"function"==typeof this.props.onContentsChange&&this.props.onContentsChange(this.tokenData,i),this.queryDataSource(i)},_clearResults(){return this.queryResults=null,this.setState({queryResults:this.queryResults})}});t.Tokenizer=_})),define("metaserver/static/js/modules/clean/typeahead",["require","exports","tslib","classnames","create-react-class","react","react-dom","prop-types","lodash","metaserver/static/js/modules/clean/fuzzy","ts-key-enum"],(function(e,t,s,n,i,r,a,o,l,c,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeaheadSelectorMixin=t.TypeaheadSelector=t.DataSource=t.Autocomplete=void 0,n=s.__importDefault(n),i=s.__importDefault(i),r=s.__importDefault(r),a=s.__importStar(a),o=s.__importDefault(o),l=s.__importStar(l),c=s.__importDefault(c);t.DataSource=class{constructor({local:e}={}){this.local=e}filterAndSort(e){return c.default.filter(e,this.local)}query(e,t){return t(l.map(this.filterAndSort(e),e=>e.original))}};const u={getInitialState:()=>({selectionIndex:0}),getOptions(){if(!this.props.queryOptions)return[];const e=this.props.maxVisible||this.props.queryOptions.length;return this.props.queryOptions.slice(0,e)},renderOptions(){const e=[],t=this.getOptions(),s=e=>("function"==typeof e.getKey?e.getKey():void 0)||String(e);for(let i=0;i=t&&(s-=n),this._changeSelectionIndex(s)},_changeSelectionIndex(e){return e!==this.state.selectionIndex&&"function"==typeof this.onSelectionIndexChange&&this.onSelectionIndexChange(e),this.setState({selectionIndex:e})}};t.TypeaheadSelectorMixin=u;class h extends r.default.Component{constructor(){super(...arguments),this.state={queryResults:null,value:this.props.value,focus:!1},this._onMouseOver=()=>this.setState({focus:!0}),this._onMouseLeave=()=>this.setState({focus:!1}),this._onBlur=()=>{if(this.props.onBlur(),!this.state.focus)return this._clearResults()},this._onFocus=()=>(this._queryDataSource(this.state.value),this.refs.selector.reset()),this._renderInput=()=>{const e=this.props.renderInput();return r.default.cloneElement(e,{ref:"input",onChange:t=>(null!=e.props.onChange&&e.props.onChange(t),this._inputChanged(t)),onKeyDown:t=>(null!=e.props.onKeyDown&&e.props.onKeyDown(t),this._proxyKeys(t)),onBlur:t=>(null!=e.props.onBlur&&e.props.onBlur(t),this._onBlur(t)),onFocus:t=>(null!=e.props.onFocus&&e.props.onFocus(t),this._onFocus(t)),placeholder:this.props.placeholder,value:this.state.value,name:this.props.name,autoComplete:"off",disabled:this.props.disabled})},this._renderSelector=()=>r.default.cloneElement(this.props.renderSelector(),{ref:"selector",queryOptions:this.state.queryResults,onSelect:this._autocomplete,onClose:this._clearResults,maxVisible:this.props.maxVisible}),this._inputChanged=e=>{const{value:t}=e.target;return this.setState({value:e.target.value}),this.props.onChange(t),this._queryDataSource(t),this.refs.selector.reset()},this._getCurrentValue=()=>a.findDOMNode(this.refs.input).value,this._queryDataSource=e=>{const t=e=>(this.queryResults=e,this.setState({queryResults:this.queryResults}));return this.props.dataSource.query(e,t,s=>{if(e===this._getCurrentValue()&&s&&s.length){const e=this.queryResults?this.queryResults.concat(s):s;return t(e)}})},this._proxyKeys=e=>this.refs.selector.onKeyDown(e),this._autocomplete=e=>(a.findDOMNode(this.refs.input).focus(),e=this.props.renderCompletionText(e),this.setState({value:e}),this.props.onSelect(e),this._clearResults()),this._clearResults=()=>(this.queryResults=null,this.setState({queryResults:this.queryResults}))}render(){const e={};return e[this.props.customClass]=null!=this.props.customClass,r.default.createElement("div",{className:n.default(e),onMouseOver:this._onMouseOver,onMouseLeave:this._onMouseLeave},this._renderInput(),this._renderSelector())}componentWillReceiveProps(e){return this.setState({value:e.value})}}t.Autocomplete=h,h.displayName="Autocomplete",h.propTypes={customClass:o.default.string,maxVisible:o.default.number,dataSource:o.default.object.isRequired,onBlur:o.default.func,onSelect:o.default.func,onChange:o.default.func,placeholder:o.default.string,renderCompletionText:o.default.func.isRequired,renderInput:o.default.func.isRequired,renderSelector:o.default.func.isRequired,value:o.default.string,name:o.default.string,disabled:o.default.bool},h.defaultProps={value:"",maxVisible:7,onBlur(){},onSelect(e){},onChange(e){},renderCompletionText:e=>String(e),renderInput:()=>r.default.createElement("input",null),renderSelector:()=>r.default.createElement(_,null),disabled:!1};const _=i.default({displayName:"TypeaheadSelector",mixins:[u],propTypes:{customClass:o.default.string,maxVisible:o.default.number,onClose:o.default.func.isRequired,onSelect:o.default.func.isRequired,queryOptions:o.default.array,renderQueryOption:o.default.func.isRequired},getDefaultProps:()=>({maxVisible:7,onClose(){},onSelect(e){},renderQueryOption:e=>r.default.createElement("li",null,String(e))}),render(){if(!this.getOptions().length)return r.default.createElement("div",null);const e={"typeahead-selector":!0};return e[this.props.customClass]=null!=this.props.customClass,r.default.createElement("ul",{className:n.default(e)},this.renderOptions())}});t.TypeaheadSelector=_})); //# sourceMappingURL=pkg-sharing-core.min.js-vfl4xmhKV.map