PMFlow/frontend/.playwright-profiles/chrome-clone-probe-17753718.../Default/Extensions/bbbeceopkfgmdjieggoonbdafen.../1.2.2_0/background.js

2 lines
11 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var background=(function(){"use strict";function p(e){return e==null||typeof e=="function"?{main:e}:e}const i=globalThis.browser?.runtime?.id?globalThis.browser:globalThis.chrome,r="https://app.prompt-architects.com",m=async(e,t)=>{const n=`${r}/api/auth/refresh`;try{const a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({refresh_token:t})});return a.ok?await a.json():null}catch{return null}},g=async()=>{try{const e=await fetch(`${r}/api/anon-user`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error("Failed to set up anonymous user");const t=await e.json();if(!t?.success)return console.error("Failed to set up anonymous user:",t?.message),null;const n=t.data;return await i.storage.local.set({anon_user:n}),n}catch{return null}},v=[{id:"1",input_query:"#prompt-textarea",pinned_container_query:'form[class*="group/composer"], #main > div > section > div.bg-token-bg-primary.sticky.bottom-0.z-20 > div > div:nth-child(1) > div',url:"https://chatgpt.com",name:"chatgpt",description:"Advanced general-purpose AI assistant for writing, coding, debugging, research, business strategy, marketing copy, brainstorming, structured prompt engineering, data analysis, and multimodal workflows including image understanding. Strong at reasoning, step-by-step logic, structured outputs, and production-ready content.",is_active:!0},{id:"2",input_query:"div .ql-editor",pinned_container_query:"#app-root main div.content-wrapper chat-window input-container input-area-v2",url:"https://gemini.google.com",name:"gemini",description:"Google’s multimodal AI assistant optimized for long-context reasoning, document understanding, research synthesis, and integration with Google Workspace tools. Strong at analyzing large files, summarizing research, and combining text, images, and web knowledge into structured answers.",is_active:!0},{id:"3",input_query:"div .ProseMirror",pinned_container_query:'body > div.root > div > div.w-full.relative.min-w-0 > main > div.top-5.z-10.mx-auto.w-full.max-w-2xl > div.mx-auto > div > div:nth-child(2) > fieldset, body > div.root > div > div.w-full.relative.min-w-0 > div > div.h-full.flex.flex-col.overflow-hidden > div > div > div > div.sticky.bottom-0.mx-auto.w-full.pt-6.relative > div > div:nth-child(2) > fieldset, [data-testid="chat-input-grid-area"]',url:"https://claude.ai",name:"claude",description:"AI assistant specialized in deep reasoning, long-form writing, nuanced analysis, and large document processing. Particularly strong for legal text review, academic-style writing, policy analysis, complex summaries, and thoughtful structured responses with high contextual awareness.",is_active:!0},{id:"4",input_query:".ps-11 .tiptap.ProseMirror",pinned_container_query:".query-bar",url:"https://grok.com",name:"grok",description:"Conversational AI focused on real-time awareness and internet-driven context. Designed for trending topics, current events, social media discussions, and up-to-date commentary. Blends conversational responses with live data awareness.",is_active:!0},{id:"5",input_query:"#chatinput div[contenteditable='true']",pinned_container_query:"#chat-input",url:"https://lovable.dev",name:"lovable",description:"AI-powered product builder that generates full-stack applications from natural language prompts. Produces frontend UI, backend logic, database structure, authentication flows, and deployable code. Ideal for rapid MVP creation, SaaS prototypes, and startup product scaffolding.",is_active:!0},{id:"6",input_query:"#ask-input",pinned_container_query:"div.relative.rounded-2xl:has(#ask-input)",url:"https://www.perplexity.ai",name:"perplexity",description:"AI-powered search engine focused on factual accuracy, citations, and real-time web-backed answers. Best suited for research tasks, market analysis, technical lookups, academic referencing, and verifying up-to-date information with linked sources.",is_active:!0},{id:"7",input_query:"#chat-container .layout-content-main .chat-editor .chat-input .chat-input-editor-container .chat-input-editor",pinned_container_query:"#chat-container .layout-content-main div.chat-editor",url:"https://www.kimi.com",name:"kimi",description:"Long-context AI assistant designed for processing extremely large documents, research papers, books, and datasets. Strong in multilingual comprehension, structured summarization, comparison tasks, and detailed analytical workflows.",is_active:!0},{id:"8",input_query:"#mat-input-0",pinned_container_query:"source-discovery-query-box > div",url:"https://notebooklm.google.com",name:"notebooklm",description:"Source-grounded research assistant that answers questions strictly based on uploaded documents. Ideal for study workflows, knowledge management, research synthesis, internal documentation analysis, and citation-backed summaries from trusted materials.",is_active:!0},{id:"9",input_query:"",pinned_container_query:"",url:"https://midjourney.com",name:"midjourney",description:"High-end AI image generation platform focused on artistic visuals, concept art, branding imagery, character design, cinematic scenes, and stylized creative outputs. Known for strong aesthetic coherence and visually striking compositions.",is_active:!1},{id:"10",input_query:"div.Base__Box-hQrlpv.dfNzId > div.container-l7PIkl > div > div > div.chatInputContainer-u16drH > div.inputs-viu5gD.chatInput-hARPYh > div.textAreaContainer-C6H3y3 > div > div.textbox-GOMuUw",pinned_container_query:"div.Base__Box-hQrlpv.dfNzId > div.container-l7PIkl > div > div > div.chatInputContainer-u16drH > div.inputs-viu5gD.chatInput-hARPYh",url:"https://app.runwayml.com",name:"runway",description:"Generative AI creative suite for video production, text-to-video generation, background removal, motion tracking, AI editing, and cinematic content creation. Designed for filmmakers, content creators, and media production teams.",is_active:!1},{id:"11",input_query:"#_r_1_ > main > div > div.hv2udw.BMOCzQ._8CKO_A.EC2pjw._6Mu4Ow.uN3EIA.bu_JgA.LuBWVA > div.LrjIYA.BMOCzQ.EC2pjw.LuBWVA > div > div > form > div > div > div.Be452g.BMOCzQ.LuBWVA > div.BMOCzQ.LuBWVA > div > div.BMOCzQ.EC2pjw.LuBWVA > div._kI3Pw > div > div > div > div > div:nth-child(1) > div > div > div > div > textarea:nth-child(1)",pinned_container_query:"#_r_1_ > main > div > div.hv2udw.BMOCzQ._8CKO_A.EC2pjw._6Mu4Ow.uN3EIA.bu_JgA.LuBWVA > div.LrjIYA.BMOCzQ.EC2pjw.LuBWVA > div > div > form > div",url:"https://www.canva.com/ai",name:"canva",description:"AI-assisted visual design platform for social media graphics, presentations, marketing materials, thumbnails, ads, and brand kits. Combines drag-and-drop design tools with AI-powered text, image, and layout generation.",is_active:!1},{id:"12",input_query:"#root .z-prompt div.relative.shadow-xs>div>div.select-none>textarea",pinned_container_query:"#root .z-prompt:has(div.relative.shadow-xs>div>div.select-none>textarea)",url:"https://bolt.new",name:"bolt",description:"Browser-based AI development environment that generates, edits, runs, and deploys full-stack web applications instantly. Enables rapid prototyping with live preview, backend integration, and iterative AI-assisted coding workflows.",is_active:!0},{id:"13",input_query:"#prompt-textarea-_new-chat_, #prompt-form > div > form > div.editor-module__C9SGTG__editor.text-label-14.h-full.w-full.overflow-y-auto.pb-2 > div",pinned_container_query:"#prompt-form > div > form",url:"https://v0.app",name:"v0.dev",description:"AI-powered UI generation tool focused on producing modern React and Tailwind components from natural language descriptions. Ideal for frontend scaffolding, design system prototyping, landing pages, dashboards, and production-ready UI blocks.",is_active:!0},{id:"14",input_query:".wixui-hero-textbox .wixui-text-box__input",pinned_container_query:".wixui-hero-textbox",url:"https://base44.com",name:"base44",description:"AI-assisted website builder that generates fully responsive, SEO-optimized websites from simple text prompts. Combines AI content generation with customizable design templates for rapid web development.",is_active:!0},{id:"15",input_query:"#chat-input-container > div.relative > textarea, div.relative > textarea",pinned_container_query:"#chat-input-container, div:has( > div.relative > textarea)",url:"https://app.base44.com",name:"base44_app",description:"AI-assisted website builder that generates fully responsive, SEO-optimized websites from simple text prompts. Combines AI content generation with customizable design templates for rapid web development.",is_active:!0}],h=e=>new Intl.DateTimeFormat("en-BD",{timeZone:"Asia/Dhaka",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e)),s="checkUserSession",w=300,f=async()=>{const e=await i.storage.local.get("supabase_session");e.supabase_session&&d(e.supabase_session.expires_at)},d=e=>{i.alarms.clear(s);const t=Date.now()/1e3,n=e-t,a=Math.max(0,n-w),u=Date.now()+a*1e3;i.alarms.create(s,{when:u}),console.log(`Scheduled alarm to fire in ${a} seconds (${h(u)} BD time)`)},_=async()=>{const e=await i.storage.local.get("supabase_session");if(!e.supabase_session){i.alarms.clear(s),console.log("No session found, waiting for user to visit website");return}const t=await m(e.supabase_session.access_token,e.supabase_session.refresh_token);t?(await i.storage.local.set({supabase_session:t}),i.runtime.sendMessage({type:"SIGN_IN",session:t}),console.log("Session refreshed, scheduling next check",t),d(t.expires_at),console.log("Session refreshed successfully")):(console.log("Session refresh failed, clearing session"),await i.storage.local.remove("supabase_session"),i.alarms.clear(s),i.runtime.sendMessage({type:"SIGN_OUT",session:null}))},l=async e=>{if(e)try{const t=await i.tabs.sendMessage(e,{type:"GET_SUPABASE_SESSION"});if(t?.session){const n=JSON.parse(t.session);await i.storage.local.set({supabase_session:n}),i.runtime.sendMessage({type:"SIGN_IN",session:n}),d(n.expires_at),console.log("User logged in, scheduled refresh alarm")}}catch(t){console.log("Could not get session from tab:",t)}},y=async()=>{const t=(await i.storage.local.get("default_view")).default_view==="popup"?"popup":"sidebar";await i.sidePanel.setPanelBehavior({openPanelOnActionClick:t==="sidebar"})},b=p(()=>{y(),f(),i.runtime.onInstalled.addListener(e=>{e.reason==="install"&&g()}),i.alarms.onAlarm.addListener(async e=>{e.name===s&&await _()}),i.runtime.onMessage.addListener(async(e,t)=>{if(e.type==="CONTENT_SCRIPT_LOADED"&&e.source==="prompt-architects"&&await l(t.tab?.id),e.type==="POLL_FOR_SESSION"){const n=await i.tabs.query({url:`${r}/*`});n&&n.length>0&&await l(n[0].id)}}),i.tabs.onUpdated.addListener(async(e,t,n)=>{t.status==="complete"&&v.forEach(a=>{n.url&&n.url.includes(a.url)&&i.tabs.sendMessage(e,{type:"LOAD_SITE_CONTENT",site:a})})})});function A(){}function o(e,...t){}const k={debug:(...e)=>o(console.debug,...e),log:(...e)=>o(console.log,...e),warn:(...e)=>o(console.warn,...e),error:(...e)=>o(console.error,...e)};let c;try{c=b.main(),c instanceof Promise&&console.warn("The background's main() function return a promise, but it must be synchronous")}catch(e){throw k.error("The background crashed on startup!"),e}return c})();