var e=Object.defineProperty,t=(t,n,o)=>(((t,n,o)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o})(t,"symbol"!=typeof n?n+"":n,o),o);import{r as n,O as o}from"./config-87e06c07.js";import{g as l}from"./common-41a4cac1.js";class c{constructor(){t(this,"rules",n),t(this,"queueSetting",o)}async checkRules(){try{const e=await l();e.config&&e.config.rules?this.rules=e.config.rules:this.rules=n}catch(e){console.error(e),this.rules=n}}async checkQueueSetting(){try{const e=await l();e.config&&e.config.queueSetting?this.queueSetting=e.config.queueSetting:this.queueSetting=o}catch(e){console.error(e),this.queueSetting=o}}async getQueueSetting(){return await this.checkQueueSetting(),this.queueSetting}async getRule(){await this.checkRules();const e=window.location.href,t=this.rules.specificRules,n=this.rules.globalRules;const o=t.filter((t=>t.pattern.some((t=>new RegExp(t).test(e)))))[0]||{injectStyles:{},containerSelector:[],inlineSelectors:[],blockSelectors:[],forceBlockSelectors:[],forceInlineSelectors:[],noIncludeSelectors:[],noTranslateSelectors:[],textCount:4,wordCount:2};return{textCount:4,wordCount:2,blackList:[...n.blackList??[],...o.blackList??[]],injectStyles:{...n.injectStyles??{},...o.injectStyles??{}},containerSelector:[...n.containerSelector??[],...o.containerSelector??[]],inlineSelectors:[...(null==n?void 0:n.inlineSelectors)??[],...o.inlineSelectors??[]],blockSelectors:[...n.blockSelectors??[],...o.blockSelectors??[]],noIncludeSelectors:[...n.noIncludeSelectors??[],...o.noIncludeSelectors??[]],noTranslateSelectors:[...n.noTranslateSelectors??[],...o.noTranslateSelectors??[]],forceBlockSelectors:[...o.forceBlockSelectors??[]],forceInlineSelectors:[...o.forceInlineSelectors??[]],ignoreImageSize:o.ignoreImageSize,removeInnerNewlinesAndMultipleSpaces:o.removeInnerNewlinesAndMultipleSpaces??!1,justContainer:o.justContainer??!1,shouldTranslateBlock:[...o.shouldTranslateBlock??[]],shouldTranslateInline:[...o.shouldTranslateInline??[]]}}}export{c as R};
