1(self.webpackChunk_ember_auto_import_=self.webpackChunk_ember_auto_import_||[]).push([[302],{83302:function(e,t,i){(function(){try{(typeof window<"u"?window:typeof i.g<"u"?i.g:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{}).SENTRY_RELEASE={id:"9c7171a7b40d41c09c0e7ee98b8ae8093caf31fc"}}catch{}})(),(()=>{async function e(e){return new Promise((t,i)=>{let r=document.createElement("script");r.src=e,r.onload=()=>t(),r.onerror=e=>i(e);let s=document.querySelector(`script[src="${e}"]`);s&&(console.log(`drive-picker: appending a copy of an existing script ${e}`),Array.from(s.attributes).forEach(e=>{["id","src","onload","onerror"].includes(e.name)||r.setAttribute(e.name,e.value)}),s.nonce&&(r.nonce=s.nonce)),document.head.appendChild(r)})}function t(e,t){let i=e.getAttribute(t);return i?Number(i):null}var i,r=((i=r||{})[i.FALSE=0]="FALSE",i[i.TRUE=1]="TRUE",i[i.DEFAULT=2]="DEFAULT",i);function s(e,t){return e.hasAttribute(t)}function n(e,t,i,s){let n=function(e,t){let i=e.getAttribute(t)?.toUpperCase();if(!i)return 2;let s=r[i];if(void 0!==s)return s;throw Error(`Invalid value, "${i}", for attribute ${t}. Must be one of ${Object.keys(r).filter(Number.isNaN).join(", ")}`)}(t,e);return 2===n?s:i.call(s,1===n)}var o=class extends HTMLElement{static get observedAttributes(){return["enable-drives","file-ids","include-folders","mime-types","mode","owned-by-me","parent","query","select-folder-enabled","starred","view-id"]}get view(){let e=new window.google.picker.DocsView(this.viewId);n("enable-drives",this,e.setEnableDrives,e),n("include-folders",this,e.setIncludeFolders,e),n("owned-by-me",this,e.setOwnedByMe,e),n("select-folder-enabled",this,e.setSelectFolderEnabled,e),n("starred",this,e.setStarred,e);let t=this.getAttribute("mime-types");null!==t&&e.setMimeTypes(t);let i=this.getAttribute("file-ids");null!==i&&e.setFileIds(i);let r=this.getAttribute("mode");r&&e.setMode(google.picker.DocsViewMode[r]);let s=this.getAttribute("parent");null!==s&&e.setParent(s);let o=this.getAttribute("query");return null!==o&&e.setQuery(o),e}get viewId(){let e=this.getAttribute("view-id");return e?window.google.picker.ViewId[e]:void 0}},l=class extends HTMLElement{static get observedAttributes(){return["app-id","client-id","debounce-delay","developer-key","hide-title-bar","locale","max-items","mine-only","multiselect","nav-hidden","oauth-token","origin","relay-url","scope","title"]}picker;observer;google;loading;debounceTimer;get visible(){return!!this.picker?.isVisible()}set visible(e){this.picker?.setVisible(e)}get tokenClientConfig(){let e=this.getAttribute("client-id"),t=this.getAttribute("scope")??"https://www.googleapis.com/auth/drive.file";if(!e||!t)throw Error("client-id and scope are required attributes");return{client_id:e,hd:this.getAttribute("hd")??void 0,include_granted_scopes:!!this.getAttribute("include-granted-scope"),login_hint:this.getAttribute("login-hint")??void 0,prompt:this.getAttribute("prompt")??"",scope:t}}attributeChangedCallback(){this.isConnected&&this.scheduleBuild()}scheduleBuild(){clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.build()},t(this,"debounce-delay")??0)}async build(){if(this.picker?.dispose(),await this.loading,!this.google)return;let e=(new this.google.picker.PickerBuilder).setCallback(e=>{this.callbackToDispatchEvent(e)}),i=this.getAttribute("app-id");i?e=e.setAppId(i):console.warn("drive-picker: app-id attribute is missing. This may cause issues with backend API integration.");let r=this.getAttribute("developer-key");null!==r&&(e=e.setDeveloperKey(r));let o=this.getAttribute("locale");null!==o&&(e=e.setLocale(o));let l=t(this,"max-items");null!==l&&(e=e.setMaxItems(l));let c=this.getAttribute("origin");null!==c&&(e=e.setOrigin(c));let a=this.getAttribute("relay-url");null!==a&&(e=e.setRelayUrl(a));let u=this.getAttribute("title");null!==u&&(e=e.setTitle(u)),n("hide-title-bar",this,e.hideTitleBar,e);let d=this.getAttribute("oauth-token")??await this.requestAccessToken();if(d){e=e.setOAuthToken(d),s(this,"multiselect")&&(e=e.enableFeature(this.google.picker.Feature.MULTISELECT_ENABLED)),s(this,"mine-only")&&(e=e.enableFeature
1(this.google.picker.Feature.MINE_ONLY)),s(this,"nav-hidden")&&(e=e.enableFeature(this.google.picker.Feature.NAV_HIDDEN));for(let t of this.views)e=e.addView(t);this.picker=e.build(),this.picker.setVisible(!0)}}get views(){let e=function(e,t="*"){return function(e){return e.filter(e=>function(e){return"view"in e&&e.view instanceof window.google.picker.View}(e)).map(e=>e.view)}(Array.from(e.querySelectorAll(t)))}(this);return e.length?e:["all"]}async connectedCallback(){this.loading=async function(t="client:picker"){return window.gapi||await e("https://apis.google.com/js/api.js"),await new Promise(e=>{window.gapi.load(t,e)}),window.google}().then(e=>{this.google=e}),this.observer=new MutationObserver(e=>{e.filter(e=>"childList"===e.type||"attributes"===e.type&&e.target!==this).length&&this.scheduleBuild()}),this.observer?.observe(this,{childList:!0,subtree:!0,attributes:!0}),this.scheduleBuild()}callbackToDispatchEvent(e){let t;switch(e.action){case google.picker.Action.CANCEL:t=["picker:canceled","picker-canceled"];break;case google.picker.Action.PICKED:t=["picker:picked","picker-picked"];break;case google.picker.Action.ERROR:t=["picker:error","picker-error"];break;default:return}for(let i of t)this.dispatchEvent(new CustomEvent(i,{detail:e}))}async requestAccessToken(){return async function(t){return window.google?.accounts?.oauth2||await e("https://accounts.google.com/gsi/client"),new Promise((e,i)=>{window.google.accounts.oauth2.initTokenClient({...t,callback:e,error_callback:i}).requestAccessToken()})}(this.tokenClientConfig).then(e=>{let{access_token:t}=e;return t?(this.dispatchEvent(new CustomEvent("picker:authenticated",{detail:{token:t}})),this.dispatchEvent(new CustomEvent("picker-oauth-response",{detail:e})),this.dispatchEvent(new CustomEvent("picker:oauth:response",{detail:e})),this.dispatchEvent(new CustomEvent("picker-oauth-response",{detail:e})),t):(this.dispatchEvent(new CustomEvent("picker:oauth:error",{detail:e})),void this.dispatchEvent(new CustomEvent("picker-oauth-error",{detail:e})))}).catch(e=>{this.dispatchEvent(new CustomEvent("picker:oauth:error",{detail:e})),this.dispatchEvent(new CustomEvent("picker-oauth-error",{detail:e}))})}disconnectedCallback(){this.picker?.dispose()}};customElements.define("drive-picker",l),customElements.define("drive-picker-docs-view",o)})()}}]); 2//# sourceMappingURL=chunk.302.88dafc48ccce37d61b84.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.