@i.un/libs 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- const e=Symbol("undefined");function t(e){return"function"==typeof(null==e?void 0:e.clone)}function n(e){const t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||"undefined"===t}function o(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this}function i(e){return n(e)?String(e):JSON.stringify(e,function(e,t){return"object"!=typeof t||null===t||Array.isArray(t)?t:Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{})})}function r(e){if(null===e||"object"!=typeof e)return e;if(t(e))return e.clone();if(Array.isArray(e))return e.map(e=>r(e));const n={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=r(e[t]));return n}function s(e,t){let n=null;return function(...o){const i=this;null!==n&&clearTimeout(n),n=setTimeout(()=>{e.apply(i,o),n=null},t)}}function a(e,t=0,...n){return new Promise(o=>{0===t?o(e(...n)):setTimeout(()=>{o(e(...n))},t)})}function l(e){return new Proxy({},{get:(t,n)=>t.hasOwnProperty(n)?t[n]:e})}function c(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const i of n)if(!o.includes(i)||!c(e[i],t[i]))return!1;return!0}const u=l(e),d=l(!1);function h(e){return u[e]}function m(t){return u[t]!==e}const p={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function g(e,t=p){const n=function(...n){const o=i(n)+e.name+(t.identifier||"");if(m(o))return Promise.resolve(r(h(o)));if(d[o]){const e=Object.assign({},p,t);return new Promise(t=>{const n=Date.now(),i=setInterval(()=>{m(o)?(clearInterval(i),t(r(h(o)))):Date.now()-n>e.timeout&&(d[o]=!1,clearInterval(i),t(r(e.timeoutResult)))},100)})}return d[o]=!0,e.apply(this,n).then(e=>(u[o]=e,r(u[o]))).catch(e=>{throw e}).finally(()=>{d[o]=!1})};return Object.defineProperty(n,"name",{value:`cacheWrapper_${e.name}`,configurable:!0}),n}function f(t,n=0){const o=function o(...i){if(o.isExecuting)return Promise.resolve(e);o.isExecuting=!0;const r=performance.now(),s=t.apply(this,i);return s.finally(()=>{const e=performance.now()-r;n&&n>e?setTimeout(()=>{o.isExecuting=!1},n-e):o.isExecuting=!1}),s};return o.isExecuting=!1,o}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},y.apply(null,arguments)}class v{constructor(e){this.storageKey=void 0,this.data={},this.listeners=[],this.storageKey=e}static getInstanceKey(e){return`memory:${e}`}static getInstance(e){const t=this.getInstanceKey(e);return this.instances.has(t)||this.instances.set(t,new v(e)),this.instances.get(t)}static create(e){return this.getInstance(e)}static clearInstance(e){const t=this.getInstanceKey(e),n=this.instances.get(t);n&&n.clearChangeCallbacks(),this.instances.delete(t)}static clearAllInstances(){this.instances.forEach(e=>{e.clearChangeCallbacks()}),this.instances.clear()}set(e,t){try{const n=y({},this.data);this.data=y({},this.data,{[e]:t}),this.triggerChange(n,this.data)}catch(e){throw console.error("MemoryStore.set 失败:",e),e}}get(e){try{return this.data[e]}catch(e){throw console.error("MemoryStore.get 失败:",e),e}}getAll(){return y({},this.data)}remove(e){try{if(e in this.data){const t=y({},this.data),n=y({},this.data);delete n[e],this.data=n,this.triggerChange(t,this.data)}}catch(e){throw console.error("MemoryStore.remove 失败:",e),e}}clear(){try{const e=y({},this.data);this.data={},this.triggerChange(e,this.data)}catch(e){throw console.error("MemoryStore.clear 失败:",e),e}}setMultiple(e){try{const t=y({},this.data);this.data=y({},this.data,e),this.triggerChange(t,this.data)}catch(e){throw console.error("MemoryStore.setMultiple 失败:",e),e}}onChanged(e,t){this.listeners.push({prop:"string"==typeof e?e:void 0,callback:"string"==typeof e?t:e})}triggerChange(e,t){this.listeners.length>0&&this.listeners.forEach(({prop:n,callback:o})=>{try{if(n)c(t[n],e[n])||o(t[n],e[n]);else{const n={};new Set([...Object.keys(t),...Object.keys(e)]).forEach(o=>{const i=o;c(t[i],e[i])||(n[i]={newValue:t[i],oldValue:e[i]})}),Object.keys(n).length>0&&o(n)}}catch(e){console.error("MemoryStore 变化回调执行失败:",e)}})}clearChangeCallbacks(){this.listeners=[]}has(e){try{return e in this.data}catch(e){return console.error("MemoryStore.has 失败:",e),!1}}getSize(){try{const e=JSON.stringify(this.data);return new Blob([e]).size}catch(e){return console.error("MemoryStore.getSize 失败:",e),0}}getStoreKey(){return this.storageKey}getStoreType(){return"memory"}}function w(e,t,n,o=!1){if(t in e.style)e.style[t]=n;else{const i=o?"important":"";e.style.setProperty(t,String(n),i)}}function b({tag:e="div",children:t=[],props:n={},attrs:o={},styles:i={}}={}){const r=document.createElement(e);Object.assign(r,n);for(const[e,t]of Object.entries(o))!1!==t&&r.setAttribute(e,t);for(const[e,t]of Object.entries(i))w(r,e,t);const s=Array.isArray(t)?t:[t];for(const e of s)e&&("object"==typeof e?e instanceof Element?r.appendChild(e):r.appendChild(b(e)):r.appendChild(document.createTextNode(e)));return r}function k(e){const t=document.createElementNS("http://www.w3.org/2000/svg",e.type);if(e.props)for(const[n,o]of Object.entries(e.props))t.setAttribute(n,o);if("string"==typeof e.children){const n=document.createTextNode(e.children);t.appendChild(n)}else Array.isArray(e.children)&&e.children.forEach(e=>{const n=k(e);t.appendChild(n)});return t}function S(e){const t=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;if(!(t instanceof SVGElement))throw new Error("解析失败,结果不是有效的 SVG 元素");return t}function L(e){return"string"==typeof e?S(e):k(e)}async function C(e){try{const t=await fetch(e);if(!t.ok)throw new Error(`网络请求失败: ${t.status} ${t.statusText}`);return S(await t.text())}catch(e){const t=e instanceof Error?e.message:"未知错误";throw new Error(`无法创建 SVG 元素: ${t}`)}}function I(e){e&&setTimeout(()=>{e.scrollTop=e.scrollHeight},0)}function O(e){e&&("true"!==e.dataset.isListeningForUserScroll&&(function(e){e&&e.addEventListener("scroll",()=>{!function(e,t){e.dataset.userInteracted=t?"true":"false"}(e,e.scrollTop+e.clientHeight<e.scrollHeight-5)})}(e),e.dataset.isListeningForUserScroll="true"),"true"!==e.dataset.userInteracted&&I(e))}v.instances=new Map;class N{constructor(e,t={}){this.element=void 0,this.options=void 0,this.isDragging=!1,this.startX=0,this.startY=0,this.initialX=0,this.initialY=0,this.threshold=5,this.onMouseMoveHandler=void 0,this.onMouseUpHandler=void 0,this.element=e,this.options=y({coordinate:"tl"},t);let n=getComputedStyle(this.element).position;n&&"static"!==n||(this.element.style.position="absolute"),this.options.position&&(this.element.style.position=this.options.position),this.onMouseMoveHandler=this.onMouseMove.bind(this),this.onMouseUpHandler=this.onMouseUp.bind(this),this.element.addEventListener("mousedown",this.onMouseDown.bind(this))}onMouseDown(e){e.preventDefault(),this.startX=e.clientX,this.startY=e.clientY,this.initialX=parseInt(window.getComputedStyle(this.element).left,10)||0,this.initialY=parseInt(window.getComputedStyle(this.element).top,10)||0,document.addEventListener("mousemove",this.onMouseMoveHandler),document.addEventListener("mouseup",this.onMouseUpHandler)}getBoundedPosition(e,t){const n=this.element.getBoundingClientRect();let o,i;if("fixed"===getComputedStyle(this.element).position)o=window.innerWidth-n.width,i=window.innerHeight-n.height;else{const e=(this.element.offsetParent||document.documentElement).getBoundingClientRect();o=e.width-n.width,i=e.height-n.height}return{x:Math.min(Math.max(0,e),o),y:Math.min(Math.max(0,t),i)}}onMouseMove(e){if(!this.isDragging){const t=e.clientY-this.startY;(Math.abs(e.clientX-this.startX)>this.threshold||Math.abs(t)>this.threshold)&&(this.isDragging=!0,this.options.onDragStart&&this.options.onDragStart(e))}if(this.isDragging){const t=this.getBoundedPosition(this.initialX+(e.clientX-this.startX),this.initialY+(e.clientY-this.startY));this.element.style.right="auto",this.element.style.bottom="auto",this.element.style.left=t.x+"px",this.element.style.top=t.y+"px",this.options.onDrag&&this.options.onDrag(e)}}convertCoordinate(){const e=this.element.getBoundingClientRect(),t=getComputedStyle(this.element).position;let n,o,i=null,r=null;if("fixed"===t?(i=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):(i=this.element.offsetParent,i||(i=document.documentElement),"static"===getComputedStyle(i).position?(i=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):r=i.getBoundingClientRect()),r){if("fixed"===t)n=e.left,o=e.top;else if(n=e.left-r.left,o=e.top-r.top,i instanceof HTMLElement){const e=getComputedStyle(i);n-=parseFloat(e.borderLeftWidth)||0,o-=parseFloat(e.borderTopWidth)||0}else n+=window.scrollX,o+=window.scrollY;switch(this.options.coordinate){case"tr":const t=r.width-n-e.width;this.element.style.left="auto",this.element.style.right=`${t}px`,this.element.style.top=`${o}px`,this.element.style.bottom="auto";break;case"bl":const i=r.height-o-e.height;this.element.style.left=`${n}px`,this.element.style.right="auto",this.element.style.top="auto",this.element.style.bottom=`${i}px`;break;case"br":const s=r.width-n-e.width,a=r.height-o-e.height;this.element.style.left="auto",this.element.style.right=`${s}px`,this.element.style.top="auto",this.element.style.bottom=`${a}px`;break;default:this.element.style.left=`${n}px`,this.element.style.right="auto",this.element.style.top=`${o}px`,this.element.style.bottom="auto"}}}onMouseUp(e){this.isDragging&&(this.options.coordinate&&"tl"!==this.options.coordinate&&this.convertCoordinate(),this.options.onDragEnd&&this.options.onDragEnd(e)),this.isDragging=!1,document.removeEventListener("mousemove",this.onMouseMoveHandler),document.removeEventListener("mouseup",this.onMouseUpHandler)}}class E{constructor(e,t="local"){this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.listeners=[],this.storageKey=e,this.storeType=t}static getInstanceKey(e,t="local"){return`${t}:${e}`}static getInstance(e,t="local"){const n=this.getInstanceKey(e,t);return this.instances.has(n)||this.instances.set(n,new E(e,t)),this.instances.get(n)}static local(e){return this.getInstance(e,"local")}static session(e){return this.getInstance(e,"session")}static clearInstance(e,t="local"){const n=this.getInstanceKey(e,t);this.instances.delete(n)}static clearAllInstances(){this.instances.clear()}getStore(){return this.store||(this.store="local"===this.storeType?localStorage:sessionStorage),this.store}set(e,t){try{const n=y({},this.getAll(),{[e]:t});this.getStore().setItem(this.storageKey,JSON.stringify(n))}catch(e){throw console.error("WebStore.set 失败:",e),e}}get(e){try{const t=this.getAll();return null==t?void 0:t[e]}catch(e){throw console.error("WebStore.get 失败:",e),e}}getAll(){try{const e=this.getStore().getItem(this.storageKey);return e?JSON.parse(e):{}}catch(e){return console.error("WebStore.getAll 失败:",e),{}}}remove(e){try{const t=this.getAll();t&&e in t&&(delete t[e],this.getStore().setItem(this.storageKey,JSON.stringify(t)))}catch(e){throw console.error("WebStore.remove 失败:",e),e}}clear(){try{this.getStore().removeItem(this.storageKey)}catch(e){throw console.error("WebStore.clear 失败:",e),e}}setMultiple(e){try{const t=y({},this.getAll(),e);this.getStore().setItem(this.storageKey,JSON.stringify(t))}catch(e){throw console.error("WebStore.setMultiple 失败:",e),e}}static setupGlobalListener(){this.isGlobalListenerInitialized||(this.isGlobalListenerInitialized=!0,window.addEventListener("storage",e=>{this.instances.forEach(t=>{if(e.key===t.storageKey&&e.storageArea===t.getStore()){const n=e.oldValue?JSON.parse(e.oldValue):{},o=e.newValue?JSON.parse(e.newValue):{};t.dispatchChange(o,n)}})}))}dispatchChange(e,t){const n=e||{},o=t||{};this.listeners.forEach(({prop:e,callback:t})=>{if(e)c(n[e],o[e])||t(n[e],o[e]);else{const e={};new Set([...Object.keys(n),...Object.keys(o)]).forEach(t=>{const i=t;c(n[i],o[i])||(e[i]={newValue:n[i],oldValue:o[i]})}),Object.keys(e).length>0&&t(e)}})}onChanged(e,t){E.setupGlobalListener(),this.listeners.push({prop:"string"==typeof e?e:void 0,callback:"string"==typeof e?t:e})}has(e){try{return void 0!==this.get(e)}catch(e){return console.error("WebStore.has 失败:",e),!1}}getSize(){try{const e=this.getStore().getItem(this.storageKey)||"";return new Blob([e]).size}catch(e){return console.error("WebStore.getSize 失败:",e),0}}getStoreKey(){return this.storageKey}}E.instances=new Map,E.isGlobalListenerInitialized=!1;class P{constructor(e,t="local"){this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.listeners=[],this.storageKey=e,this.storeType=t}static getInstanceKey(e,t="local"){return`${t}:${e}`}static getInstance(e,t="local"){const n=this.getInstanceKey(e,t);return this.instances.has(n)||this.instances.set(n,new P(e,t)),this.instances.get(n)}static local(e){return this.getInstance(e,"local")}static sync(e){return this.getInstance(e,"sync")}static clearInstance(e,t="local"){const n=this.getInstanceKey(e,t);this.instances.delete(n)}static clearAllInstances(){this.instances.clear()}getStore(){return this.store||(this.store=chrome.storage[this.storeType]),this.store}async set(e,t){try{const n=y({},await this.getAll(),{[e]:t});await this.getStore().set({[this.storageKey]:n})}catch(e){throw console.error("ChromeStore.set 失败:",e),e}}async get(e){try{const t=await this.getAll();return null==t?void 0:t[e]}catch(e){throw console.error("ChromeStore.get 失败:",e),e}}async getAll(){try{return(await this.getStore().get(this.storageKey))[this.storageKey]||{}}catch(e){throw console.error("ChromeStore.getAll 失败:",e),e}}async remove(e){try{const t=await this.getAll();t&&e in t&&(delete t[e],await this.getStore().set({[this.storageKey]:t}))}catch(e){throw console.error("ChromeStore.remove 失败:",e),e}}async clear(){try{await this.getStore().remove(this.storageKey)}catch(e){throw console.error("ChromeStore.clear 失败:",e),e}}async setMultiple(e){try{const t=y({},await this.getAll(),e);await this.getStore().set({[this.storageKey]:t})}catch(e){throw console.error("ChromeStore.setMultiple 失败:",e),e}}static setupGlobalListener(){this.isGlobalListenerInitialized||(this.isGlobalListenerInitialized=!0,chrome.storage.onChanged.addListener((e,t)=>{this.instances.forEach(n=>{if(n.storeType===t&&e[n.storageKey]){const{newValue:t,oldValue:o}=e[n.storageKey];n.dispatchChange(t,o)}})}))}dispatchChange(e,t){const n=e||{},o=t||{};this.listeners.forEach(({prop:e,callback:t})=>{if(e)c(n[e],o[e])||t(n[e],o[e]);else{const e={};new Set([...Object.keys(n),...Object.keys(o)]).forEach(t=>{const i=t;c(n[i],o[i])||(e[i]={newValue:n[i],oldValue:o[i]})}),Object.keys(e).length>0&&t(e)}})}onChanged(e,t){P.setupGlobalListener(),this.listeners.push({prop:"string"==typeof e?e:void 0,callback:"string"==typeof e?t:e})}async has(e){try{return void 0!==await this.get(e)}catch(e){return console.error("ChromeStore.has 失败:",e),!1}}async getSize(){try{const e=await this.getAll(),t=JSON.stringify(e);return new Blob([t]).size}catch(e){return console.error("ChromeStore.getSize 失败:",e),0}}getStoreKey(){return this.storageKey}}async function M({clientId:e,responseType:t="code",state:n,nonce:o,interactive:i=!0}){const r=chrome.identity.getRedirectURL(),s=Array.isArray(t)?t:[t],a=new URL("https://accounts.google.com/o/oauth2/v2/auth");return a.searchParams.set("client_id",e),a.searchParams.set("redirect_uri",r),a.searchParams.set("response_type",s.join(" ")),a.searchParams.set("scope","openid email profile"),o&&a.searchParams.set("nonce",o),n&&a.searchParams.set("state",n),chrome.identity.launchWebAuthFlow({url:a.toString(),interactive:i}).then(e=>{if(!e)return Promise.reject(new Error("redirectUrl is null"));const t=e.includes("?")?"?":"#",n=new URLSearchParams(e.split(t)[1]),o={};return n.forEach((e,t)=>{o[t]=e}),o}).catch(e=>(console.log("error",e),Promise.reject(e)))}function x(e){let t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(n)}function U(e,t,n=!1){return chrome.cookies.get({url:e,name:t}).then(e=>{var t;return n?(null==e||null==(t=e.value)?void 0:t.replace(/"/g,""))||"":null!=e?e:void 0})}function j(e,t=!1){return chrome.cookies.getAll({url:e}).then(e=>t?function(e){return e.map(e=>`${e.name}=${e.value}`).join("; ")}(e):e)}function _(){var e,t,n;return{locale:null==(e=chrome.i18n)?void 0:e.getUILanguage(),extId:null==(t=chrome.runtime)?void 0:t.id,version:null==(n=chrome.runtime)?void 0:n.getManifest().version}}function A(e){return"object"==typeof e&&null!==e&&"__error"in e&&!0===e.__error}function R(e={}){const{debug:t=!1,logPrefix:n="[MessageBus]"}=e,o=new Map;let i=!1;function r(e,...o){t&&console.error(`${n} ${e}`,...o)}function s(){i||(chrome.runtime.onMessage.addListener((e,t,n)=>{if(!e||"string"!=typeof e.type)return;const i=o.get(e.type);if(i)try{const o=i(e.payload,t);return o instanceof Promise?(o.then(n).catch(t=>{r(`Error handling "${String(e.type)}":`,t),n({__error:!0,message:t instanceof Error?t.message:String(t)})}),!0):(n(o),!1)}catch(t){return r(`Error handling "${String(e.type)}":`,t),n({__error:!0,message:t instanceof Error?t.message:String(t)}),!1}}),i=!0)}return{send:(e,...t)=>chrome.runtime.sendMessage({type:e,payload:t[0]}),sendToTab:(e,t,...n)=>chrome.tabs.sendMessage(e,{type:t,payload:n[0]}),on:(e,t)=>(s(),o.set(e,t),()=>{o.delete(e)}),onMany(e){s();const t=[];for(const[n,i]of Object.entries(e))i&&(o.set(n,i),t.push(n));return()=>{for(const e of t)o.delete(e)}},hasHandler:e=>o.has(e),getRegisteredTypes:()=>Array.from(o.keys()),clearAllHandlers(){o.clear()}}}P.instances=new Map,P.isGlobalListenerInitialized=!1;const T="https://www.linkedin.com/voyager/api";async function $({csrfToken:e,cookies:t}){const n=`${T}/me`,o=K(e,t);return fetch(n,{method:"GET",headers:o}).then(async e=>e.ok?e.json():null).catch(e=>(console.error(e),null))}function K(e,t){const n={"csrf-token":e};if(t){let e="";e="string"==typeof t?t:Object.entries(t).map(([e,t])=>`${e}=${t}`).join("; "),e&&(n.Cookie=e)}return n}async function D(e,{csrfToken:t,cookies:n}){const o=`${T}/identity/dash/profiles?q=memberIdentity&memberIdentity=${e}&decorationId=com.linkedin.voyager.dash.deco.identity.profile.FullProfileWithEntities-26`,i=K(t,n);return fetch(o,{method:"GET",headers:i}).then(async e=>{var t;return e.ok&&(null==(t=(await e.json()).elements)?void 0:t[0])||null}).catch(e=>(console.error(e),null))}async function z(e,{csrfToken:t,cookies:n}){let o="";const i="string"==typeof e?{universalName:e}:e,r="universalName"in i;o=r?`?q=universalName&universalName=${i.universalName}`:`/${i.urn}`;const s=`${T}/organization/companies${o}`,a=K(t,n);return fetch(s,{method:"GET",headers:a}).then(async e=>{if(e.ok){const n=await e.json();var t;return r?(null==(t=n.elements)?void 0:t[0])||null:n}return null}).catch(e=>(console.error(e),null))}const H={profilePage:{userPicture:[".pv-top-card__non-self-photo-wrapper img","#recent-activity-top-card img",".pv-top-card__photo-wrapper img",'div[componentkey^="com.linkedin.sdui.profile.card"] div[data-view-name="profile-top-card-member-photo"] img'],userName:['a[href^="/in"] h1',"#recent-activity-top-card h3",'div[data-view-name="profile-top-card-verified-badge"] div[role="button"]'],userOccupation:[".artdeco-entity-lockup .artdeco-entity-lockup__subtitle","#recent-activity-top-card h4"],linkedinProfileCard:[".scaffold-layout__main .artdeco-card:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"]'],privateProfileInfoSection:[".pv-profile-info-section"],howToContainer:["#profile-content, header#global-nav"],companyName:[".top-card-background-hero-image+div .mt2 ul>li span",'div[componentkey^="com.linkedin.sdui.profile.card"] div:has(div[data-view-name="profile-top-card-verified-badge"]) + div div[role="button"] p'],companyLogo:[".top-card-background-hero-image+div .mt2 ul>li img"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],location:["#profile-content .artdeco-card .top-card-background-hero-image+div .text-body-small.inline.t-black--light"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],mainExperienceContainer:[".artdeco-card:has(#experience) li:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div > div'],experienceCompanyLogo:['[data-field="experience_company_logo"] img','div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div figure[data-view-name="image"] img'],experienceCompanyName:['div:has([data-field="experience_company_logo"])+div .t-normal span:not(.visually-hidden)'],experienceOccupation:['div:has([data-field="experience_company_logo"])+div .t-bold span:not(.visually-hidden)'],experienceMultipleCompany:["li:has([data-view-name=profile-component-entity] .pvs-entity__sub-components .pvs-entity__sub-components) .t-bold span:not(.visually-hidden)"],experienceMultipleOccupation:['[data-view-name="profile-component-entity"] li:first-child .t-bold span:not(.visually-hidden)']},salesNavProfilePage:{profileCardSection:["#profile-card-section"],userName:['#profile-card-section [data-anonymize="person-name"]'],userPicture:['#profile-card-section img[data-anonymize="headshot-photo"]'],userOccupation:['#profile-card-section [data-anonymize="headline"]'],profileUrl:['#profile-card-section a[href^="/sales/lead"]'],linkedinProfileCard:["#profile-card-section"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],location:["#profile-card-section>section>div>div:last-child div:has(svg)"],companyName:['#profile-card-section a[data-anonymize="company-name"]'],companyLogo:['#profile-card-section img[data-anonymize="company-logo"]'],moreInfoButton:["#profile-card-section section[data-x--lead-actions-bar] button[data-x--lead-actions-bar-overflow-menu]",'#profile-card-section button[aria-label="Open actions overflow menu"]'],linkedinProfileLinkButton:['#hue-web-menu-outlet a[href^="https://www.linkedin.com/in/"]'],mainExperienceContainer:['[data-sn-view-name="feature-lead-experience"]'],experienceCompanyLogo:['li:first-child img[data-anonymize="company-logo"]'],experienceCompanyName:['li:first-child [data-anonymize="company-name"]'],experienceOccupation:['li:first-child [data-anonymize="job-title"]'],experienceMultipleOccupation:['ul li ul li:first-child [data-anonymize="job-title"]','ul li [data-anonymize="job-title"]'],experienceMultipleCompany:['li:first-child [data-anonymize="company-name"]']},searchPeoplePage:{searchEntityResult:['[data-view-name="search-entity-result-universal-template"]'],linkedinUrl:['a[data-test-app-aware-link][href^="https://www.linkedin.com/in/"]','a[data-view-name="search-result-lockup-title"]'],image:[".presence-entity img","a>div>div>figure>img"],userOccupation:['p:has(a[data-view-name="search-result-lockup-title"]) + p',".entity-result__primary-subtitle",".entity-result__divider > div div:nth-child(2)","div>div>div:nth-child(2)>div>div:nth-child(2)","figure + div p:nth-child(2)"],fullName:[".entity-result__title-text a span>span",".entity-result__title-line a span>span",".entity-result__title-line span>a>span>span","a:has(+.entity-result__badge)>span>span",".linked-area div:nth-child(2) > div:first-child > div.t-roman.t-sans a",'a[data-view-name="search-result-lockup-title"]'],resultList:[".search-results-container>div:has(.reusable-search__result-container)"],actionsDiv:[".entity-result__actions",".linked-area > div > div:last-child","div:has(figure) > div:last-child"],validResult:["[data-chameleon-result-urn] , .reusable-search__result-container"],searchResult:[".search-results-container li:has(>[data-chameleon-result-urn])",'[data-view-name="people-search-result"]'],searchResultsContainer:[".search-results-container",'[role="main"] div:has(>hr[role="presentation"])'],mainLayoutLeft:[".search-marvel-srp",'[role="main"] div:has(hr)>div>div'],howToContainer:[".hasLegacyFeedLineHeight div:has(main)",".authentication-outlet"]},searchAllPage:{peopleButton:["nav ul.search-reusables__filter-list>li>button"],toolbar:[".scaffold-layout-toolbar"]}};function G(e,t,n){switch(n){case"all":const n=e.querySelectorAll(t);return n.length>0?Array.from(n):null;case"closest":return e instanceof HTMLElement?e.closest(t):null;default:return e.querySelector(t)}}function V({page:e,key:t,selector:n,container:o,mode:i}){null!=o||(o=document);const r=e&&t?function({page:e,key:t}){return H[e][t]}({page:e,key:t}):[n];for(const e of r){const t=G(o,e,i);if(t)return t}return null}function B(e){if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value.trim()}function W(){var e,t,n,o,i,r,s;const a=window.location.href.includes("linkedin.com/sales")?"salesNavProfilePage":"profilePage";function l(e){return V({page:a,key:e,container:document})}const c=null==(e=l("userName"))?void 0:e.innerText;if(!c)return console.error("extractUserInfos: no userName found"),{};const u=null==(t=l("userPicture"))?void 0:t.src,d=null==(n=l("userOccupation"))?void 0:n.innerHTML,h=null==(o=l("companyName"))?void 0:o.innerText,m=null==(i=l("companyLogo"))?void 0:i.src,p=null==(r=l("location"))?void 0:r.innerText;let g;return"salesNavProfilePage"===a&&(g=/linkedin\.com\/sales\/lead/i.test(window.location.href)?window.location.href:null==(s=l("profileUrl"))?void 0:s.href),{name:B(c),profileUrl:g,picture:u,occupation:B(d),companyName:h,companyPicture:m,location:p}}function Y(e){return/^https?:\/\/(www|.{2})\.linkedin\.com/.test(e)}const F={"":0,chrome:1,"chrome-extension":2,"view-source":3,ftp:4,file:5,data:6,blob:7,about:8};function X(e=""){let t="";const n=e.split("#")[0].toLocaleLowerCase();return/^https\:\/\/(www|.{2})\.linkedin\.com\/in\/[^/?]+(\/recent-activity\/|\/details\/|\/overlay\/|\/?\?[^/]*|\/?$)/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/people\/(.+?),/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/(profile|lead)\/([^,]{39}),/.test(n)?t="profile":n.includes("linkedin.com/feed")?t="feed":n.includes("linkedin.com/posts/")?t="post":n.includes("linkedin.com/login")||n.includes("linkedin.com/checkpoint")||n.includes("linkedin.com/authwall")?t="login":n.includes("linkedin.com/company/")?t="company":n.includes("linkedin.com/messaging/thread/")?t="messages":n.includes("linkedin.com/search/results/people/?")||n.includes("linkedin.com/sales/search/people")?t="search-people":n.includes("linkedin.com/search/results/all")?t="search-all":n.includes("linkedin.com/mynetwork/")&&(t="connections"),t}function J(e=""){var t;const n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/in\/([^?/]+)/)||[])[1]||(e.match(/linkedin\.com\/sales\/people\/(.+?),/)||[])[1]||(e.match(/linkedin\.com\/sales\/(?:profile|lead)\/([^,]{39}),/)||[])[1]||"";return decodeURIComponent(n)}function q(e=""){var t;const n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/posts\/([^\/]+)\//)||[])[1]||"";return decodeURIComponent(n)}function Q(e=""){var t;const n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/company\/([^?/]+)/)||[])[1]||"";return decodeURIComponent(n)}function Z(e=""){var t;return J(e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL)||Q(e)||""}function ee(e=""){if(!e)return"";const t=Object.keys(F),n=new URL(e).protocol.replace(":","");return t.includes(n)?n:X(e)}var te,ne;function oe(e){if(!e)return;const t=e.match(/:(\d+)$/);return t?t[1]:void 0}function ie(e){if(!e)return;const t=e.match(/,(\d+)\)$/);return t?t[1]:void 0}function re(e){if(null!=e&&e.year)return{year:e.year,month:e.month}}function se(e,t,n){if(!e||0===Object.keys(e).length)return n||"";if(t&&e[t])return e[t];const o=Object.keys(e),i=o.find(e=>e.startsWith("en"));return i?e[i]:e[o[0]]||n||""}function ae(e,t){if(!e||!t)return{};const n={};for(const[o,i]of Object.entries(e))o!==t&&i&&(n[o]=i);return n}function le(e){return ce(e)}function ce(e){var t,n,o;if(!e)return;const i=(e.rootUrl&&e.artifacts?e:null)||e.vectorImage||(null==(t=e.image)?void 0:t["com.linkedin.common.VectorImage"])||e["com.linkedin.common.VectorImage"]||(null==(n=e.displayImageReference)?void 0:n.vectorImage);if(null==i||!i.rootUrl||null==i||null==(o=i.artifacts)||!o.length)return;const r=i.artifacts,s=r.reduce((e,t)=>((null==t?void 0:t.width)||0)>((null==e?void 0:e.width)||0)?t:e,r[0]);return null!=s&&s.fileIdentifyingUrlPathSegment?i.rootUrl+s.fileIdentifyingUrlPathSegment:void 0}function ue(e){var t,n,o,i,r,s,a,l;const c=oe(e.objectUrn);if(!c)throw new Error("Cannot extract memberId from rawProfile");const u=function(e){if(e)return`${e.language}_${e.country}`}(e.primaryLocale),d=function(e){if(null!=e&&e.length)return e.map(e=>`${e.language}_${e.country}`)}(e.supportedLocales),h=se(e.multiLocaleFirstName,u,e.firstName),m=se(e.multiLocaleLastName,u,e.lastName),p=se(e.multiLocaleHeadline,u,e.headline),g=se(e.multiLocaleSummary,u,e.summary),f={},y=(null==d?void 0:d.filter(e=>e!==u))||[];for(const t of y){var v,w,b,k;const n={},o=null==(v=e.multiLocaleFirstName)?void 0:v[t],i=null==(w=e.multiLocaleLastName)?void 0:w[t],r=null==(b=e.multiLocaleHeadline)?void 0:b[t],s=null==(k=e.multiLocaleSummary)?void 0:k[t];o&&(n.firstName=o),i&&(n.lastName=i),r&&(n.headline=r),s&&(n.summary=s),Object.keys(n).length>0&&(f[t]=n)}const S=(null==(t=e.profileSkills)||null==(t=t.elements)?void 0:t.map(e=>e.name))||[],L=(null==(n=e.profileLanguages)||null==(n=n.elements)?void 0:n.map(e=>({name:e.name,proficiency:e.proficiency})))||[],C=(null==(o=e.profileHonors)||null==(o=o.elements)?void 0:o.map(e=>({title:e.title,issuer:e.issuer,issuedOn:re(e.issuedOn)})))||[],I=(null==(i=e.profileEducations)||null==(i=i.elements)?void 0:i.map(e=>{var t,n,o;return{school:se(e.multiLocaleSchoolName,u,e.schoolName||(null==(t=e.school)?void 0:t.name)),degree:se(e.multiLocaleDegreeName,u,e.degreeName)||void 0,fieldOfStudy:se(e.multiLocaleFieldOfStudy,u,e.fieldOfStudy)||void 0,startDate:re(null==(n=e.dateRange)?void 0:n.start),endDate:re(null==(o=e.dateRange)?void 0:o.end)}}))||[],O=(null==(r=e.profileCertifications)||null==(r=r.elements)?void 0:r.map(e=>{var t,n;return{name:se(e.multiLocaleName,u,e.name),authority:se(e.multiLocaleAuthority,u,e.authority)||void 0,startDate:re(null==(t=e.dateRange)?void 0:t.start),endDate:re(null==(n=e.dateRange)?void 0:n.end),licenseNumber:e.licenseNumber,url:e.url}}))||[],N=[];null==(s=e.profilePositionGroups)||null==(s=s.elements)||s.forEach(e=>{var t;((null==(t=e.profilePositionInPositionGroup)?void 0:t.elements)||[]).forEach(t=>{var n,o,i,r;const s=t.company||e.company,a=oe(t.companyUrn||(null==s?void 0:s.entityUrn)),l=se(t.multiLocaleTitle,u,t.title),c=se(t.multiLocaleCompanyName,u,t.companyName||(null==s?void 0:s.name)),d=se(t.multiLocaleDescription,u,t.description)||void 0,h={};for(const e of y){var m,p,g;const n={},o=null==(m=t.multiLocaleTitle)?void 0:m[e],i=null==(p=t.multiLocaleDescription)?void 0:p[e],r=null==(g=t.multiLocaleCompanyName)?void 0:g[e];o&&(n.title=o),i&&(n.description=i),r&&(n.companyName=r),Object.keys(n).length>0&&(h[e]=n)}let f;if(null!=s&&s.industry&&null!=s&&null!=(n=s.industryUrns)&&n.length){const e=s.industry[s.industryUrns[0]];f=null==e?void 0:e.name}N.push({linkedinPositionId:ie(t.entityUrn),companyName:c,companyLinkedinId:a,companyUniversalName:null==s?void 0:s.universalName,title:l,description:d,startDate:re(null==(o=t.dateRange)?void 0:o.start),endDate:re(null==(i=t.dateRange)?void 0:i.end),isCurrent:!(null!=(r=t.dateRange)&&r.end),companyLogoUrl:le(null==s?void 0:s.logo),companyIndustry:f,companyEmployeeCountRange:null!=s&&s.employeeCountRange?{start:s.employeeCountRange.start,end:s.employeeCountRange.end}:void 0,translations:Object.keys(h).length>0?h:void 0})})});const E=(null==(a=e.geoLocation)||null==(a=a.geo)?void 0:a.defaultLocalizedName)||void 0,P=null==(l=e.industry)?void 0:l.name;return{memberId:c,publicIdentifier:e.publicIdentifier,firstName:h,lastName:m,headline:p||void 0,summary:g||void 0,location:E,pictureUrl:(x=e.profilePicture,ce(x)),backgroundPictureUrl:(M=e.backgroundPicture,ce(M)),isPremium:!0===e.premium,industry:P,primaryLocale:u,supportedLocales:d,skills:S,languages:L.length>0?L:void 0,honors:C.length>0?C:void 0,educations:I.length>0?I:void 0,certifications:O.length>0?O:void 0,positions:N.length>0?N:void 0,translations:Object.keys(f).length>0?f:void 0};var M,x}function de(e){var t;const n=new Map;return null==(t=e.profilePositionGroups)||null==(t=t.elements)||t.forEach(e=>{var t;[e.company,...(null==(t=e.profilePositionInPositionGroup)||null==(t=t.elements)?void 0:t.map(e=>e.company))||[]].filter(Boolean).forEach(e=>{var t;const o=oe(e.entityUrn);if(!o||n.has(o))return;let i;if(e.industry&&null!=(t=e.industryUrns)&&t.length){const t=e.industry[e.industryUrns[0]];i=null==t?void 0:t.name}n.set(o,{linkedinId:o,universalName:e.universalName,name:e.name||"",industry:i,employeeCountRange:e.employeeCountRange?{start:e.employeeCountRange.start,end:e.employeeCountRange.end}:void 0,logoUrl:le(e.logo)})})}),Array.from(n.values())}function he(e){var t,n,o,i,r,s,a,l,c,u;const d=(null==(t=e.elements)?void 0:t[0])||e,h=oe(d.entityUrn);if(!h)throw new Error("Cannot extract linkedinId from company data");const m=(null!=(n=d.defaultLocale)&&n.language&&null!=(o=d.defaultLocale)&&o.country?`${d.defaultLocale.language}_${d.defaultLocale.country}`:null)||(null!=(i=d.multiLocaleNames)&&i.localized?Object.keys(d.multiLocaleNames.localized)[0]:null)||"en_US",p=null==(r=d.multiLocaleNames)?void 0:r.localized,g=se(p,m,d.name),f=null==(s=d.multiLocaleDescriptions)?void 0:s.localized,y=se(f,m,"string"==typeof d.description?d.description:void 0)||void 0,v={},w=ae(p,m),b=ae(f,m),k=new Set([...Object.keys(w),...Object.keys(b)]);for(const e of k){const t={};w[e]&&(t.name=w[e]),b[e]&&(t.description=b[e]),Object.keys(t).length>0&&(v[e]=t)}const S=d.headquarter||(null==(a=d.confirmedLocations)?void 0:a.find(e=>e.headquarter)),L=ce(d.logo)||ce(null==(l=d.logos)?void 0:l.logo),C=ce(d.backgroundCoverImage),I=d.jobSearchPageUrl||void 0,O=null==(c=d.companyIndustries)||null==(c=c[0])?void 0:c.localizedName,N=k.size>0?[m,...Array.from(k)]:void 0;return{linkedinId:h,universalName:d.universalName,name:g,description:y,industry:O,employeeCountRange:d.staffCount?{start:d.staffCount,end:d.staffCount}:d.staffCountRange?{start:d.staffCountRange.start,end:d.staffCountRange.end}:void 0,headquarters:S?{country:S.country,city:S.city,geographicArea:S.geographicArea,postalCode:S.postalCode,line1:S.line1}:void 0,logoUrl:L,backgroundCoverUrl:C,specialities:d.specialities,companyType:d.type,foundedYear:null==(u=d.foundedOn)?void 0:u.year,websiteUrl:d.companyPageUrl,jobSearchPageUrl:I,primaryLocale:m,supportedLocales:N,translations:Object.keys(v).length>0?v:void 0}}!function(e){e.PUBLIC="public",e.MANUAL="manual",e.APOLLO="apollo",e.LUSHA="lusha",e.HUNTER="hunter",e.ROCKETREACH="rocketreach",e.SNOV="snov",e.CLEARBIT="clearbit"}(te||(te={})),function(e){e.EMAIL="email",e.PHONE="phone",e.BOTH="both"}(ne||(ne={}));export{P as ChromeStore,te as ContactInfoSource,N as Draggable,v as MemoryStore,ne as QueryType,e as RealUndefined,E as WebStore,g as cacheWrapper,r as cloneDeep,l as createDefaultObject,b as createElement,R as createMessageBus,L as createSvg,C as createSvgFromUrl,s as debounce,x as decodeJWT,a as delayExecution,de as extractCompaniesFromRawProfile,i as generateStableUniqueKey,Q as getCompanyPublicId,W as getContactInfo,U as getCookie,j as getCookies,V as getElement,_ as getExtensionInfo,o as getGlobal,z as getLinkedinCompany,$ as getLinkedinMe,X as getLinkedinPageType,D as getLinkedinProfile,Z as getLinkedinPublicId,ee as getPageType,q as getPostPublicId,J as getProfilePublicId,t as isCloneable,c as isEqual,A as isErrorResponse,Y as isLinkedInUrl,n as isPrimitive,M as launchWebAuthFlow,F as pageTypeMap,I as scrollToBottom,O as scrollToBottomIfNeeded,f as singleExecutionWrapper,he as transformRawCompany,ue as transformRawProfile};
1
+ const e=Symbol("undefined");function t(e){return"function"==typeof(null==e?void 0:e.clone)}function n(e){const t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||"undefined"===t}function i(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this}function o(e){return n(e)?String(e):JSON.stringify(e,function(e,t){return"object"!=typeof t||null===t||Array.isArray(t)?t:Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{})})}function r(e){if(null===e||"object"!=typeof e)return e;if(t(e))return e.clone();if(Array.isArray(e))return e.map(e=>r(e));const n={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=r(e[t]));return n}function s(e,t){let n=null;return function(...i){const o=this;null!==n&&clearTimeout(n),n=setTimeout(()=>{e.apply(o,i),n=null},t)}}function a(e,t=0,...n){return new Promise(i=>{0===t?i(e(...n)):setTimeout(()=>{i(e(...n))},t)})}function l(e){return new Proxy({},{get:(t,n)=>t.hasOwnProperty(n)?t[n]:e})}function c(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const o of n)if(!i.includes(o)||!c(e[o],t[o]))return!1;return!0}const u=l(e),d=l(!1);function h(e){return u[e]}function m(t){return u[t]!==e}const p={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function g(e,t=p){const n=function(...n){const i=o(n)+e.name+(t.identifier||"");if(m(i))return Promise.resolve(r(h(i)));if(d[i]){const e=Object.assign({},p,t);return new Promise(t=>{const n=Date.now(),o=setInterval(()=>{m(i)?(clearInterval(o),t(r(h(i)))):Date.now()-n>e.timeout&&(d[i]=!1,clearInterval(o),t(r(e.timeoutResult)))},100)})}return d[i]=!0,e.apply(this,n).then(e=>(u[i]=e,r(u[i]))).catch(e=>{throw e}).finally(()=>{d[i]=!1})};return Object.defineProperty(n,"name",{value:`cacheWrapper_${e.name}`,configurable:!0}),n}function f(t,n=0){const i=function i(...o){if(i.isExecuting)return Promise.resolve(e);i.isExecuting=!0;const r=performance.now(),s=t.apply(this,o);return s.finally(()=>{const e=performance.now()-r;n&&n>e?setTimeout(()=>{i.isExecuting=!1},n-e):i.isExecuting=!1}),s};return i.isExecuting=!1,i}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y.apply(null,arguments)}class v{constructor(e){this.storageKey=void 0,this.data={},this.listeners=[],this.storageKey=e}static getInstanceKey(e){return`memory:${e}`}static getInstance(e){const t=this.getInstanceKey(e);return this.instances.has(t)||this.instances.set(t,new v(e)),this.instances.get(t)}static create(e){return this.getInstance(e)}static clearInstance(e){const t=this.getInstanceKey(e),n=this.instances.get(t);n&&n.clearChangeCallbacks(),this.instances.delete(t)}static clearAllInstances(){this.instances.forEach(e=>{e.clearChangeCallbacks()}),this.instances.clear()}set(e,t){try{const n=y({},this.data);this.data=y({},this.data,{[e]:t}),this.triggerChange(n,this.data)}catch(e){throw console.error("MemoryStore.set 失败:",e),e}}get(e){try{return this.data[e]}catch(e){throw console.error("MemoryStore.get 失败:",e),e}}getAll(){return y({},this.data)}remove(e){try{if(e in this.data){const t=y({},this.data),n=y({},this.data);delete n[e],this.data=n,this.triggerChange(t,this.data)}}catch(e){throw console.error("MemoryStore.remove 失败:",e),e}}clear(){try{const e=y({},this.data);this.data={},this.triggerChange(e,this.data)}catch(e){throw console.error("MemoryStore.clear 失败:",e),e}}setMultiple(e){try{const t=y({},this.data);this.data=y({},this.data,e),this.triggerChange(t,this.data)}catch(e){throw console.error("MemoryStore.setMultiple 失败:",e),e}}onChanged(e,t){this.listeners.push({prop:"string"==typeof e?e:void 0,callback:"string"==typeof e?t:e})}offChanged(e,t){const n="string"==typeof e?e:void 0,i="string"==typeof e?t:e;this.listeners=this.listeners.filter(e=>!(e.prop===n&&e.callback===i))}triggerChange(e,t){this.listeners.length>0&&this.listeners.forEach(({prop:n,callback:i})=>{try{if(n)c(t[n],e[n])||i(t[n],e[n]);else{const n={};new Set([...Object.keys(t),...Object.keys(e)]).forEach(i=>{const o=i;c(t[o],e[o])||(n[o]={newValue:t[o],oldValue:e[o]})}),Object.keys(n).length>0&&i(n)}}catch(e){console.error("MemoryStore 变化回调执行失败:",e)}})}clearChangeCallbacks(){this.listeners=[]}has(e){try{return e in this.data}catch(e){return console.error("MemoryStore.has 失败:",e),!1}}getSize(){try{const e=JSON.stringify(this.data);return new Blob([e]).size}catch(e){return console.error("MemoryStore.getSize 失败:",e),0}}getStoreKey(){return this.storageKey}getStoreType(){return"memory"}}function w(e,t,n,i=!1){if(t in e.style)e.style[t]=n;else{const o=i?"important":"";e.style.setProperty(t,String(n),o)}}function b({tag:e="div",children:t=[],props:n={},attrs:i={},styles:o={}}={}){const r=document.createElement(e);Object.assign(r,n);for(const[e,t]of Object.entries(i))!1!==t&&r.setAttribute(e,t);for(const[e,t]of Object.entries(o))w(r,e,t);const s=Array.isArray(t)?t:[t];for(const e of s)e&&("object"==typeof e?e instanceof Element?r.appendChild(e):r.appendChild(b(e)):r.appendChild(document.createTextNode(e)));return r}function k(e){const t=document.createElementNS("http://www.w3.org/2000/svg",e.type);if(e.props)for(const[n,i]of Object.entries(e.props))t.setAttribute(n,i);if("string"==typeof e.children){const n=document.createTextNode(e.children);t.appendChild(n)}else Array.isArray(e.children)&&e.children.forEach(e=>{const n=k(e);t.appendChild(n)});return t}function S(e){const t=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;if(!(t instanceof SVGElement))throw new Error("解析失败,结果不是有效的 SVG 元素");return t}function C(e){return"string"==typeof e?S(e):k(e)}async function L(e){try{const t=await fetch(e);if(!t.ok)throw new Error(`网络请求失败: ${t.status} ${t.statusText}`);return S(await t.text())}catch(e){const t=e instanceof Error?e.message:"未知错误";throw new Error(`无法创建 SVG 元素: ${t}`)}}function I(e){e&&setTimeout(()=>{e.scrollTop=e.scrollHeight},0)}function O(e){e&&("true"!==e.dataset.isListeningForUserScroll&&(function(e){e&&e.addEventListener("scroll",()=>{!function(e,t){e.dataset.userInteracted=t?"true":"false"}(e,e.scrollTop+e.clientHeight<e.scrollHeight-5)})}(e),e.dataset.isListeningForUserScroll="true"),"true"!==e.dataset.userInteracted&&I(e))}v.instances=new Map;class N{constructor(e,t={}){this.element=void 0,this.options=void 0,this.isDragging=!1,this.startX=0,this.startY=0,this.initialX=0,this.initialY=0,this.threshold=5,this.onMouseMoveHandler=void 0,this.onMouseUpHandler=void 0,this.element=e,this.options=y({coordinate:"tl"},t);let n=getComputedStyle(this.element).position;n&&"static"!==n||(this.element.style.position="absolute"),this.options.position&&(this.element.style.position=this.options.position),this.onMouseMoveHandler=this.onMouseMove.bind(this),this.onMouseUpHandler=this.onMouseUp.bind(this),this.element.addEventListener("mousedown",this.onMouseDown.bind(this))}onMouseDown(e){e.preventDefault(),this.startX=e.clientX,this.startY=e.clientY,this.initialX=parseInt(window.getComputedStyle(this.element).left,10)||0,this.initialY=parseInt(window.getComputedStyle(this.element).top,10)||0,document.addEventListener("mousemove",this.onMouseMoveHandler),document.addEventListener("mouseup",this.onMouseUpHandler)}getBoundedPosition(e,t){const n=this.element.getBoundingClientRect();let i,o;if("fixed"===getComputedStyle(this.element).position)i=window.innerWidth-n.width,o=window.innerHeight-n.height;else{const e=(this.element.offsetParent||document.documentElement).getBoundingClientRect();i=e.width-n.width,o=e.height-n.height}return{x:Math.min(Math.max(0,e),i),y:Math.min(Math.max(0,t),o)}}onMouseMove(e){if(!this.isDragging){const t=e.clientY-this.startY;(Math.abs(e.clientX-this.startX)>this.threshold||Math.abs(t)>this.threshold)&&(this.isDragging=!0,this.options.onDragStart&&this.options.onDragStart(e))}if(this.isDragging){const t=this.getBoundedPosition(this.initialX+(e.clientX-this.startX),this.initialY+(e.clientY-this.startY));this.element.style.right="auto",this.element.style.bottom="auto",this.element.style.left=t.x+"px",this.element.style.top=t.y+"px",this.options.onDrag&&this.options.onDrag(e)}}convertCoordinate(){const e=this.element.getBoundingClientRect(),t=getComputedStyle(this.element).position;let n,i,o=null,r=null;if("fixed"===t?(o=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):(o=this.element.offsetParent,o||(o=document.documentElement),"static"===getComputedStyle(o).position?(o=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):r=o.getBoundingClientRect()),r){if("fixed"===t)n=e.left,i=e.top;else if(n=e.left-r.left,i=e.top-r.top,o instanceof HTMLElement){const e=getComputedStyle(o);n-=parseFloat(e.borderLeftWidth)||0,i-=parseFloat(e.borderTopWidth)||0}else n+=window.scrollX,i+=window.scrollY;switch(this.options.coordinate){case"tr":const t=r.width-n-e.width;this.element.style.left="auto",this.element.style.right=`${t}px`,this.element.style.top=`${i}px`,this.element.style.bottom="auto";break;case"bl":const o=r.height-i-e.height;this.element.style.left=`${n}px`,this.element.style.right="auto",this.element.style.top="auto",this.element.style.bottom=`${o}px`;break;case"br":const s=r.width-n-e.width,a=r.height-i-e.height;this.element.style.left="auto",this.element.style.right=`${s}px`,this.element.style.top="auto",this.element.style.bottom=`${a}px`;break;default:this.element.style.left=`${n}px`,this.element.style.right="auto",this.element.style.top=`${i}px`,this.element.style.bottom="auto"}}}onMouseUp(e){this.isDragging&&(this.options.coordinate&&"tl"!==this.options.coordinate&&this.convertCoordinate(),this.options.onDragEnd&&this.options.onDragEnd(e)),this.isDragging=!1,document.removeEventListener("mousemove",this.onMouseMoveHandler),document.removeEventListener("mouseup",this.onMouseUpHandler)}}class E{constructor(e,t="local"){this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.listeners=[],this.storageKey=e,this.storeType=t}static getInstanceKey(e,t="local"){return`${t}:${e}`}static getInstance(e,t="local"){const n=this.getInstanceKey(e,t);return this.instances.has(n)||this.instances.set(n,new E(e,t)),this.instances.get(n)}static local(e){return this.getInstance(e,"local")}static session(e){return this.getInstance(e,"session")}static clearInstance(e,t="local"){const n=this.getInstanceKey(e,t);this.instances.delete(n)}static clearAllInstances(){this.instances.clear()}getStore(){return this.store||(this.store="local"===this.storeType?localStorage:sessionStorage),this.store}set(e,t){try{const n=y({},this.getAll(),{[e]:t});this.getStore().setItem(this.storageKey,JSON.stringify(n))}catch(e){throw console.error("WebStore.set 失败:",e),e}}get(e){try{const t=this.getAll();return null==t?void 0:t[e]}catch(e){throw console.error("WebStore.get 失败:",e),e}}getAll(){try{const e=this.getStore().getItem(this.storageKey);return e?JSON.parse(e):{}}catch(e){return console.error("WebStore.getAll 失败:",e),{}}}remove(e){try{const t=this.getAll();t&&e in t&&(delete t[e],this.getStore().setItem(this.storageKey,JSON.stringify(t)))}catch(e){throw console.error("WebStore.remove 失败:",e),e}}clear(){try{this.getStore().removeItem(this.storageKey)}catch(e){throw console.error("WebStore.clear 失败:",e),e}}setMultiple(e){try{const t=y({},this.getAll(),e);this.getStore().setItem(this.storageKey,JSON.stringify(t))}catch(e){throw console.error("WebStore.setMultiple 失败:",e),e}}static setupGlobalListener(){this.isGlobalListenerInitialized||(this.isGlobalListenerInitialized=!0,window.addEventListener("storage",e=>{this.instances.forEach(t=>{if(e.key===t.storageKey&&e.storageArea===t.getStore()){const n=e.oldValue?JSON.parse(e.oldValue):{},i=e.newValue?JSON.parse(e.newValue):{};t.dispatchChange(i,n)}})}))}dispatchChange(e,t){const n=e||{},i=t||{};this.listeners.forEach(({prop:e,callback:t})=>{if(e)c(n[e],i[e])||t(n[e],i[e]);else{const e={};new Set([...Object.keys(n),...Object.keys(i)]).forEach(t=>{const o=t;c(n[o],i[o])||(e[o]={newValue:n[o],oldValue:i[o]})}),Object.keys(e).length>0&&t(e)}})}onChanged(e,t){E.setupGlobalListener(),this.listeners.push({prop:"string"==typeof e?e:void 0,callback:"string"==typeof e?t:e})}offChanged(e,t){const n="string"==typeof e?e:void 0,i="string"==typeof e?t:e;this.listeners=this.listeners.filter(e=>!(e.prop===n&&e.callback===i))}has(e){try{return void 0!==this.get(e)}catch(e){return console.error("WebStore.has 失败:",e),!1}}getSize(){try{const e=this.getStore().getItem(this.storageKey)||"";return new Blob([e]).size}catch(e){return console.error("WebStore.getSize 失败:",e),0}}getStoreKey(){return this.storageKey}}E.instances=new Map,E.isGlobalListenerInitialized=!1;class P{constructor(e,t="local"){this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.listeners=[],this.storageKey=e,this.storeType=t}static getInstanceKey(e,t="local"){return`${t}:${e}`}static getInstance(e,t="local"){const n=this.getInstanceKey(e,t);return this.instances.has(n)||this.instances.set(n,new P(e,t)),this.instances.get(n)}static local(e){return this.getInstance(e,"local")}static sync(e){return this.getInstance(e,"sync")}static clearInstance(e,t="local"){const n=this.getInstanceKey(e,t);this.instances.delete(n)}static clearAllInstances(){this.instances.clear()}getStore(){return this.store||(this.store=chrome.storage[this.storeType]),this.store}async set(e,t){try{const n=y({},await this.getAll(),{[e]:t});await this.getStore().set({[this.storageKey]:n})}catch(e){throw console.error("ChromeStore.set 失败:",e),e}}async get(e){try{const t=await this.getAll();return null==t?void 0:t[e]}catch(e){throw console.error("ChromeStore.get 失败:",e),e}}async getAll(){try{return(await this.getStore().get(this.storageKey))[this.storageKey]||{}}catch(e){throw console.error("ChromeStore.getAll 失败:",e),e}}async remove(e){try{const t=await this.getAll();t&&e in t&&(delete t[e],await this.getStore().set({[this.storageKey]:t}))}catch(e){throw console.error("ChromeStore.remove 失败:",e),e}}async clear(){try{await this.getStore().remove(this.storageKey)}catch(e){throw console.error("ChromeStore.clear 失败:",e),e}}async setMultiple(e){try{const t=y({},await this.getAll(),e);await this.getStore().set({[this.storageKey]:t})}catch(e){throw console.error("ChromeStore.setMultiple 失败:",e),e}}static setupGlobalListener(){this.isGlobalListenerInitialized||(this.isGlobalListenerInitialized=!0,chrome.storage.onChanged.addListener((e,t)=>{this.instances.forEach(n=>{if(n.storeType===t&&e[n.storageKey]){const{newValue:t,oldValue:i}=e[n.storageKey];n.dispatchChange(t,i)}})}))}dispatchChange(e,t){const n=e||{},i=t||{};this.listeners.forEach(({prop:e,callback:t})=>{if(e)c(n[e],i[e])||t(n[e],i[e]);else{const e={};new Set([...Object.keys(n),...Object.keys(i)]).forEach(t=>{const o=t;c(n[o],i[o])||(e[o]={newValue:n[o],oldValue:i[o]})}),Object.keys(e).length>0&&t(e)}})}onChanged(e,t){P.setupGlobalListener(),this.listeners.push({prop:"string"==typeof e?e:void 0,callback:"string"==typeof e?t:e})}offChanged(e,t){const n="string"==typeof e?e:void 0,i="string"==typeof e?t:e;this.listeners=this.listeners.filter(e=>!(e.prop===n&&e.callback===i))}async has(e){try{return void 0!==await this.get(e)}catch(e){return console.error("ChromeStore.has 失败:",e),!1}}async getSize(){try{const e=await this.getAll(),t=JSON.stringify(e);return new Blob([t]).size}catch(e){return console.error("ChromeStore.getSize 失败:",e),0}}getStoreKey(){return this.storageKey}}async function M({clientId:e,responseType:t="code",state:n,nonce:i,interactive:o=!0}){const r=chrome.identity.getRedirectURL(),s=Array.isArray(t)?t:[t],a=new URL("https://accounts.google.com/o/oauth2/v2/auth");return a.searchParams.set("client_id",e),a.searchParams.set("redirect_uri",r),a.searchParams.set("response_type",s.join(" ")),a.searchParams.set("scope","openid email profile"),i&&a.searchParams.set("nonce",i),n&&a.searchParams.set("state",n),chrome.identity.launchWebAuthFlow({url:a.toString(),interactive:o}).then(e=>{if(!e)return Promise.reject(new Error("redirectUrl is null"));const t=e.includes("?")?"?":"#",n=new URLSearchParams(e.split(t)[1]),i={};return n.forEach((e,t)=>{i[t]=e}),i}).catch(e=>(console.log("error",e),Promise.reject(e)))}function x(e){let t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(n)}function U(e,t,n=!1){return chrome.cookies.get({url:e,name:t}).then(e=>{var t;return n?(null==e||null==(t=e.value)?void 0:t.replace(/"/g,""))||"":null!=e?e:void 0})}function j(e,t=!1){return chrome.cookies.getAll({url:e}).then(e=>t?function(e){return e.map(e=>`${e.name}=${e.value}`).join("; ")}(e):e)}function _(){var e,t,n;return{locale:null==(e=chrome.i18n)?void 0:e.getUILanguage(),extId:null==(t=chrome.runtime)?void 0:t.id,version:null==(n=chrome.runtime)?void 0:n.getManifest().version}}function A(e){return"object"==typeof e&&null!==e&&"__error"in e&&!0===e.__error}function R(e={}){const{debug:t=!1,logPrefix:n="[MessageBus]"}=e,i=new Map;let o=!1;function r(e,...i){t&&console.error(`${n} ${e}`,...i)}function s(){o||(chrome.runtime.onMessage.addListener((e,t,n)=>{if(!e||"string"!=typeof e.type)return;const o=i.get(e.type);if(o)try{const i=o(e.payload,t);return i instanceof Promise?(i.then(n).catch(t=>{r(`Error handling "${String(e.type)}":`,t),n({__error:!0,message:t instanceof Error?t.message:String(t)})}),!0):(n(i),!1)}catch(t){return r(`Error handling "${String(e.type)}":`,t),n({__error:!0,message:t instanceof Error?t.message:String(t)}),!1}}),o=!0)}return{send:(e,...t)=>chrome.runtime.sendMessage({type:e,payload:t[0]}),sendToTab:(e,t,...n)=>chrome.tabs.sendMessage(e,{type:t,payload:n[0]}),on:(e,t)=>(s(),i.set(e,t),()=>{i.delete(e)}),onMany(e){s();const t=[];for(const[n,o]of Object.entries(e))o&&(i.set(n,o),t.push(n));return()=>{for(const e of t)i.delete(e)}},hasHandler:e=>i.has(e),getRegisteredTypes:()=>Array.from(i.keys()),clearAllHandlers(){i.clear()}}}P.instances=new Map,P.isGlobalListenerInitialized=!1;const T="https://www.linkedin.com/voyager/api";async function $({csrfToken:e,cookies:t}){const n=`${T}/me`,i=K(e,t);return fetch(n,{method:"GET",headers:i}).then(async e=>e.ok?e.json():null).catch(e=>(console.error(e),null))}function K(e,t){const n={"csrf-token":e};if(t){let e="";e="string"==typeof t?t:Object.entries(t).map(([e,t])=>`${e}=${t}`).join("; "),e&&(n.Cookie=e)}return n}async function D(e,{csrfToken:t,cookies:n}){const i=`${T}/identity/dash/profiles?q=memberIdentity&memberIdentity=${e}&decorationId=com.linkedin.voyager.dash.deco.identity.profile.FullProfileWithEntities-26`,o=K(t,n);return fetch(i,{method:"GET",headers:o}).then(async e=>{var t;return e.ok&&(null==(t=(await e.json()).elements)?void 0:t[0])||null}).catch(e=>(console.error(e),null))}async function z(e,{csrfToken:t,cookies:n}){let i="";const o="string"==typeof e?{universalName:e}:e,r="universalName"in o;i=r?`?q=universalName&universalName=${o.universalName}`:`/${o.urn}`;const s=`${T}/organization/companies${i}`,a=K(t,n);return fetch(s,{method:"GET",headers:a}).then(async e=>{if(e.ok){const n=await e.json();var t;return r?(null==(t=n.elements)?void 0:t[0])||null:n}return null}).catch(e=>(console.error(e),null))}const H={profilePage:{userPicture:[".pv-top-card__non-self-photo-wrapper img","#recent-activity-top-card img",".pv-top-card__photo-wrapper img",'div[componentkey^="com.linkedin.sdui.profile.card"] div[data-view-name="profile-top-card-member-photo"] img'],userName:['a[href^="/in"] h1',"#recent-activity-top-card h3",'div[data-view-name="profile-top-card-verified-badge"] div[role="button"]'],userOccupation:[".artdeco-entity-lockup .artdeco-entity-lockup__subtitle","#recent-activity-top-card h4"],linkedinProfileCard:[".scaffold-layout__main .artdeco-card:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"]'],privateProfileInfoSection:[".pv-profile-info-section"],howToContainer:["#profile-content, header#global-nav"],companyName:[".top-card-background-hero-image+div .mt2 ul>li span",'div[componentkey^="com.linkedin.sdui.profile.card"] div:has(div[data-view-name="profile-top-card-verified-badge"]) + div div[role="button"] p'],companyLogo:[".top-card-background-hero-image+div .mt2 ul>li img"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],location:["#profile-content .artdeco-card .top-card-background-hero-image+div .text-body-small.inline.t-black--light"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],mainExperienceContainer:[".artdeco-card:has(#experience) li:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div > div'],experienceCompanyLogo:['[data-field="experience_company_logo"] img','div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div figure[data-view-name="image"] img'],experienceCompanyName:['div:has([data-field="experience_company_logo"])+div .t-normal span:not(.visually-hidden)'],experienceOccupation:['div:has([data-field="experience_company_logo"])+div .t-bold span:not(.visually-hidden)'],experienceMultipleCompany:["li:has([data-view-name=profile-component-entity] .pvs-entity__sub-components .pvs-entity__sub-components) .t-bold span:not(.visually-hidden)"],experienceMultipleOccupation:['[data-view-name="profile-component-entity"] li:first-child .t-bold span:not(.visually-hidden)']},salesNavProfilePage:{profileCardSection:["#profile-card-section"],userName:['#profile-card-section [data-anonymize="person-name"]'],userPicture:['#profile-card-section img[data-anonymize="headshot-photo"]'],userOccupation:['#profile-card-section [data-anonymize="headline"]'],profileUrl:['#profile-card-section a[href^="/sales/lead"]'],linkedinProfileCard:["#profile-card-section"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],location:["#profile-card-section>section>div>div:last-child div:has(svg)"],companyName:['#profile-card-section a[data-anonymize="company-name"]'],companyLogo:['#profile-card-section img[data-anonymize="company-logo"]'],moreInfoButton:["#profile-card-section section[data-x--lead-actions-bar] button[data-x--lead-actions-bar-overflow-menu]",'#profile-card-section button[aria-label="Open actions overflow menu"]'],linkedinProfileLinkButton:['#hue-web-menu-outlet a[href^="https://www.linkedin.com/in/"]'],mainExperienceContainer:['[data-sn-view-name="feature-lead-experience"]'],experienceCompanyLogo:['li:first-child img[data-anonymize="company-logo"]'],experienceCompanyName:['li:first-child [data-anonymize="company-name"]'],experienceOccupation:['li:first-child [data-anonymize="job-title"]'],experienceMultipleOccupation:['ul li ul li:first-child [data-anonymize="job-title"]','ul li [data-anonymize="job-title"]'],experienceMultipleCompany:['li:first-child [data-anonymize="company-name"]']},searchPeoplePage:{searchEntityResult:['[data-view-name="search-entity-result-universal-template"]'],linkedinUrl:['a[data-test-app-aware-link][href^="https://www.linkedin.com/in/"]','a[data-view-name="search-result-lockup-title"]'],image:[".presence-entity img","a>div>div>figure>img"],userOccupation:['p:has(a[data-view-name="search-result-lockup-title"]) + p',".entity-result__primary-subtitle",".entity-result__divider > div div:nth-child(2)","div>div>div:nth-child(2)>div>div:nth-child(2)","figure + div p:nth-child(2)"],fullName:[".entity-result__title-text a span>span",".entity-result__title-line a span>span",".entity-result__title-line span>a>span>span","a:has(+.entity-result__badge)>span>span",".linked-area div:nth-child(2) > div:first-child > div.t-roman.t-sans a",'a[data-view-name="search-result-lockup-title"]'],resultList:[".search-results-container>div:has(.reusable-search__result-container)"],actionsDiv:[".entity-result__actions",".linked-area > div > div:last-child","div:has(figure) > div:last-child"],validResult:["[data-chameleon-result-urn] , .reusable-search__result-container"],searchResult:[".search-results-container li:has(>[data-chameleon-result-urn])",'[data-view-name="people-search-result"]'],searchResultsContainer:[".search-results-container",'[role="main"] div:has(>hr[role="presentation"])'],mainLayoutLeft:[".search-marvel-srp",'[role="main"] div:has(hr)>div>div'],howToContainer:[".hasLegacyFeedLineHeight div:has(main)",".authentication-outlet"]},searchAllPage:{peopleButton:["nav ul.search-reusables__filter-list>li>button"],toolbar:[".scaffold-layout-toolbar"]}};function G(e,t,n){switch(n){case"all":const n=e.querySelectorAll(t);return n.length>0?Array.from(n):null;case"closest":return e instanceof HTMLElement?e.closest(t):null;default:return e.querySelector(t)}}function V({page:e,key:t,selector:n,container:i,mode:o}){null!=i||(i=document);const r=e&&t?function({page:e,key:t}){return H[e][t]}({page:e,key:t}):[n];for(const e of r){const t=G(i,e,o);if(t)return t}return null}function B(e){if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value.trim()}function W(){var e,t,n,i,o,r,s;const a=window.location.href.includes("linkedin.com/sales")?"salesNavProfilePage":"profilePage";function l(e){return V({page:a,key:e,container:document})}const c=null==(e=l("userName"))?void 0:e.innerText;if(!c)return console.error("extractUserInfos: no userName found"),{};const u=null==(t=l("userPicture"))?void 0:t.src,d=null==(n=l("userOccupation"))?void 0:n.innerHTML,h=null==(i=l("companyName"))?void 0:i.innerText,m=null==(o=l("companyLogo"))?void 0:o.src,p=null==(r=l("location"))?void 0:r.innerText;let g;return"salesNavProfilePage"===a&&(g=/linkedin\.com\/sales\/lead/i.test(window.location.href)?window.location.href:null==(s=l("profileUrl"))?void 0:s.href),{name:B(c),profileUrl:g,picture:u,occupation:B(d),companyName:h,companyPicture:m,location:p}}function Y(e){return/^https?:\/\/(www|.{2})\.linkedin\.com/.test(e)}const F={"":0,chrome:1,"chrome-extension":2,"view-source":3,ftp:4,file:5,data:6,blob:7,about:8};function X(e=""){let t="";const n=e.split("#")[0].toLocaleLowerCase();return/^https\:\/\/(www|.{2})\.linkedin\.com\/in\/[^/?]+(\/recent-activity\/|\/details\/|\/overlay\/|\/?\?[^/]*|\/?$)/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/people\/(.+?),/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/(profile|lead)\/([^,]{39}),/.test(n)?t="profile":n.includes("linkedin.com/feed")?t="feed":n.includes("linkedin.com/posts/")?t="post":n.includes("linkedin.com/login")||n.includes("linkedin.com/checkpoint")||n.includes("linkedin.com/authwall")?t="login":n.includes("linkedin.com/company/")?t="company":n.includes("linkedin.com/messaging/thread/")?t="messages":n.includes("linkedin.com/search/results/people/?")||n.includes("linkedin.com/sales/search/people")?t="search-people":n.includes("linkedin.com/search/results/all")?t="search-all":n.includes("linkedin.com/mynetwork/")&&(t="connections"),t}function J(e=""){var t;const n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/in\/([^?/]+)/)||[])[1]||(e.match(/linkedin\.com\/sales\/people\/(.+?),/)||[])[1]||(e.match(/linkedin\.com\/sales\/(?:profile|lead)\/([^,]{39}),/)||[])[1]||"";return decodeURIComponent(n)}function q(e=""){var t;const n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/posts\/([^\/]+)\//)||[])[1]||"";return decodeURIComponent(n)}function Q(e=""){var t;const n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/company\/([^?/]+)/)||[])[1]||"";return decodeURIComponent(n)}function Z(e=""){var t;return J(e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL)||Q(e)||""}function ee(e=""){if(!e)return"";const t=Object.keys(F),n=new URL(e).protocol.replace(":","");return t.includes(n)?n:X(e)}var te,ne;function ie(e){if(!e)return;const t=e.match(/:(\d+)$/);return t?t[1]:void 0}function oe(e){if(!e)return;const t=e.match(/,(\d+)\)$/);return t?t[1]:void 0}function re(e){if(null!=e&&e.year)return{year:e.year,month:e.month}}function se(e,t,n){if(!e||0===Object.keys(e).length)return n||"";if(t&&e[t])return e[t];const i=Object.keys(e),o=i.find(e=>e.startsWith("en"));return o?e[o]:e[i[0]]||n||""}function ae(e,t){if(!e||!t)return{};const n={};for(const[i,o]of Object.entries(e))i!==t&&o&&(n[i]=o);return n}function le(e){return ce(e)}function ce(e){var t,n,i;if(!e)return;const o=(e.rootUrl&&e.artifacts?e:null)||e.vectorImage||(null==(t=e.image)?void 0:t["com.linkedin.common.VectorImage"])||e["com.linkedin.common.VectorImage"]||(null==(n=e.displayImageReference)?void 0:n.vectorImage);if(null==o||!o.rootUrl||null==o||null==(i=o.artifacts)||!i.length)return;const r=o.artifacts,s=r.reduce((e,t)=>((null==t?void 0:t.width)||0)>((null==e?void 0:e.width)||0)?t:e,r[0]);return null!=s&&s.fileIdentifyingUrlPathSegment?o.rootUrl+s.fileIdentifyingUrlPathSegment:void 0}function ue(e){var t,n,i,o,r,s,a,l;const c=ie(e.objectUrn);if(!c)throw new Error("Cannot extract memberId from rawProfile");const u=function(e){if(e)return`${e.language}_${e.country}`}(e.primaryLocale),d=function(e){if(null!=e&&e.length)return e.map(e=>`${e.language}_${e.country}`)}(e.supportedLocales),h=se(e.multiLocaleFirstName,u,e.firstName),m=se(e.multiLocaleLastName,u,e.lastName),p=se(e.multiLocaleHeadline,u,e.headline),g=se(e.multiLocaleSummary,u,e.summary),f={},y=(null==d?void 0:d.filter(e=>e!==u))||[];for(const t of y){var v,w,b,k;const n={},i=null==(v=e.multiLocaleFirstName)?void 0:v[t],o=null==(w=e.multiLocaleLastName)?void 0:w[t],r=null==(b=e.multiLocaleHeadline)?void 0:b[t],s=null==(k=e.multiLocaleSummary)?void 0:k[t];i&&(n.firstName=i),o&&(n.lastName=o),r&&(n.headline=r),s&&(n.summary=s),Object.keys(n).length>0&&(f[t]=n)}const S=(null==(t=e.profileSkills)||null==(t=t.elements)?void 0:t.map(e=>e.name))||[],C=(null==(n=e.profileLanguages)||null==(n=n.elements)?void 0:n.map(e=>({name:e.name,proficiency:e.proficiency})))||[],L=(null==(i=e.profileHonors)||null==(i=i.elements)?void 0:i.map(e=>({title:e.title,issuer:e.issuer,issuedOn:re(e.issuedOn)})))||[],I=(null==(o=e.profileEducations)||null==(o=o.elements)?void 0:o.map(e=>{var t,n,i;return{school:se(e.multiLocaleSchoolName,u,e.schoolName||(null==(t=e.school)?void 0:t.name)),degree:se(e.multiLocaleDegreeName,u,e.degreeName)||void 0,fieldOfStudy:se(e.multiLocaleFieldOfStudy,u,e.fieldOfStudy)||void 0,startDate:re(null==(n=e.dateRange)?void 0:n.start),endDate:re(null==(i=e.dateRange)?void 0:i.end)}}))||[],O=(null==(r=e.profileCertifications)||null==(r=r.elements)?void 0:r.map(e=>{var t,n;return{name:se(e.multiLocaleName,u,e.name),authority:se(e.multiLocaleAuthority,u,e.authority)||void 0,startDate:re(null==(t=e.dateRange)?void 0:t.start),endDate:re(null==(n=e.dateRange)?void 0:n.end),licenseNumber:e.licenseNumber,url:e.url}}))||[],N=[];null==(s=e.profilePositionGroups)||null==(s=s.elements)||s.forEach(e=>{var t;((null==(t=e.profilePositionInPositionGroup)?void 0:t.elements)||[]).forEach(t=>{var n,i,o,r;const s=t.company||e.company,a=ie(t.companyUrn||(null==s?void 0:s.entityUrn)),l=se(t.multiLocaleTitle,u,t.title),c=se(t.multiLocaleCompanyName,u,t.companyName||(null==s?void 0:s.name)),d=se(t.multiLocaleDescription,u,t.description)||void 0,h={};for(const e of y){var m,p,g;const n={},i=null==(m=t.multiLocaleTitle)?void 0:m[e],o=null==(p=t.multiLocaleDescription)?void 0:p[e],r=null==(g=t.multiLocaleCompanyName)?void 0:g[e];i&&(n.title=i),o&&(n.description=o),r&&(n.companyName=r),Object.keys(n).length>0&&(h[e]=n)}let f;if(null!=s&&s.industry&&null!=s&&null!=(n=s.industryUrns)&&n.length){const e=s.industry[s.industryUrns[0]];f=null==e?void 0:e.name}N.push({linkedinPositionId:oe(t.entityUrn),companyName:c,companyLinkedinId:a,companyUniversalName:null==s?void 0:s.universalName,title:l,description:d,startDate:re(null==(i=t.dateRange)?void 0:i.start),endDate:re(null==(o=t.dateRange)?void 0:o.end),isCurrent:!(null!=(r=t.dateRange)&&r.end),companyLogoUrl:le(null==s?void 0:s.logo),companyIndustry:f,companyEmployeeCountRange:null!=s&&s.employeeCountRange?{start:s.employeeCountRange.start,end:s.employeeCountRange.end}:void 0,translations:Object.keys(h).length>0?h:void 0})})});const E=(null==(a=e.geoLocation)||null==(a=a.geo)?void 0:a.defaultLocalizedName)||void 0,P=null==(l=e.industry)?void 0:l.name;return{memberId:c,publicIdentifier:e.publicIdentifier,firstName:h,lastName:m,headline:p||void 0,summary:g||void 0,location:E,pictureUrl:(x=e.profilePicture,ce(x)),backgroundPictureUrl:(M=e.backgroundPicture,ce(M)),isPremium:!0===e.premium,industry:P,primaryLocale:u,supportedLocales:d,skills:S,languages:C.length>0?C:void 0,honors:L.length>0?L:void 0,educations:I.length>0?I:void 0,certifications:O.length>0?O:void 0,positions:N.length>0?N:void 0,translations:Object.keys(f).length>0?f:void 0};var M,x}function de(e){var t;const n=new Map;return null==(t=e.profilePositionGroups)||null==(t=t.elements)||t.forEach(e=>{var t;[e.company,...(null==(t=e.profilePositionInPositionGroup)||null==(t=t.elements)?void 0:t.map(e=>e.company))||[]].filter(Boolean).forEach(e=>{var t;const i=ie(e.entityUrn);if(!i||n.has(i))return;let o;if(e.industry&&null!=(t=e.industryUrns)&&t.length){const t=e.industry[e.industryUrns[0]];o=null==t?void 0:t.name}n.set(i,{linkedinId:i,universalName:e.universalName,name:e.name||"",industry:o,employeeCountRange:e.employeeCountRange?{start:e.employeeCountRange.start,end:e.employeeCountRange.end}:void 0,logoUrl:le(e.logo)})})}),Array.from(n.values())}function he(e){var t,n,i,o,r,s,a,l,c,u;const d=(null==(t=e.elements)?void 0:t[0])||e,h=ie(d.entityUrn);if(!h)throw new Error("Cannot extract linkedinId from company data");const m=(null!=(n=d.defaultLocale)&&n.language&&null!=(i=d.defaultLocale)&&i.country?`${d.defaultLocale.language}_${d.defaultLocale.country}`:null)||(null!=(o=d.multiLocaleNames)&&o.localized?Object.keys(d.multiLocaleNames.localized)[0]:null)||"en_US",p=null==(r=d.multiLocaleNames)?void 0:r.localized,g=se(p,m,d.name),f=null==(s=d.multiLocaleDescriptions)?void 0:s.localized,y=se(f,m,"string"==typeof d.description?d.description:void 0)||void 0,v={},w=ae(p,m),b=ae(f,m),k=new Set([...Object.keys(w),...Object.keys(b)]);for(const e of k){const t={};w[e]&&(t.name=w[e]),b[e]&&(t.description=b[e]),Object.keys(t).length>0&&(v[e]=t)}const S=d.headquarter||(null==(a=d.confirmedLocations)?void 0:a.find(e=>e.headquarter)),C=ce(d.logo)||ce(null==(l=d.logos)?void 0:l.logo),L=ce(d.backgroundCoverImage),I=d.jobSearchPageUrl||void 0,O=null==(c=d.companyIndustries)||null==(c=c[0])?void 0:c.localizedName,N=k.size>0?[m,...Array.from(k)]:void 0;return{linkedinId:h,universalName:d.universalName,name:g,description:y,industry:O,employeeCountRange:d.staffCount?{start:d.staffCount,end:d.staffCount}:d.staffCountRange?{start:d.staffCountRange.start,end:d.staffCountRange.end}:void 0,headquarters:S?{country:S.country,city:S.city,geographicArea:S.geographicArea,postalCode:S.postalCode,line1:S.line1}:void 0,logoUrl:C,backgroundCoverUrl:L,specialities:d.specialities,companyType:d.type,foundedYear:null==(u=d.foundedOn)?void 0:u.year,websiteUrl:d.companyPageUrl,jobSearchPageUrl:I,primaryLocale:m,supportedLocales:N,translations:Object.keys(v).length>0?v:void 0}}!function(e){e.PUBLIC="public",e.MANUAL="manual",e.APOLLO="apollo",e.LUSHA="lusha",e.HUNTER="hunter",e.ROCKETREACH="rocketreach",e.SNOV="snov",e.CLEARBIT="clearbit"}(te||(te={})),function(e){e.EMAIL="email",e.PHONE="phone",e.BOTH="both"}(ne||(ne={}));export{P as ChromeStore,te as ContactInfoSource,N as Draggable,v as MemoryStore,ne as QueryType,e as RealUndefined,E as WebStore,g as cacheWrapper,r as cloneDeep,l as createDefaultObject,b as createElement,R as createMessageBus,C as createSvg,L as createSvgFromUrl,s as debounce,x as decodeJWT,a as delayExecution,de as extractCompaniesFromRawProfile,o as generateStableUniqueKey,Q as getCompanyPublicId,W as getContactInfo,U as getCookie,j as getCookies,V as getElement,_ as getExtensionInfo,i as getGlobal,z as getLinkedinCompany,$ as getLinkedinMe,X as getLinkedinPageType,D as getLinkedinProfile,Z as getLinkedinPublicId,ee as getPageType,q as getPostPublicId,J as getProfilePublicId,t as isCloneable,c as isEqual,A as isErrorResponse,Y as isLinkedInUrl,n as isPrimitive,M as launchWebAuthFlow,F as pageTypeMap,I as scrollToBottom,O as scrollToBottomIfNeeded,f as singleExecutionWrapper,he as transformRawCompany,ue as transformRawProfile};
2
2
  //# sourceMappingURL=index.modern.js.map