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AC,+CAA+C,CAAC,CAAC;AAC/D,CAAC","file":"authConfig.js","sourcesContent":["// Configuration\nconst CLIENT_ID = '1009679725257-27sld91p8vu05ep5hupdgs8l1u2d6835.apps.googleusercontent.com';\nconst SCOPES = 'https://www.googleapis.com/auth/calendar.readonly \\\n https://www.googleapis.com/auth/drive.file';\n// Add here the endpoints for Google API services you would like to use.\nconst DISCOVERY_DOC = ['https://www.googleapis.com/discovery/v1/apis/drive/v3/rest', 'https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest'];\n\nlet tokenClient;\nlet gisInited = false;\n\n/**\n * Callback after Google Identity Services are loaded.\n */\nfunction gisLoaded() {\n tokenClient = google.accounts.oauth2.initTokenClient({\n client_id: CLIENT_ID,\n scope: SCOPES,\n callback: '', // defined later\n });\n gisInited = true;\n}\n\nlet gapiInited = false;\n\n/**\n * Callback after api.js is loaded.\n */\nfunction gapiLoaded() {\n gapi.load('client', initializeGapiClient);\n}\n\n/**\n * Callback after the API client is loaded. Loads the\n * discovery doc to initialize the API.\n */\nasync function initializeGapiClient() {\n await gapi.client.init({\n discoveryDocs: DISCOVERY_DOC,\n });\n gapiInited = true;\n\n initGoogleCalendar();\n}\n\n// Function to handle the initialization for Google Calendar API\nasync function initGoogleCalendar() {\n if (!gisInited || !gapiInited) {\n console.error('Google Identity Services or GAPI not initialized.');\n return;\n }\n\n // Ensure Calendar API is loaded\n if (!gapi.client.calendar) {\n console.error('Calendar API not available.');\n return;\n }\n\n // Additional initialization for Calendar API if needed\n\n console.log('Google Calendar API initialized successfully.');\n}"]}