import{r as e}from"./chunk-DpFlLKUR.js";var t=`xyxp_yuxiaopu_enabled`;async function n(){try{return(await chrome.storage.local.get(t))[t]===!0}catch{return!1}}async function r(e){await chrome.storage.local.set({[t]:e})}var i=e({GOOFISH_CONSUMER_PUBLISH_URL:()=>o,GOOFISH_PUBLISH_URL:()=>GOOFISH_PUBLISH_URL,GOOFISH_SELLER_PUBLISH_URL:()=>s,LAST_PUBLISH_TARGET_STORAGE_KEY:()=>u,PUBLISH_AUTO_CLICK_SUBMIT_STORAGE_KEY:()=>m,PUBLISH_AUTO_FILL_STORAGE_KEY:()=>d,PUBLISH_PANEL_STORAGE_KEY:()=>a,PUBLISH_PREFILL_STORAGE_KEY:()=>C,XIANGUANJIA_BATCH_SUBMIT_MODE_STORAGE_KEY:()=>XIANGUANJIA_BATCH_SUBMIT_MODE_STORAGE_KEY,XIANGUANJIA_HOME_URL:()=>l,XIANGUANJIA_PUBLISH_URL:()=>c,goofishPublishSurfaceForTarget:()=>b,isPublishTarget:()=>S,isXianguanjiaBatchSubmitMode:()=>y,loadPublishAutoClickSubmitEnabled:()=>h,loadPublishAutoFillEnabled:()=>f,openGoofishPublishFromSettings:()=>E,openPublishWithSelectedItem:()=>T,openXianguanjiaPublishFromSettings:()=>D,publishUrlForTarget:()=>x,resolveGoofishPublishAutoFillEnabled:()=>_,resolveGoofishPublishTarget:()=>v,saveLastPublishTarget:()=>w,savePublishAutoClickSubmitEnabled:()=>g,savePublishAutoFillEnabled:()=>p}),a=`xyxp_publish_panel`,o=`https://www.goofish.com/publish`,s=`https://seller.goofish.com/?site=COMMONPRO#/seller-item/publish`,c=`https://www.goofish.pro/sale/product/add`,l=`https://www.goofish.pro`,u=`xyxp_last_publish_target`,d=`xyxp_publish_auto_fill`;async function f(){try{return(await chrome.storage.local.get(d))[d]===!0}catch{return!1}}async function p(e){await chrome.storage.local.set({[d]:e})}var m=`xyxp_publish_auto_click_submit`;async function h(){try{return(await chrome.storage.local.get(m))[m]===!0}catch{return!1}}async function g(e){await chrome.storage.local.set({[m]:e})}async function _(){let[e,t]=await Promise.all([f(),h()]);return e||t}async function v(){return await n()?`goofish_seller`:`goofish_official`}function y(e){return e===`none`||e===`publish_now`||e===`draft`||e===`pending`}function b(e){if(e===`goofish_seller`)return`seller`;if(e===`goofish_official`)return`consumer`}function x(e){return e===`xianguanjia`?c:e===`goofish_seller`?s:o}function S(e){return e===`goofish_official`||e===`goofish_seller`||e===`xianguanjia`}var C=`xyxp_publish_prefill`;async function w(e){await chrome.storage.local.set({[u]:e})}async function T(e,t=`goofish_official`,n){await w(t);let r=await chrome.runtime.sendMessage({type:`OPEN_GOOFISH_PUBLISH_TAB`,payload:{selectedId:e,target:t,autoFill:n?.autoFill===!0}});if(!r?.ok)throw Error(r?.error??`打开发布页失败`)}async function E(e){let[t,n]=await Promise.all([v(),_()]);return await T(e,t,{autoFill:n}),{target:t,autoFill:n}}async function D(e){let t=await f();return await T(e,`xianguanjia`,{autoFill:t}),{autoFill:t}}export{r as _,S as a,f as c,D as d,i as f,n as g,p as h,b as i,E as l,g as m,C as n,y as o,x as p,l as r,h as s,a as t,T as u};