1import{i as e,t}from"./jquery-CY-EeEkZ.js";import{n}from"./ModuleRegistry-1bH4USOv.js";import{n as r,r as i,t as a}from"./Initializer-CLMa7aWV.js";var o=e(t()),s=class extends i{constructor(...e){super(...e),this.name=`LocalStorage`,this._isAvailable=null}get source(){return localStorage}get isAvailable(){if(this._isAvailable!==null)return this._isAvailable;if(this.source===void 0)return this._isAvailable=!1,!1;try{let e=`__storage_test__`;return this.source.setItem(e,`test`),this.source.removeItem(e),this._isAvailable=!0,!0}catch(e){return this._isAvailable=!1,!1}}get(e){if(!this.isAvailable)return e.val;let t=this.source.getItem(e.key);if(t===null)return e.val;switch(e.type){case`number`:return Number(t);case`boolean`:return t===`true`;case`object`:try{return JSON.parse(t)}catch(n){return console.error(`Failed to parse ${this.name} key "${e.key}" with value "${t}" as JSON.`,n),e.val}}return t}set(e,t){if(!this.isAvailable){console.warn(`Cannot set ${this.name} key "${e.key}" because ${this.name} is not available.`);return}if(e.type==`boolean`&&typeof t!=`boolean`&&(t=t===`true`),e.type==`number`&&typeof t!=`number`&&(t=Number(t)),t===e.val){this.source.removeItem(e.key);return}t=e.type==`object`?JSON.stringify(t):String(t),this.source.setItem(e.key,t)}},c,l=class e extends r{static get instance(){return this._instance||(this._instance=new e),this._instance}constructor(){if(super(),this.provider=new s,this.Debug=!1,this.Site={NewsID:0,Events:!0,TimeSwitch:!1},this.Theme={Main:`hexagon`,Extra:`hexagon`,Palette:`default`,Font:`Verdana`,Navbar:`top`,Gestures:!1,StickyHeader:!1,Logo:`pride`},this.Posts={ShowPostChildren:!1,Set:0,WikiExcerpt:1,Fullscreen:!1,CornerRibbons:!0,StickySearch:!1,SkipVariants:!1,Contain:!1,Size:`m`,Notes:!0,HoverText:`long`,TagPreview:!0,Recommendations:`artist`,AutocompleteCache:!0,VideoPlayer:`custom`,Video:{Volume:.25,Muted:!1,PlaybackRate:1},TagScript:{ID:1,Content:``}},this.Blacklist={Collapsed:!0,AnonymousBlacklist:`[]`,FilterState:new Set},this.Users={StaffStats:!1,StaffNotes:!1,StaffWikis:!1},this.Raw={getObject:e=>{if(!this.provider.isAvailable)return null;let t=localStorage[e];if(!t)return null;try{return JSON.parse(t)}catch(n){return console.error(`Failed to parse localStorage key "${e}" with value "${t}" as JSON.`,n),null}},putObject:(e,t)=>{this.provider.isAvailable&&(localStorage[e]=JSON.stringify(t))}},e._instance)throw Error(`LStorage is a singleton class. Use LStorage.instance to access the instance.`);if(!this.provider.isAvailable){console.warn(`LocalStorage is not available. Settings will not be persisted.`);return}a.perform(this,u,this.provider),this.initializeDebugOverride(),this.initializeTagScriptOverride(),this.initializeBlacklistOverride(),this.initializeFilterStateOverride()}initializeDebugOverride(){Object.defineProperty(this,"Debug",{get:function(){return this.provider.get({key:`e6.debug`,val:!1,type:`boolean`})},set:function(e){this.provider.set({key:`e6.debug`,val:!1,type:`boolean`},e),n.setEnabled(!!e)}})}initializeTagScriptOverride(){Object.defineProperty(this.Posts.TagScript,"Content",{get:()=>{let e=this.Posts.TagScript.ID;return e&&localStorage.getItem(`tag-script-${e}`)||``},set:e=>{let t=this.Posts.TagScript.ID;t&&(e===``?localStorage.removeItem(`tag-script-${t}`):localStorage.setItem(`tag-script-${t}`,e))}})}initializeBlacklistOverride(){let e;Object.defineProperty(this.Blacklist,"AnonymousBlacklist",{get:function(){if(e!==void 0)return e;let t=localStorage.getItem(`anonymous-blacklist`);if(!t){let e=(0,o.default)(`meta[name=blacklisted-tags]`);t=e.length==0?`[]`:e.attr(`content`)||`[]`,localStorage.setItem(`anonymous-blacklist`,t)}return e=t,e},set:function(t){e=t,localStorage.setItem(`anonymous-blacklist`,t)}})}initializeFilterStateOverride(){Object.defineProperty(this.Blacklist,"FilterState",{get:()=>{if(this.filterStateCache)return this.filterStateCache;try{this.filterStateCache=new Set(JSON.parse(localStorage.getItem(`e6.blk.filters`)||`[]`))}catch(e){console.error(e),localStorage.removeItem(`e6.blk.filters`),this.filterStateCache=new Set}return this.patchBlacklistFunctions(),this.filterStateCache},set:e=>{if(!e.size){this.filterStateCache=new Set,localStorage.removeItem(`e6.blk.filters`),this.patchBlacklistFunctions();return}this.filterStateCache=e,localStorage.setItem(`e6.blk.filters`,JSON.stringify([...e])),this.patchBlacklistFunctions()}})}patchBlacklistFunctions(){this.filterStateCache.add=function(e){return Set.prototype.add.apply(this,[e]),localStorage.setItem(`e6.blk.filters`,JSON.stringify([...this])),this},this.filterStateCache.delete=function(e){return Set.prototype.delete.apply(this,[e]),this.size==0?localStorage.removeItem(`e6.blk.filters`):localStorage.setItem(`e6.blk.filters`,JSON.stringify([...this])),this},this.filterStateCache.clear=function(){return Set.prototype.clear.apply(this),localStorage.removeItem(`e6.blk.filters`),this}}};c=l,c._instance=null;var u={Site:{NewsID:`hide_news_notice`,Events:`e6.events`,TimeSwitch:`e6.timeswitch`},Theme:{Main:`theme`,Extra:`theme-extra`,Palette:`theme-palette`,Font:`theme-font`,Navbar:`theme-nav`,Gestures:`emg`,StickyHeader:`theme-sheader`,Logo:`theme-logo`},Posts:{ShowPostChildren:`show-relationship-previews`,Set:`set`,WikiExcerpt:`e6.posts.wiki`,Fullscreen:`e
16.posts.fusk`,CornerRibbons:`e6.posts.cribbons`,StickySearch:`e6.posts.ssearch`,SkipVariants:`e6.posts.scvideos`,Contain:`e6.posts.contain`,Size:`e6.posts.size`,Notes:`e6.posts.notes`,HoverText:`e6.posts.hovertext`,TagPreview:`e6.posts.tagpreview`,Recommendations:`e6.posts.recommended.type`,AutocompleteCache:`e6.posts.acache`,VideoPlayer:`e6.posts.video_player`,Video:{Volume:`e6.posts.video.volume`,Muted:`e6.posts.video.muted`,PlaybackRate:`e6.posts.video.playback_rate`},TagScript:{ID:`current_tag_script_id`,Content:null}},Blacklist:{Collapsed:`e6.blk.collapsed`,AnonymousBlacklist:null,FilterState:null},Users:{StaffStats:`e6.users.staffstats`,StaffNotes:`e6.users.staffnotes`,StaffWikis:`e6.users.staffwikis`},Raw:null},d=l.instance;export{s as n,d as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.