function q(e){throw e}define("metaserver/static/js/modules/clean/deprecated_ajax/ajax",["require","exports","tslib","@dropbox-performance/ttvc","metaserver/static/js/modules/clean/devtools/panels/performance/perf_hub_action_types","metaserver/static/js/modules/clean/deprecated_ajax/job_progress","metaserver/static/js/modules/clean/deprecated_ajax/util","metaserver/static/js/modules/core/persistence/storage","metaserver/static/js/modules/constants/ajax_strings","metaserver/static/js/modules/constants/page_load","metaserver/static/js/modules/constants/request","metaserver/static/js/modules/core/browser","metaserver/static/js/modules/core/assert","metaserver/static/js/modules/core/transport/fetch_utils","metaserver/static/js/modules/core/html","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/core/uri","metaserver/static/js/modules/clean/csrf","metaserver/static/js/modules/clean/viewer"],(function(e,t,r,s,n,o,i,a,c,l,u,h,d,p,f,m,_,g,b){"use strict";function y(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),t.SilentBackgroundBeaconRequest=t.SilentBackgroundRequest=t.BackgroundRequest=t.WebProgressRequest=t.FormWebRequest=t.WebRequestOref=t.WebRequest=t.Request=void 0,o=r.__importStar(o),a=r.__importStar(a),c=r.__importStar(c),l=r.__importStar(l),u=r.__importStar(u),h=r.__importStar(h);function v(e,t){null==e&&(e={}),null==t&&(t=[]);const r=new A(e),n=w(r,t),o=n.options().type||"POST",a=n.data(),c=n.dataType(),l=n.headers();let u=String(n.url());const h={method:o,mode:"cors",credentials:"same-origin",headers:l,signal:e.signal};"POST"===o.toUpperCase()?h.body=i.jqParam(a,!0):u=i.mergeQueryParams(u,a),l.append("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),s.incrementAjaxCount();const d=fetch(u,h);return new Promise((function(e,t){d.then(e=>e.text().then(t=>({response:e,responseText:t}))).then(({response:t,responseText:r})=>{if(!t.ok)throw new p.FetchResponseError(t,r);if("abort"===t.statusText)throw new p.FetchAbortError(t,t.statusText);if("failed"===t.statusText)throw new p.FetchFailError(t,t.statusText);e({response:t,responseText:r})}).catch(e=>t(e))})).then(({response:e,responseText:t})=>{if("json"===c)try{const r=JSON.parse(t);n.success(r,t,"success",e),n.complete(e,"success",t)}catch(t){n.error(e,"parsererror",t),n.complete(e,"parsererror")}else n.success(void 0,t,"success",e),n.complete(e,"success",t)}).catch(e=>{const t=new Response;p.errorIsFetchFailError(e)?(n.error(e.response,"failed",e),n.complete(e.response,"failed")):p.errorIsFetchResponseError(e)?(n.error(e.response,"error",e),n.complete(e.response,"error")):p.errorIsFetchAbortError(e)?(n.error(e.response,"aborted",e),n.complete(e.response,"aborted")):"AbortError"===e.name?(n.error(t,"aborted",e),n.complete(t,"aborted")):(n.error(t,"error",e),n.complete(t,"error"))}).finally(s.decrementAjaxCount),n.request(d),d}function j(e){return e.type===x.CHAINED}t.Request=v;const w=function(e,t){const r=[e];for(const e of Array.from(t.slice(0).reverse()))r.push(new e);let s=e;for(const e of r)s&&j(e)&&(e.next=s),s=e;return s};var x;(function(e){e.BASE="base",e.CHAINED="chained"})(x||(x={}));class A{constructor(e){this.type=x.BASE;const t=e||{};this.options=()=>t,this.url=()=>String(t.url||""),this.data=()=>t.data||{},this.dataType=()=>t.dataType||"text",this.headers=()=>t.headers||new Headers,this.success=t.success||y,this.error=t.error||y,this.complete=t.complete||y,this.request=y}}class E{constructor(){this.type=x.CHAINED}options(){return this.next.options()}url(){return this.next.url()}contentType(){return this.next.contentType()}data(){return this.next.data()}dataType(){return this.next.dataType()}headers(){return this.next.headers()}success(e,t,r,s){this.next.success(e,t,r,s)}error(e,t,r){this.next.error(e,t,r)}complete(e,t,r){this.next.complete(e,t,r)}request(e){this.next.request(e)}}class R extends E{constructor(){super(...arguments),this.SUPPORTED_TLDS=["dropbox.com"]}static initClass(){}data(){if(this.options().skipInjectCsrf)return this.next.data();d.assert(this._is_db_domain(),"injecting CSRF token into request to non-dropbox domain");const e={is_xhr:!0};return"GET"!==(this.options().type||"POST").toUpperCase()&&(e.t=g.readCsrfToken()),Object.assign(Object.assign({},e),this.next.data())}_is_db_domain(){const e=_.URI.parse(String(this.url())).getAuthority();if(!e)return!0;const t=e.split(".");return this.SUPPORTED_TLDS.reduce((function(e,r){const s=r.split("."),n=t.slice(-1*s.length).join(".");return e||r===n}),!1)}}R.initClass();class S extends E{data(){const e=this.next.data(),t=this.options();return t.subject_user&&!e._subject_uid&&(e._subject_uid=String(t.subject_user)),e}headers(){const e=this.next.headers(),t=this.options();return t.subject_user&&e.set("X-DROPBOX-UID",String(t.subject_user)),e}}class T extends E{headers(){var e;const t=this.next.headers(),r=this.options().teamAuthParams||{},s=r.team_id||b.Viewer.get_viewer().team_id;if(s){const{subject_user:r}=this.options(),n=this.next.data()._subject_uid,o=("number"==typeof r?r:null==r?void 0:r.id)||("string"==typeof n?parseInt(n,10):n);o&&o===(null===(e=b.Viewer.get_viewer().work_user)||void 0===e?void 0:e.id)&&t.set("X-Dropbox-Teamid",String(s))}const n=r.auth_role||b.Viewer.get_viewer().auth_role,o=r.auth_action_type||b.Viewer.get_viewer().auth_action_type;return(n||o)&&t.set("X-Dropbox-Team-Authorization",JSON.stringify({auth_role:String(n),auth_action_type:String(o)})),t}}class k extends E{data(){const e=this.next.data();return u.REQUEST_TRACING_ENABLED?Object.assign({parent_request_id:u.REQUEST_ID},e):e}headers(){const e=this.next.headers(),t=this.options().type||"POST";return u.REQUEST_TRACING_ENABLED&&"POST"===t.toUpperCase()&&e.append(n.PerfHubHeaderNames.FORCE_REQUEST_TRACING_HEADER,"ON"),e}}class O extends E{success(e,t,r,s){let n;if(!t.length)return this.next.error(s,r,new Error("AJAX Response was empty."));const o=this.options();let i=!0,a=!1;if(0===t.indexOf("err:"))n=t.substr("err:".length),["{","["].includes(n[0])&&(i=!1);else{if(0!==t.indexOf("htmlerr:"))return this.next.success(e,t,r,s);n=t.substr("htmlerr:".length),a=!0}const c=this.next.error(s,r,new Error(n));if(i&&!o.skipNotifyError){let e=n;a&&(e=new f.HTML(n)),m.Notify.error(e)}return c}error(e,t,r){return"aborted"!==t&&m.Notify.error(c.PROBLEM_COMPLETING_REQUEST),this.next.error(e,t,r)}}class C extends E{constructor(){super(),this._watch=this._watch.bind(this)}data(){this.job_id=C.generate_job_id();const e=this.next.data(),t=e._subject_uid,r=this.options(),{subject_user:s}=r;return t&&"string"==typeof t?this.uid=t:s&&(this.uid=String(s)),Object.assign({job_id:this.job_id},e)}request(e){return this._interval=1e3,this._failures=0,this._watch_count=0,this._watch_id=setInterval(this._watch,this._interval),this.next.request(e)}success(e,t,r,s){return this.next.success(e,t,r,s)}error(e,t,r){return this.next.error(e,t,r)}complete(e,t,r){return this._stop(),o.Job.handled(this.job_id),this.next.complete(e,t,r)}_watch(){return o.Job.peek(this.job_id)?this._stop():(this._watch_count++,this._watch_count%10==0&&(clearInterval(this._watch_id),this._interval=Math.min(Math.floor(1.5*this._interval),3e4),this._watch_id=setInterval(this._watch,this._interval)),this._show_progress_modal(),this._fetch_progress())}_stop(){clearInterval(this._watch_id),o.ModalProgress.hide()}_show_progress_modal(){if(this._modal_shown)return;this._modal_shown=!0;const e=this.options();e.progress_text&&o.ModalProgress.show(e.progress_text)}_fetch_progress(){const e={};return this.uid&&(e._subject_uid=this.uid),H({url:`/job_status/${this.job_id}`,data:e,dataType:"text",success(e,t,r,s){let n;n=0===t.indexOf("done")?"1/1":t,o.ModalProgress.update(n)},error:(e,t,r)=>{if(this._failures++,!(this._failures<3))return this._stop(),this.next.error(e,t,r)}})}static generate_job_id(){const e=(new Date).getTime().toString();let t=Math.floor(1e6*Math.random()).toString();return t=`000000${t}`.substring(t.length),e+t}}class q extends E{data(){var e;const t=h.get_uri().getQuery().oref;return!(null===(e=this.next.data())||void 0===e?void 0:e.oref)&&t?Object.assign({oref:t},this.next.data()):this.next.data()}}const I=[class extends E{constructor(){super(),this.browser_unload_handler=this.browser_unload_handler.bind(this),this.is_browser_unloading=!1}browser_unload_handler(){this.is_browser_unloading=!0}request(e){return window.addEventListener("beforeunload",this.browser_unload_handler),this.next.request(e)}error(e,t,r){return"error"===t&&this.is_browser_unloading?this.next.error(e,"aborted",new Error("unload")):this.next.error(e,t,r)}complete(e,t,r){return window.removeEventListener("beforeunload",this.browser_unload_handler),this.next.complete(e,t,r)}}],B=[S,T,R,class extends E{error(e,t,r){if(p.errorIsFetchFailError(r)||p.errorIsFetchResponseError(r)&&403===r.response.status){const e=a.SessionStorage.get("reload-timestamp"),t=(new Date).getTime();(!e||t-e>3e4)&&(a.SessionStorage.set("reload-timestamp",t),window.location.reload())}return this.next.error(e,t,r)}}],D=[class extends E{constructor(){super(),this._clear_working_msg=this._clear_working_msg.bind(this)}request(e){let t=!1;return e.catch(()=>{}).then(()=>{t=!0}),setTimeout(()=>{t||this._should_show_working_msg()&&(this._show_working_msg(),e.catch(()=>{}).then(()=>{this._clear_working_msg()}))},4e3),this.next.request(e)}_should_show_working_msg(){return m.Notify.isShown()}_show_working_msg(){return this.notification=m.Notify.success(c.STILL_WORKING),this.notification}_clear_working_msg(){if(m.Notify.isShown()&&this.notification===m.Notify.current())return m.Notify.clear()}}],F=[class extends E{error(e,t,r){return this._notify_dev(t,r),this.next.error(e,t,r)}_notify_dev(e,t){if(p.errorIsFetchFailError(t)||p.errorIsFetchResponseError(t)){const e=t.response;e.headers.get("X-Debug-Url");0}}},k,class extends E{data(){const e=this.next.data(),t={};return l.PUBLIC_MODE_OVERRIDE&&(t.public_mode_override="1"),l.COUNTRY_OVERRIDE&&(t.country_override=l.COUNTRY_OVERRIDE),Object.assign(Object.assign({},t),e)}}],P=[class extends E{constructor(){super(),this._watch=this._watch.bind(this)}data(){const e=this.next.data();this.uid=e._subject_uid?String(e._subject_uid):"";const{subject_user:t}=this.options();return!this.uid&&t&&(this.uid=String(t)),e}success(e,t,r,s){return this._is_async_job_response(t)?(this.job_id=t.split(":")[1],this._interval=1e3,this._failures=0,this._watch_count=0,this._watch_id=setInterval(this._watch,this._interval)):this.next.success(e,t,r,s)}complete(e,t,r){if(!this._is_async_job_response(r))return this.next.complete(e,t,r)}_is_async_job_response(e){if(!e||0!==e.indexOf("async_task_started:"))return!1;return e.split(":")[1].match(/^[A-Za-z0-9_\-=]*$/)}_watch(){return o.Job.peek(this.job_id)?this._stop():(this._watch_count++,this._watch_count%10==0&&(clearInterval(this._watch_id),this._interval=Math.min(Math.floor(1.5*this._interval),3e4),this._watch_id=setInterval(this._watch,this._interval)),this._show_progress_modal(),this._fetch_progress())}_stop(){clearInterval(this._watch_id),o.ModalProgress.hide()}_show_progress_modal(){if(this._modal_shown)return;this._modal_shown=!0;const{progress_text:e}=this.options();e&&o.ModalProgress.show(e)}_fetch_progress(){const e={};return this.uid&&(e._subject_uid=this.uid),G({url:`/async_task_status/${this.job_id}`,data:e,dataType:"text",success:(e,t,r,s)=>{let n=t;if(0===n.indexOf("done:"))return o.Job.handled(this.job_id),this._stop(),n=n.substr("done:".length),t=n,this.next.success(e,t,r,s),this.next.complete(s,r,t);if(0===n.indexOf("err:")){o.Job.handled(this.job_id),this._stop();const e=n.substr("err:".length);return m.Notify.error(e),this.next.error(s,r,new Error(e)),this.next.complete(s,r,t)}if(0===n.indexOf("async_task_err:")){o.Job.handled(this.job_id),this._stop();const e=n.substr("async_task_err:".length);return m.Notify.error(new f.HTML(e)),this.next.complete(s,r,t)}o.ModalProgress.update(n)},error:(e,t,r)=>{if(this._failures++,!(this._failures<3))return this._stop(),this.next.error(e,t,r),this.next.complete(e,t,"")}})}}],U=[].concat(I,D,O,F,B,P);t.WebRequest=function(e){return null==e&&(e={}),v(e,U)},t.WebRequestOref=function(e){return null==e&&(e={}),v(e,[].concat(q,U))};const N=[].concat(I,D,class extends E{success(e,t,r,s){if(!this.options().skipErrorHandling){if(!t.length)return this.next.error(s,r,new Error("AJAX Form response was empty."));if(0===t.indexOf("err:")){const e=t.substr("err:".length);return this.next.error(s,r,new Error(e))}}return this.next.success(e,t,r,s)}},F,B,P);t.FormWebRequest=function(e){return null==e&&(e={}),v(e,N)};const L=[].concat(I,D,O,F,B,C,P);function H(e){return null==e&&(e={}),v(e,[].concat(I,F,B))}t.WebProgressRequest=function(e){return null==e&&(e={}),v(e,L)},t.BackgroundRequest=H;const M=[S,T,R],V=[].concat(I,F,M);function G(e){return null==e&&(e={}),v(e,V)}t.SilentBackgroundRequest=G,t.SilentBackgroundBeaconRequest=function(e){var t;null==e&&(e={});const r=null===(t=navigator.sendBeacon)||void 0===t?void 0:t.bind(navigator);if(!r)return G(e);const s=new A(e),n=w(s,[].concat(M,k)),o=n.url(),i=(e=>{const t=new FormData;for(const r of Object.keys(e)){const s=e[r];(null===s?[]:Array.isArray(s)?s:[s]).forEach(e=>{let s;void 0!==e&&(s=!0===e?"true":!1===e?"false":"number"==typeof e?String(e):"object"==typeof e?e.toString():e,t.append(r,s))})}return t})(n.data());r(String(o),i)||console.warn(`Beacon request failed: ${o}`)}})),define("metaserver/static/js/api_v2/client_base",["require","exports","tslib","metaserver/static/js/api_v2/types","metaserver/static/js/api_v2/transport/fetch","metaserver/static/js/modules/clean/devtools/panels/performance/perf_hub_action_types","metaserver/static/js/modules/constants/request","metaserver/static/js/modules/constants/request","metaserver/static/js/modules/core/browser","metaserver/static/js/modules/core/cookies","metaserver/static/js/modules/core/uri"],(function(e,t,r,s,n,o,i,a,c,l,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiV2ClientBase=t.DefaultApiV2Transport=void 0,i=r.__importStar(i),c=r.__importStar(c);class h extends n.FetchAsyncTransport{}t.DefaultApiV2Transport=h;class d{constructor(e){this.uploadEndpoints=new Set(["files/alpha/upload","files/paper/create","files/paper/update","files/upload","files/upload_session/append_v2","files/upload_session/finish","files/upload_session/start","paper/cloud_docs/update","paper/desktop/spaces/upload_log","paper/desktop/upload_log","paper/docs/create","paper/docs/update"]),this.downloadEndpoints=new Set(["files/download","files/download_zip","files/export","files/get_preview","files/get_thumbnail_v2","paper/docs/download","sharing/get_shared_link_file","sharing/export_shared_link"]),this.supportedUploadEndpoints=new Set(["files/paper/create","files/paper/update","files/upload","files/upload_session/append_v2","files/upload_session/finish","files/upload_session/start","paper/cloud_docs/update","paper/desktop/spaces/upload_log","paper/desktop/upload_log","paper/docs/create","paper/docs/update"]),this.supportedDownloadEndpoints=new Set(["files/download","sharing/get_shared_link_file","sharing/export_shared_link"]),this.transport=e||new h}_upload(e,t,r,s){return this._uploadWithResponseHeaders(e,t,r,s).then(e=>e.result)}_uploadWithResponseHeaders(e,t,r,n){if(!this.uploadEndpoints.has(e))throw new Error(e+" does not use the content-upload endpoint format");if(!this.supportedUploadEndpoints.has(e))throw new Error(e+" is not in the supported list of content-upload endpoints");const o=Object.assign({[s.ApiV2HeaderNames.CsrfToken]:this.csrfToken(),[s.ApiV2HeaderNames.DropboxApiArg]:this.http_header_safe_json(t)},this._headers(n));if("string"==typeof r||void 0===r)return this.executeRpc(e,o,r,"application/octet-stream",n.signal);{const t=new Blob([r],{type:"application/octet-stream"});return this.executeRpc(e,o,t,"application/octet-stream",n.signal)}}_download(e,t,r,s){return this._downloadWithResponseHeaders(e,t,r,s).then(e=>e.result)}_downloadWithResponseHeaders(e,t,r,n){if(void 0===n||!n.hasOwnProperty("dangerouslyFetchUserContent")||!n.dangerouslyFetchUserContent)throw new Error("download requires explicit acknowledgement of the risk");if(!this.downloadEndpoints.has(e))throw new Error(e+" does not use the content-download endpoint format");if(!this.supportedDownloadEndpoints.has(e))throw new Error(e+" is not in the supported list of content-download endpoints");const o=Object.assign({[s.ApiV2HeaderNames.CsrfToken]:this.csrfToken(),[s.ApiV2HeaderNames.DropboxApiArg]:this.http_header_safe_json(t)},this._headers(r));return this.executeBinaryRpc(e,o,"","application/octet-stream",r.signal)}_rpc(e,t,r){return this._rpcWithResponseHeaders(e,t,r).then(e=>e.result)}_rpcWithResponseHeaders(e,t,r){const n=Object.assign({[s.ApiV2HeaderNames.CsrfToken]:this.csrfToken()},this._headers(r));if(this.downloadEndpoints.has(e))throw new Error(e+' does not use the rpc endpoint format. Use "download" instead');if(this.uploadEndpoints.has(e))throw new Error(e+' does not use the rpc endpoint format. Use "upload" instead');const o=JSON.stringify(t||null);return this.executeRpc(e,n,o,"application/json",r.signal)}csrfToken(){return l.Cookies.read("__Host-js_csrf")||""}executeRpc(e,t,s,n,l){return r.__awaiter(this,void 0,void 0,(function*(){const r="client-web.dropbox.com"===c.get_hostname()?"client-web.dropbox.com":"www.dropbox.com";let h;i.REQUEST_TRACING_ENABLED&&(h={parent_request_id:a.REQUEST_ID},t[o.PerfHubHeaderNames.FORCE_REQUEST_TRACING_HEADER]="ON");const d=new u.URI({scheme:"https",authority:r,path:"/2/"+e,query:h});return yield this.transport.executeRpc(d,t,s,n,l)}))}executeBinaryRpc(e,t,s,n,l){return r.__awaiter(this,void 0,void 0,(function*(){const r="client-web.dropbox.com"===c.get_hostname()?"client-web.dropbox.com":"www.dropbox.com";let h;i.REQUEST_TRACING_ENABLED&&(h={parent_request_id:a.REQUEST_ID},t[o.PerfHubHeaderNames.FORCE_REQUEST_TRACING_HEADER]="ON");const d=new u.URI({scheme:"https",authority:r,path:"/2/"+e,query:h});return yield this.transport.executeBinaryRpc(d,t,s,n,l)}))}http_header_safe_json(e){return JSON.stringify(e).replace(/[\u007f-\uffff]/g,(function(e){return"\\u"+("000"+e.charCodeAt(0).toString(16)).slice(-4)}))}}t.ApiV2ClientBase=d,d.prototype.ns=function(e){const t=this;return{rpc:function(r,s,n){return t._rpc(e+"/"+r,s,n)},rpcWithResponseHeaders:function(r,s,n){return t._rpcWithResponseHeaders(e+"/"+r,s,n)},upload:function(r,s,n,o){return t._upload(e+"/"+r,s,n,o)},uploadWithResponseHeaders:function(r,s,n,o){return t._uploadWithResponseHeaders(e+"/"+r,s,n,o)},download:function(r,s,n,o){return t._download(e+"/"+r,s,n,o)},downloadWithResponseHeaders:function(r,s,n,o){return t._downloadWithResponseHeaders(e+"/"+r,s,n,o)}}}})),define("metaserver/static/js/api_v2/error",["require","exports","metaserver/static/js/modules/core/i18n"],(function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catchApiError=t.isRateLimitError=t.isServerError=t.isAppError=t.isAuthError=t.isBadRequestError=t.isApiError=t.RateLimitError=t.ServerError=t.AppError=t.AuthError=t.BadRequestError=t.ApiError=void 0;class s{constructor(e){this.message=e}toString(){return void 0===this.message?"ApiError":this.message}static parseResponse(e,t,n,o=null){let i="";null==o&&(o=e in u?u[e]:e>=500?a:s);const c={raw:{status:e,responseBody:n},summary:null,error:{},headers:t};try{const e=JSON.parse(n)||{};c.error=e.error,c.summary=e.error_summary,i=null!=e.user_message?e.user_message.text:""}catch(e){}return 429!==e||i||(i=r.intl.formatMessage({id:"vp2a4r",defaultMessage:"Folder updates in progress — please try again later."})),Object.assign(new o(i||void 0),c)}}t.ApiError=s;class n extends s{}t.BadRequestError=n;class o extends s{}t.AuthError=o;class i extends s{}t.AppError=i;class a extends s{}t.ServerError=a;class c extends s{}function l(e){return e instanceof s}t.RateLimitError=c,t.isApiError=l,t.isBadRequestError=function(e){return e instanceof n},t.isAuthError=function(e){return e instanceof o},t.isAppError=function(e){return e instanceof i},t.isServerError=function(e){return e instanceof a},t.isRateLimitError=function(e){return e instanceof c},t.catchApiError=function(e){return function(t){if(l(t))return e(t);throw t}};const u={400:n,401:o,409:i,429:c}})),define("metaserver/static/js/api_v2/transport/fetch",["require","exports","metaserver/static/js/api_v2/error","metaserver/static/js/modules/core/transport/fetch_utils","@dropbox-performance/ttvc"],(function(e,t,r,s,n){"use strict";function o(e){const t={};return e.forEach((e,r)=>{t[r]=e}),t}Object.defineProperty(t,"__esModule",{value:!0}),t.FetchSyncTransport=t.FetchAsyncTransport=void 0;t.FetchAsyncTransport=class{executeRpc(e,t,i,a,c){return new Promise((function(l,u){return n.incrementAjaxCount(),fetch(e.toString(),{method:"POST",mode:"same-origin",credentials:"same-origin",headers:Object.assign(Object.assign({},t),{"Content-Type":a}),body:i,signal:c}).then(e=>e.text().then(t=>({response:e,responseText:t}))).then(({response:e,responseText:t})=>{if(e.ok)return{response:e,responseText:t};throw new s.FetchResponseError(e,t)}).then(({response:e,responseText:t})=>l({headers:o(e.headers),result:JSON.parse(t)})).catch(e=>s.errorIsFetchResponseError(e)?u(r.ApiError.parseResponse(e.response.status,o(e.response.headers),e.message)):u(r.ApiError.parseResponse(0,{},""))).finally(n.decrementAjaxCount)}))}executeBinaryRpc(e,t,i,a,c){return new Promise((function(l,u){return n.incrementAjaxCount(),fetch(e.toString(),{method:"POST",mode:"same-origin",credentials:"same-origin",headers:Object.assign(Object.assign({},t),{"Content-Type":a}),body:i,signal:c}).then(e=>e.ok?e.arrayBuffer().then(t=>({response:e,responseData:t})):e.text().then(t=>{throw new s.FetchResponseError(e,t)})).then(({response:e,responseData:t})=>l({headers:o(e.headers),result:t})).catch(e=>s.errorIsFetchResponseError(e)?u(r.ApiError.parseResponse(e.response.status,o(e.response.headers),e.message)):u(r.ApiError.parseResponse(0,{},""))).finally(n.decrementAjaxCount)}))}};t.FetchSyncTransport=class{executeRpc(e,t,r,s,o){return n.incrementAjaxCount(),fetch(e.toString(),{method:"POST",mode:"same-origin",credentials:"same-origin",headers:Object.assign(Object.assign({},t),{"Content-Type":s}),keepalive:!0,body:r,signal:o}).finally(n.decrementAjaxCount),Promise.resolve({headers:{},result:{}})}executeBinaryRpc(e,t,r,s,o){return n.incrementAjaxCount(),fetch(e.toString(),{method:"POST",mode:"same-origin",credentials:"same-origin",headers:Object.assign(Object.assign({},t),{"Content-Type":s}),keepalive:!0,body:r,signal:o}).finally(n.decrementAjaxCount),Promise.resolve({headers:{},result:new ArrayBuffer(0)})}}})),define("metaserver/static/js/api_v2/types",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnionStruct=t.UnionScalar=t.Union=t.TeamAuthRequestActionType=t.TeamAuthRequestRole=t.ApiV2HeaderNames=void 0,(function(e){e.DropboxApiArg="Dropbox-API-Arg",e.DropboxApiSelectAdmin="Dropbox-API-Select-Admin",e.DropboxPathRoot="X-Dropbox-Path-Root",e.DropboxUid="X-Dropbox-Uid",e.DropboxTeamId="X-Dropbox-Teamid",e.DropboxTeamAuthorization="X-Dropbox-Team-Authorization",e.CsrfToken="X-CSRF-Token"})(t.ApiV2HeaderNames||(t.ApiV2HeaderNames={})),(function(e){e[e.TeamAdminRole=0]="TeamAdminRole",e[e.MTARole=1]="MTARole",e[e.FederationAdminRole=2]="FederationAdminRole"})(t.TeamAuthRequestRole||(t.TeamAuthRequestRole={})),(function(e){e[e.AdminAction=0]="AdminAction",e[e.AssumeAction=1]="AssumeAction",e[e.OnBehalfOfAction=2]="OnBehalfOfAction"})(t.TeamAuthRequestActionType||(t.TeamAuthRequestActionType={}));class r{constructor(e,t,r){this.type=e,this.value=t,this.isScalar=r}static parse(e){const t=e[".tag"];return 2===Object.keys(e).length&&null!=e[t]?new s(t,e[t]):new n(t,e)}}t.Union=r;class s extends r{constructor(e,t=null){super(e,t,!0)}toJSON(){const e={".tag":this.type};return null!=this.value&&(e[this.type]=this.value),e}}t.UnionScalar=s;class n extends r{constructor(e,t={}){super(e,t,!1)}toJSON(){return Object.assign({".tag":this.type},this.value)}}t.UnionStruct=n})),define("metaserver/static/js/api_v2/noauth_client",["require","exports","metaserver/static/js/api_v2/types","metaserver/static/js/api_v2/client_base","metaserver/static/js/modules/constants/request"],(function(e,t,r,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoAuthApiV2Client=void 0;class o extends s.ApiV2ClientBase{constructor(e){super(e)}_headers(e){return Object.assign({[r.ApiV2HeaderNames.DropboxUid]:String(n.LOGGED_OUT_X_DROPBOX_UID)},e.headers)}}t.NoAuthApiV2Client=o})),define("metaserver/static/js/api_v2/user_client",["require","exports","metaserver/static/js/api_v2/types","metaserver/static/js/api_v2/client_base","metaserver/static/js/modules/clean/viewer"],(function(e,t,r,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserApiV2Client=void 0;class o extends s.ApiV2ClientBase{constructor(e){super(e)}_headers(e){const t=n.Viewer.get_viewer().get_user_by_id(e.subjectUserId);return Object.assign({[r.ApiV2HeaderNames.DropboxUid]:String(t.id),[r.ApiV2HeaderNames.DropboxPathRoot]:String(t.root_ns_id)},e.headers)}}t.UserApiV2Client=o})),define("metaserver/static/js/modules/clean/active_user",["require","exports","metaserver/static/js/modules/clean/viewer"],(function(e,t,r){"use strict";function s(){if(window.RUNNING_IN_EDISON)return window.EDISON_ACTIVE_USER_ID;if(window.ensemble&&window.ensemble.viewer){const e=window.ensemble.viewer.getActiveUser();if(e)return e.userId}}function n(){const e=s();if("number"!=typeof e)throw new Error("could not get active user id");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.mustGetActiveUser=t.getActiveUser=t.mustGetActiveUserId=t.getActiveUserId=void 0,t.getActiveUserId=s,t.mustGetActiveUserId=n,t.getActiveUser=function(){const e=s();return e?r.Viewer.get_viewer().get_user_by_id(e):void 0},t.mustGetActiveUser=function(){const e=n();return r.Viewer.get_viewer().get_user_by_id(e)}})),define("metaserver/static/js/modules/core/transport/fetch_utils",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorIsFetchResponseError=t.errorIsFetchFailError=t.errorIsFetchAbortError=t.FetchResponseError=t.FetchFailError=t.FetchAbortError=void 0;class r extends Error{constructor(e,t){super(t),this.name="FetchAbortError",this.response=e}}t.FetchAbortError=r;class s extends Error{constructor(e,t){super(t),this.name="FetchFailError",this.response=e}}t.FetchFailError=s;class n extends Error{constructor(e,t){super(t),this.name="FetchResponseError",this.response=e}}t.FetchResponseError=n,t.errorIsFetchAbortError=function(e){return"FetchAbortError"===e.name},t.errorIsFetchFailError=function(e){return"FetchFailError"===e.name},t.errorIsFetchResponseError=function(e){return"FetchResponseError"===e.name}})),define("metaserver/static/js/prod_assets_web_modules/reselect",["exports"],(function(e){"use strict";function t(e,t){return e===t}function r(e,t,r){if(null===t||null===r||t.length!==r.length)return!1;for(var s=t.length,n=0;n1&&void 0!==arguments[1]?arguments[1]:t,n=null,o=null;return function(){return r(s,n,arguments)||(o=e.apply(null,arguments)),n=arguments,o}}function n(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var r=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return t}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:i;if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var r=Object.keys(e);return t(r.map((function(t){return e[t]})),(function(){for(var e=arguments.length,t=Array(e),s=0;s>>24]^f[o>>16&255]^m[i>>8&255]^_[255&t]^s[d],c=e[o>>>24]^f[i>>16&255]^m[t>>8&255]^_[255&n]^s[d+1],l=e[i>>>24]^f[t>>16&255]^m[n>>8&255]^_[255&o]^s[d+2],t=e[t>>>24]^f[n>>16&255]^m[o>>8&255]^_[255&i]^s[d+3],d+=4,n=a,o=c,i=l;for(u=0;4>u;u++)p[r?3&-u:u]=g[n>>>24]<<24^g[o>>16&255]<<16^g[i>>8&255]<<8^g[255&t]^s[d++],a=n,n=o,o=i,i=t,t=a;return p}function x(e,t){var r,s,n,o=t.slice(0),i=e.r,a=e.b,c=i[0],l=i[1],u=i[2],h=i[3],d=i[4],p=i[5],f=i[6],m=i[7];for(r=0;64>r;r++)16>r?s=o[r]:(s=o[r+1&15],n=o[r+14&15],s=o[15&r]=(s>>>7^s>>>18^s>>>3^s<<25^s<<14)+(n>>>17^n>>>19^n>>>10^n<<15^n<<13)+o[15&r]+o[r+9&15]|0),s=s+m+(d>>>6^d>>>11^d>>>25^d<<26^d<<21^d<<7)+(f^d&(p^f))+a[r],m=f,f=p,p=d,d=h+s|0,h=u,u=l,c=s+((l=c)&u^h&(l^u))+(l>>>2^l>>>13^l>>>22^l<<30^l<<19^l<<10)|0;i[0]=i[0]+c|0,i[1]=i[1]+l|0,i[2]=i[2]+u|0,i[3]=i[3]+h|0,i[4]=i[4]+d|0,i[5]=i[5]+p|0,i[6]=i[6]+f|0,i[7]=i[7]+m|0}function C(e,t){var r,s=sjcl.random.w[e],n=[];for(r in s)s.hasOwnProperty(r)&&n.push(s[r]);for(r=0;rt&&(e.f[t]=e.f[t]+1|0,!e.f[t]);t++);return e.A.encrypt(e.f)}function D(e,t){return function(){t.apply(e,arguments)}}"undefined"!=typeof module&&module.exports&&(module.exports=sjcl),"function"==typeof define&&define("metaserver/static/js/prod_assets_web_modules/sjcl",[],(function(){return sjcl})),sjcl.cipher.aes=function(e){this.k[0][0][0]||this.D();var t,r,s,n,o=this.k[0][4],i=this.k[1],a=1;for(4!==(t=e.length)&&6!==t&&8!==t&&q(new sjcl.exception.invalid("invalid aes key size")),this.b=[s=e.slice(0),n=[]],e=t;e<4*t+28;e++)r=s[e-1],(0==e%t||8===t&&4==e%t)&&(r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[255&r],0==e%t&&(r=r<<8^r>>>24^a<<24,a=a<<1^283*(a>>7))),s[e]=s[e-t]^r;for(t=0;e;t++,e--)r=s[3&t?e:e-4],n[t]=4>=e||4>t?r:i[0][o[r>>>24]]^i[1][o[r>>16&255]]^i[2][o[r>>8&255]]^i[3][o[255&r]]},sjcl.cipher.aes.prototype={encrypt:function(e){return w(this,e,0)},decrypt:function(e){return w(this,e,1)},k:[[[],[],[],[],[]],[[],[],[],[],[]]],D:function(){var e,t,r,s,n,o,i,a=this.k[0],c=this.k[1],l=a[4],u=c[4],h=[],d=[];for(e=0;256>e;e++)d[(h[e]=e<<1^283*(e>>7))^e]=e;for(t=r=0;!l[t];t^=s||1,r=d[r]||1)for(o=(o=r^r<<1^r<<2^r<<3^r<<4)>>8^255&o^99,l[t]=o,u[o]=t,i=16843009*(n=h[e=h[s=h[t]]])^65537*e^257*s^16843008*t,n=257*h[o]^16843008*o,e=0;4>e;e++)a[e][t]=n=n<<24^n>>>8,c[e][o]=i=i<<24^i>>>8;for(e=0;5>e;e++)a[e]=a[e].slice(0),c[e]=c[e].slice(0)}},sjcl.bitArray={bitSlice:function(e,t,r){return e=sjcl.bitArray.P(e.slice(t/32),32-(31&t)).slice(1),r===s?e:sjcl.bitArray.clamp(e,r-t)},extract:function(e,t,r){var s=Math.floor(-t-r&31);return(-32&(t+r-1^t)?e[t/32|0]<<32-s^e[t/32+1|0]>>>s:e[t/32|0]>>>s)&(1<>t-1,1)),e},partial:function(e,t,r){return 32===e?t:(r?0|t:t<<32-e)+1099511627776*e},getPartial:function(e){return Math.round(e/1099511627776)||32},equal:function(e,t){if(sjcl.bitArray.bitLength(e)!==sjcl.bitArray.bitLength(t))return u;var r,s=0;for(r=0;r>>t),r=e[o]<<32-t;return o=e.length?e[e.length-1]:0,e=sjcl.bitArray.getPartial(o),n.push(sjcl.bitArray.partial(t+e&31,32>>24|r>>>8&65280|(65280&r)<<8|r<<24;return e}},sjcl.codec.utf8String={fromBits:function(e){var t,r,s="",n=sjcl.bitArray.bitLength(e);for(t=0;t>>24),r<<=8;return decodeURIComponent(escape(s))},toBits:function(e){e=unescape(encodeURIComponent(e));var t,r=[],s=0;for(t=0;t>>n)>>>26),6>n?(i=e[r]<<6-n,n+=26,r++):(i<<=6,n-=6);for(;3&s.length&&!t;)s+="=";return s},toBits:function(e,t){e=e.replace(/\s|=/g,"");var r,s,n=[],o=0,i=sjcl.codec.base64.J,a=0;for(t&&(i=i.substr(0,62)+"-_"),r=0;r(s=i.indexOf(e.charAt(r)))&&q(new sjcl.exception.invalid("this isn't base64!")),26>>o),a=s<<32-o):a^=s<<32-(o+=6);return 56&o&&n.push(sjcl.bitArray.partial(56&o,a,1)),n}},sjcl.codec.base64url={fromBits:function(e){return sjcl.codec.base64.fromBits(e,1,1)},toBits:function(e){return sjcl.codec.base64.toBits(e,1)}},sjcl.hash.sha256=function(e){this.b[0]||this.D(),e?(this.r=e.r.slice(0),this.o=e.o.slice(0),this.h=e.h):this.reset()},sjcl.hash.sha256.hash=function(e){return(new sjcl.hash.sha256).update(e).finalize()},sjcl.hash.sha256.prototype={blockSize:512,reset:function(){return this.r=this.N.slice(0),this.o=[],this.h=0,this},update:function(e){"string"==typeof e&&(e=sjcl.codec.utf8String.toBits(e));var t,r=this.o=sjcl.bitArray.concat(this.o,e);for(t=this.h,e=this.h=t+sjcl.bitArray.bitLength(e),t=512+t&-512;t<=e;t+=512)x(this,r.splice(0,16));return this},finalize:function(){var e,t=this.o,r=this.r;for(e=(t=sjcl.bitArray.concat(t,[sjcl.bitArray.partial(1,1)])).length+2;15&e;e++)t.push(0);for(t.push(Math.floor(this.h/4294967296)),t.push(0|this.h);t.length;)x(this,t.splice(0,16));return this.reset(),r},N:[],b:[],D:function(){function e(e){return 4294967296*(e-Math.floor(e))|0}var t,r=0,s=2;e:for(;64>r;s++){for(t=2;t*t<=s;t++)if(0==s%t)continue e;8>r&&(this.N[r]=e(Math.pow(s,.5))),this.b[r]=e(Math.pow(s,1/3)),r++}}},sjcl.mode.ccm={name:"ccm",encrypt:function(e,t,r,s,n){var o,i=t.slice(0),a=sjcl.bitArray,c=a.bitLength(r)/8,l=a.bitLength(i)/8;for(n=n||64,s=s||[],7>c&&q(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")),o=2;4>o&&l>>>8*o;o++);return o<15-c&&(o=15-c),r=a.clamp(r,8*(15-o)),t=sjcl.mode.ccm.L(e,t,r,s,n,o),i=sjcl.mode.ccm.p(e,i,r,t,n,o),a.concat(i.data,i.tag)},decrypt:function(e,t,r,s,n){n=n||64,s=s||[];var o=sjcl.bitArray,i=o.bitLength(r)/8,a=o.bitLength(t),c=o.clamp(t,a-n),l=o.bitSlice(t,a-n);a=(a-n)/8;for(7>i&&q(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")),t=2;4>t&&a>>>8*t;t++);return t<15-i&&(t=15-i),r=o.clamp(r,8*(15-t)),c=sjcl.mode.ccm.p(e,c,r,l,n,t),e=sjcl.mode.ccm.L(e,c.data,r,s,n,t),o.equal(c.tag,e)||q(new sjcl.exception.corrupt("ccm: tag doesn't match")),c.data},L:function(e,t,r,s,n,o){var i=[],a=sjcl.bitArray,c=a.l;if(((n/=8)%2||4>n||16=(r=a.bitLength(s)/8)?i=[a.partial(16,r)]:4294967295>=r&&(i=a.concat([a.partial(16,65534)],[r])),i=a.concat(i,s),s=0;sn.bitLength(r)&&(a=o(a,s(a)),r=n.concat(r,[-2147483648,0,0,0])),i=o(i,r),e.encrypt(o(s(o(a,s(a))),i))},H:function(e){return[e[0]<<1^e[1]>>>31,e[1]<<1^e[2]>>>31,e[2]<<1^e[3]>>>31,e[3]<<1^135*(e[0]>>>31)]}},sjcl.mode.gcm={name:"gcm",encrypt:function(e,t,r,s,n){var o=t.slice(0);return t=sjcl.bitArray,s=s||[],e=sjcl.mode.gcm.p(!0,e,o,s,r,n||128),t.concat(e.data,e.tag)},decrypt:function(e,t,r,s,n){var o=t.slice(0),i=sjcl.bitArray,a=i.bitLength(o);return s=s||[],(n=n||128)<=a?(t=i.bitSlice(o,a-n),o=i.bitSlice(o,0,a-n)):(t=o,o=[]),e=sjcl.mode.gcm.p(u,e,o,s,r,n),i.equal(e.tag,t)||q(new sjcl.exception.corrupt("gcm: tag doesn't match")),e.data},Z:function(e,t){var r,s,n,o,i,a=sjcl.bitArray.l;for(n=[0,0,0,0],o=t.slice(0),r=0;128>r;r++){for((s=0!=(e[Math.floor(r/32)]&1<<31-r%32))&&(n=a(n,o)),i=0!=(1&o[3]),s=3;0>>1|(1&o[s-1])<<31;o[0]>>>=1,i&&(o[0]^=-520093696)}return n},g:function(e,t,r){var s,n=r.length;for(t=t.slice(0),s=0;sn&&(e=t.hash(e)),r=0;rs||0>r)&&q(sjcl.exception.invalid("invalid params to pbkdf2")),"string"==typeof e&&(e=sjcl.codec.utf8String.toBits(e)),"string"==typeof t&&(t=sjcl.codec.utf8String.toBits(t)),e=new(n=n||sjcl.misc.hmac)(e);var o,i,a,c,l=[],u=sjcl.bitArray;for(c=1;32*l.length<(s||1);c++){for(n=o=e.encrypt(u.concat(t,[c])),i=1;io;o++)s.push(4294967296*Math.random()|0);for(o=0;o=1<this.j&&(this.j=i),this.F++,this.b=sjcl.hash.sha256.hash(this.b.concat(s)),this.A=new sjcl.cipher.aes(this.b),r=0;4>r&&(this.f[r]=this.f[r]+1|0,!this.f[r]);r++);}for(r=0;r>>=1;this.c[a].update([n,this.C++,2,t,i,e.length].concat(e))}break;case"string":t===s&&(t=e.length),this.c[a].update([n,this.C++,3,t,i,e.length]),this.c[a].update(e);break;default:l=1}l&&q(new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string")),this.i[a]+=t,this.d+=t,c===this.m&&(this.isReady()!==this.m&&C("seeded",Math.max(this.j,this.d)),C("progress",this.getProgress()))},isReady:function(e){return e=this.I[e!==s?e:this.B],this.j&&this.j>=e?this.i[0]>this.R&&(new Date).valueOf()>this.O?this.u|this.t:this.t:this.d>=e?this.u|this.m:this.m},getProgress:function(e){return e=this.I[e||this.B],this.j>=e?1:this.d>e?1:this.d/e},startCollectors:function(){this.q||(this.a={loadTimeCollector:D(this,this.aa),mouseCollector:D(this,this.ba),keyboardCollector:D(this,this.$),accelerometerCollector:D(this,this.U),touchCollector:D(this,this.da)},window.addEventListener?(window.addEventListener("load",this.a.loadTimeCollector,u),window.addEventListener("mousemove",this.a.mouseCollector,u),window.addEventListener("keypress",this.a.keyboardCollector,u),window.addEventListener("devicemotion",this.a.accelerometerCollector,u),window.addEventListener("touchmove",this.a.touchCollector,u)):document.attachEvent?(document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)):q(new sjcl.exception.bug("can't attach event")),this.q=!0)},stopCollectors:function(){this.q&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,u),window.removeEventListener("mousemove",this.a.mouseCollector,u),window.removeEventListener("keypress",this.a.keyboardCollector,u),window.removeEventListener("devicemotion",this.a.accelerometerCollector,u),window.removeEventListener("touchmove",this.a.touchCollector,u)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.q=u)},addEventListener:function(e,t){this.w[e][this.V++]=t},removeEventListener:function(e,t){var r,s,n=this.w[e],o=[];for(s in n)n.hasOwnProperty(s)&&n[s]===t&&o.push(s);for(r=0;r=i.iter||64!==i.ts&&96!==i.ts&&128!==i.ts||128!==i.ks&&192!==i.ks&&256!==i.ks||2>i.iv.length||4=t.iter||64!==t.ts&&96!==t.ts&&128!==t.ts||128!==t.ks&&192!==t.ks&&256!==t.ks||!t.iv||2>t.iv.length||4