`,e);const s=Player.threads.displayThreads[t];for(let t=0;t',e)}}catch(e){Player.logError("Unable to display the threads board view.",e,"warning"),Player.set("threadsViewStyle","table"),Player.renderThreads()}else n.elementHTML(Player.$(`.${ns}-threads-body`),Player.threads.listsTemplate())},renderBoards(){n.elementHTML(Player.$(`.${ns}-thread-board-list`),Player.threads.boardsTemplate())},toggle(){"threads"===Player.config.viewStyle?Player.playlist.restore():Player.display.setViewStyle("threads")},toggleBoardList(){Player.threads.showAllBoards=!Player.threads.showAllBoards,Player.$(`.${ns}-all-boards-link`).innerHTML=Player.threads.showAllBoards?"Selected Only":"Show All",Player.threads.renderBoards()},async toggleBoard(e,t){t?!Player.threads.selectedBoards.includes(e)&&Player.threads.selectedBoards.unshift(e):Player.threads.selectedBoards=Player.threads.selectedBoards.filter(t=>t!==e),await GM.setValue("threads_board_selection",Player.threads.selectedBoards.slice(0,10).join(","))},async fetchBoards(e){Player.threads.loading=!0,Player.threads.render(),Player.threads.boardList=(await r("https://a.4cdn.org/boards.json")).boards,e?Player.threads.fetch():(Player.threads.loading=!1,Player.threads.render())},async fetch(){if(Player.threads.loading=!0,Player.threads.render(),!Player.threads.boardList)try{await Player.threads.fetchBoards()}catch(e){return Player.logError("Failed fetching the boards list.",e)}const e=[];try{await Promise.all(Player.threads.selectedBoards.map(async t=>{const a=Player.threads.boardList.find(e=>e.board===t);if(!a)return;(a&&await r("https://a.4cdn.org/%s/catalog.json".replace("%s",t))||[]).forEach(({page:n,threads:r})=>{e.push(...r.map(e=>Object.assign(e,{board:t,page:n,ws_board:a.ws_board})))})})),Player.threads.soundThreads=e.filter(e=>{const{sounds:t}=Player.posts.getSounds(e.filename,`https://i.4cdn.org/${e.board}/${e.tim}${e.ext}`,e.no,`https://i.4cdn.org/${e.board}/${e.tim}s${e.ext}`,e.md5,!0);return t.length})}catch(e){Player.logError("Failed searching for sounds threads.",e)}Player.threads.loading=!1,Player.threads.filter(Player.$(`.${ns}-threads-filter`).value,!0),Player.threads.render()},filter(e,t){e=e.toLowerCase(),Player.threads.filterValue=e||"",null!==Player.threads.soundThreads&&(Player.threads.displayThreads=Player.threads.soundThreads.reduce((t,a)=>((!e||a.sub&&a.sub.toLowerCase().includes(e)||a.com&&a.com.toLowerCase().includes(e))&&(t[a.board]||(t[a.board]=[]),t[a.board].push(a)),t),{}),!t&&Player.threads.renderThreads())}}},706(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},780(e,t,a){function n(e){try{return new URL(e.replace(/%s/,"sound").replace(/^(https?\/\/)?/,"https://")),!0}catch(e){return!1}}e.exports={template:a(8210),fields:{name:"Name",url:"URL",responsePath:"Response Path",responseMatch:"Response Match",soundUrl:"File URL Format"},parse(e,t,a){t={...t};const r=a.currentTarget.closest(`.${ns}-host-input`);let s=r.getAttribute("data-host-name"),l=t[s]={...t[s]};const o=a.currentTarget.getAttribute("name");try{if("name"===o&&e!==s){if(!e||t[e])throw new PlayerError("A unique name for the host is required.","warning");r.setAttribute("data-host-name",e),t[e]=l,delete t[s],s=e}if(("url"===o||"soundUrl"===o&&e)&&!n(e))throw new PlayerError("The value must be a valid URL.","warning");if("data"===o)try{e=JSON.parse(e)}catch(e){throw new PlayerError("The data must be valid JSON.","warning")}if("headers"===o)try{e=e?JSON.parse(e):void 0}catch(e){throw new PlayerError("The headers must be valid JSON.","warning")}}catch(e){throw l.invalid=!0,r.classList.add("invalid"),e}void 0===e?delete l[o]:l[o]=e;try{const e=r.querySelector("[name=soundUrl]").value,t=r.querySelector("[name=headers]").value;!(s&&JSON.parse(r.querySelector("[name=data]").value)&&n(r.querySelector("[name=url]").value))||e&&!n(e)||t&&!JSON.parse(t)||(delete l.invalid,r.classList.remove("invalid"))}catch(e){}return t},add(){let e="",t="New Host";for(;Player.config.uploadHosts[`${t}${e}`];)e=" "+ ++e;const a={[`${t}${e}`]:{invalid:!0,data:{file:"$file"}},...Player.config.uploadHosts};Player.settings.set("uploadHosts",a,{bypassValidation:!0,silent:!0})},remove(e){const t=Player.config.uploadHosts,a=e.currentTarget.closest(`.${ns}-host-input`),n=a.getAttribute("data-host-name");Player.settings.findDefault("uploadHosts").default[n]?t[n]=null:delete t[n],a.parentNode.removeChild(a),Player.settings.set("uploadHosts",t,{bypassValidation:!0,bypassRender:!0})},setDefault(e,t,a){const n=a.currentTarget.closest(`.${ns}-host-input`).getAttribute("data-host-name");return n===Player.config.defaultUploadHost||Object.keys(Player.config.uploadHosts).forEach(e=>{const t=Player.$(`.${ns}-host-input[data-host-name="${e}"] input[data-property="defaultUploadHost"]`);t&&(t.checked=e===n)}),n},restoreDefaults(){Object.assign(Player.config.uploadHosts,Player.settings.findDefault("uploadHosts").default),Player.set("uploadHosts",Player.config.uploadHosts,{bypassValidation:!0})}}},794(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},851(e){e.exports=[{version:"3.0.0",name:"hosts-filename-length",async run(){const e=Player.settings.findDefault("uploadHosts").default;return Object.keys(e).forEach(t=>{Player.config.uploadHosts[t].filenameLength=e[t].filenameLength}),{}}},{version:"3.3.0",name:"sound-name-title-swap",async run(){const e=Player.config,t={};return["headerTemplate","rowTemplate","footerTemplate","chanXTemplate","customCSS"].forEach(a=>{/sound-name/.test(e[a])&&(t[a]=[e[a],e[a]=e[a].replace(/sound-name/g,"sound-title")])}),t}},{version:"3.4.0",name:"disable-inline-player-for-existing-users",run:async()=>(Player.config.playExpandedImages=!1,Player.config.playHoveredImages=!1,{playExpandedImages:[!0,!1],playHoveredImages:[!0,!1]})},{version:"3.4.7",name:"zz-ht-to-zz-fo",async run(){const e=[...Player.config.allow];return Player.config.allow.push("zz.fo"),{allow:[e,Player.config.allow]}}}]},928(e,t,a){var n=a(4302);e.exports=(e={})=>`
\n`).join("")}`},1277(e){e.exports=[{property:"autoshow",default:!0,title:"Autoshow",description:"Automatically show the player when the thread contains sounds.",displayGroup:"Display"},{property:"pauseOnHide",default:!0,title:"Pause On Hide",description:"Pause the player when it's hidden.",displayGroup:"Display",allowInTheme:!0},{property:"showUpdatedNotification",default:!0,title:"Show Update Notifications",description:"Show notifications when the player is successfully updated.",displayGroup:"Display"},{property:"hoverImages",title:"Hover Images",default:!1,allowInTheme:!0},{title:"Controls",displayGroup:"Display",allowInTheme:!0,settings:[{property:"preventControlWrapping",title:"Prevent Wrapping",description:"Hide controls to prevent wrapping when the player is too small",default:!0},{property:"controlsHideOrder",title:"Hide Order",description:'Order controls are hidden in to prevent wrapping. Available controls are
previous
next
seek-bar
time
duration
volume
volume-button
volume-bar
and
fullscreen
.',default:["fullscreen","duration","volume-bar","seek-bar","time","previous"],displayMethod:"textarea",inlineTextarea:!0,format:e=>e.join("\n"),parse:e=>e.split(/\s+/)}]},{title:"Minimised Display",description:"Optional displays for when the player is minimised.",displayGroup:"Display",allowInTheme:!0,settings:[{property:"pip",title:"Thumbnail",description:"Display a fixed thumbnail of the playing sound in the bottom right of the thread.",default:!0},{property:"maxPIPWidth",title:"Max Width",description:"Maximum width for the thumbnail.",default:"150px",updateCSSVars:!0},{property:"chanXControls",title:"4chan X Header Controls",description:"Show playback controls in the 4chan X header. The display can be customised in Settings>Theme.",displayMethod:isChanX||null,default:"closed",options:{always:"Always",closed:"Only with the player closed",never:"Never"}}]},{title:"Thread",displayGroup:"Display",allowInTheme:!0,settings:[{property:"autoScrollThread",description:"Automatically scroll the thread to posts as sounds play.",title:"Auto Scroll",default:!1},{property:"limitPostWidths",description:"Limit the width of posts so they aren't hidden under the player.",title:"Limit Post Widths",default:!0},{property:"minPostWidth",title:"Minimum Width",default:"50%"}]},{property:"threadsViewStyle",title:"Threads View",description:"How threads in the threads view are listed.",settings:[{title:"Display",default:"table",options:{table:"Table",board:"Board"}}]},{title:"Colors",displayGroup:"Display",property:"colors",updateCSSVars:!0,allowInTheme:!0,class:`${ns}-colorpicker-input`,attrs:'@focusout.stop.prevent="colorpicker._updatePreview" @click="colorpicker.create"',displayMethod:({value:e,attrs:t})=>`
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
`,actions:[{title:"Match Theme",handler:"theme.forceBoardTheme",mods:".prevent"}],settings:[{property:"colors.text",default:"#000000",title:"Text"},{property:"colors.background",default:"#d6daf0",title:"Background"},{property:"colors.border",default:"#b7c5d9",title:"Border"},{property:"colors.odd_row",default:"#d6daf0",title:"Odd Row"},{property:"colors.even_row",default:"#b7c5d9",title:"Even Row"},{property:"colors.playing",default:"#98bff7",title:"Playing Row"},{property:"colors.dragging",default:"#c396c8",title:"Dragging Row"},{property:"colors.controls_background",default:"#3f3f44",title:"Controls Background",description:"The controls container element background.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_background")',mods:".prevent"}]},{property:"colors.controls_inactive",default:"#FFFFFF",title:"Control Items",description:"The playback controls and played bar.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_inactive")',mods:".prevent"}]},{property:"colors.controls_active",default:"#00b6f0",title:"Focused Control Items",description:"The control items when hovered.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_active")',mods:".prevent"}]},{property:"colors.controls_empty_bar",default:"#131314",title:"Volume/Seek Bar Background",decscription:"The background of the volume and seek bars.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_empty_bar")',mods:".prevent"}]},{property:"colors.controls_loaded_bar",default:"#5a5a5b",title:"Loaded Bar Background",description:"The loaded bar within the seek bar.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_loaded_bar")',mods:".prevent"}]},{property:"colors.page_background",default:"rgb(238, 242, 255)",displayMethod:null,allowInTheme:!1}]}]},1469(e){e.exports={"Fixed Playlist":{chanXControls:"always",headerTemplate:'\nrepeat-button shuffle-button hover-images-button playlist-button\nsound-title-marquee\nview-menu-button add-button theme-menu-button close-button',rowTemplate:'sound-title\np:{}\n',customCSS:'/* Fix the player to the right at full height (minus the 4chan X header) */\n#fcsp-container[data-view-style="playlist"] {\n\t/* Fixed width *\\/\n\twidth: 25rem !important;/**/\n\theight: auto !important;\n\ttop: $config[offsetTop] !important;\n\tright: 0px !important;\n\tbottom: $config[offsetBottom] !important;\n\tleft: auto !important;\n\theight: auto !important;\n\tmax-height: calc(100% - 24px);\n\tbackground: none !important;\n\tborder: none !important;\n}\n\n/* Hide things when the playlist is open */\n/* Hide the image with the playlist open, unless it\'s a webm.\n * To show gifs as well change playing-video to playing-animated. */\n#fcsp-container[data-view-style="playlist"]:not(.playing-video) .fcsp-image-link,/**/ \n#fcsp-container[data-view-style="playlist"] .fcsp-controls,\n#fcsp-container[data-view-style="playlist"] .fcsp-hover-image,\n#fcsp-container[data-view-style="playlist"] .fcsp-footer,\n#fcsp-container[data-view-style="fullscreen"] .fcsp-row-thumb,\n#fcsp-container[data-view-style="fullscreen"] .fcsp-row-image {\n\tdisplay: none !important;\n}\n/* Header is shown with adjustments to handle the changed container style */\n/* Opacity and absolute position are used to auto hide the header */\n#fcsp-container[data-view-style="playlist"] .fcsp-header {\n\tposition: absolute !important;\n\topacity: 0;\n\tz-index: 9;\n\tcursor: inherit;\n\tbackground: $config[colors.background];\n\tborder-width: 0 1px 1px 0;\n\ttransition: all .3s ease;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-header:hover {\n\topacity: 1;\n}\n\n/* Don\'t show a scrollbar for the playlist for aesthetic reasons */\n#fcsp-container[data-view-style="playlist"] .fcsp-under-image {\n\tscrollbar-width: none;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-under-image::-webkit-scrollbar {\n\tdisplay: none;\n}\n\n/* Chunky playlist items, with no background and a squared thumbnail image. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item {\n\tbackground: none !important;\n\theight: auto !important;\n\tline-height: initial;\n\ttext-align: right;\n\talign-items: center;\n\ttransition: all .5s ease;\n\tfont-size: 1rem;\n\tcolor: $config[colors.text];\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-row-thumb, #fcsp-container[data-view-style="playlist"] .fcsp-row-image {\n\theight: 3rem;\n\twidth: 3rem;\n\tobject-fit: cover;\n\ttransition: all .5s ease;\n}\n/* Show a gradient background and increase the size of list items when you hover over them. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item:hover {\n\tfont-size: 1.5rem;\n\tfont-weight: bold;\n\tbackground-image: radial-gradient(circle at -50%, #0000 70%, $config[colors.odd_row]) !important;\n\tcolor: $config[colors.background];\n\t-webkit-text-stroke: 1px black;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item:hover .fcsp-row-thumb {\n\theight: 4rem;\n\twidth: 4rem;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-row-image {\n\theight: 7rem;\n\twidth: 7rem;\n}\n/* Add a gradient background to the playing item, make the text bigger, and style the text. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item.playing {\n\tbackground-image: radial-gradient(circle at -50%, #0000 70%, $config[colors.playing]) !important;\n\tpadding-left: 2px;\n\tfont-weight: bold;\n\tfont-size: 1.5rem;\n\tcolor: $config[colors.page_background];\n\t-webkit-text-stroke: 1px black;\n\ttext-shadow: 0 0 2px $config[colors.border];\n}\n/* Swap the thumb image with the full image for the playing item. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item:not(.playing) .fcsp-row-image {\n\tdisplay: none;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item.playing .fcsp-row-thumb {\n\tdisplay: none;\n}\n/* Same gradient background style for dragging items. */\n#fcsp-container[data-view-style="playlist"] .fcsp-dragging {\n\tbackground-image: radial-gradient(circle at -50%, #0000 70%, $config[colors.dragging]) !important\n}\n\n/* Add a resizer to the left of the header when the playlist is open. */\n.playlist-resizer {\n\topacity: 1 !important;\n\tmargin: 0 !important;\n\twidth: .25rem !important;\n\theight: auto !important;\n\tbackground-color: $config[colors.border] !important;\n\tposition: absolute;\n\tleft: -.25rem !important;\n\ttop: 0 !important;\n\tbottom: 0 !important;\n\tborder-radius: 100% 0 0 100%;\n\tcursor: ew-resize !important;\n\tdisplay: none;\n\ttransition: all .5s ease;\n}\n.playlist-resizer:hover {\n\twidth: .4rem !important;\n\tleft: -.4rem !important;\n}\n#fcsp-container[data-view-style="playlist"] .playlist-resizer {\n\tdisplay: block;\n}\n/* Hide the default resizers */\n#fcsp-container[data-view-style="playlist"] .fcsp-expander:not(.playlist-resizer) {\n\tdisplay: none;\n}\n'}}},1470(e){e.exports=(e={})=>`
`},1730(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},1733(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},1786(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},1952(){window.ns="fcsp",window.is4chan=location.hostname.includes("4chan.org")||location.hostname.includes("4channel.org"),window.isChanX=document.documentElement&&document.documentElement.classList.contains("fourchan-x"),window.isChanXT=document.documentElement&&document.documentElement.classList.contains("fourchan-xt"),window.Board=location.pathname.split("/")[1],window.Thread=(location.href.match(/\/thread\/(\d+)/)||[])[1],window.Site=is4chan?"4chan":((document.head.querySelector('meta[name="generator"]')||{}).content||"").includes("FoolFuuka")?"FoolFuuka":location.hostname.includes("warosu.org")?"Fuuka":"FoolFuuka";class e extends Error{constructor(e,t,a){super(e),this.reason=e,this.type=t,this.error=a}}window.PlayerError=e},1992(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},2181(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},2189(e){e.exports={atRoot:["togglePlay","play","pause","next","previous","stop","toggleMute","volumeUp","volumeDown"],public:["togglePlay","play","pause","next","previous","stop","toggleMute","volumeUp","volumeDown"],initialize(){Player.controls._audio=Player.audio},togglePlay(){Player.audio.paused?Player.play():Player.pause()},async play(e,{paused:t}={}){try{if("string"==typeof e&&(e=Player.sounds.find(t=>t.id===e)),e||Player.playing||!Player.sounds.length||(e=Player.sounds[0]),e&&e!==Player.playing){Player.playing&&(Player.playing.playing=!1),Player.video.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),Player.audio.removeEventListener("canplaythrough",Player.actions.playOnceLoaded);const t=Player.controls.audioEvents;for(let a in t){(Array.isArray(t[a])?t[a]:[t[a]]).forEach(t=>{const n=Player.getHandler(t);Player.video.removeEventListener(a,n),e.standaloneVideo&&Player.video.addEventListener(a,n)})}e.playing=!0,Player.playing=e,Player.audio.src=e.src,Player.isVideo=e.image.match(/\.(webm|mp4)$/i)||"video/webm"===e.type||"video/mp4"===e.type,Player.isStandalone=e.standaloneVideo,Player.video.loop=!Player.isStandalone,Player.audio=e.standaloneVideo?Player.video:Player.controls._audio,Player.audio._linked=Player.isVideo&&!Player.isStandalone&&Player.video,Player.video._linked=Player.isVideo&&!Player.isStandalone&&Player.audio,Player.container.classList[Player.isVideo?"add":"remove"]("playing-video"),Player.container.classList[Player.isVideo||e.image.endsWith("gif")?"add":"remove"]("playing-animated"),await Player.trigger("playsound",e)}t||(!Player.isStandalone&&Player.isVideo&&(Player.video.readyState<3||Player.audio.readyState<3)?(Player.video.addEventListener("canplaythrough",Player.actions.playOnceLoaded),Player.audio.addEventListener("canplaythrough",Player.actions.playOnceLoaded)):Player.audio.play())}catch(e){Player.logError("There was an error playing the sound. Please check the console for details.",e)}},playOnceLoaded(e){e.currentTarget.readyState>3&&e.currentTarget._linked.readyState>3?(e.currentTarget.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),e.currentTarget._linked.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),e.currentTarget._inlinePlayer&&e.currentTarget._inlinePlayer.pendingControls&&e.currentTarget._inlinePlayer.pendingControls(),e.currentTarget._linked.play(),e.currentTarget.play()):(!e.currentTarget.paused&&e.currentTarget.pause(),!e.currentTarget._linked.paused&&e.currentTarget._linked.pause(),0!==e.currentTarget.currentTime&&(e.currentTarget.currentTime=0),0!==e.currentTarget._linked.currentTime&&(e.currentTarget._linked.currentTime=0))},pause(){Player.audio&&Player.audio.pause()},stop(){Player.audio.src=null,Player.playing=null,Player.isVideo=!1,Player.isStandalone=!1,Player.trigger("stop")},next(e){Player.actions._movePlaying(1,e)},previous(e){const t="number"==typeof Player.config.restartSeconds&&Player.config.restartSeconds;t&&Player.audio.currentTime>t?Player.audio.currentTime=0:Player.actions._movePlaying(-1,e)},_movePlaying(e,{force:t,group:a,paused:n}={}){if(!Player.sounds.length)return;const r=Player.sounds.indexOf(Player.playing);if(-1===r)return Player.play(Player.sounds[0]);let s;if(t||"one"!==Player.config.repeat){let t=r;do{t="all"===Player.config.repeat?(t+e+Player.sounds.length)%Player.sounds.length:t+e,s=Player.sounds[t]}while(a&&s&&t!==r&&(!s.post||s.post===Player.playing.post))}else s=Player.sounds[r];s&&Player.play(s,{paused:n})},volumeUp(){Player.audio.volume=Math.min(Player.audio.volume+.05,1)},volumeDown(){Player.audio.volume=Math.max(Player.audio.volume-.05,0)},toggleMute(){Player.audio.volume=(Player._lastVolume||.5)*!Player.audio.volume}}},2230(e){e.exports=(e={})=>`${Player.tools.createTemplate()}\n${Player.tools.downloadTemplate()}\n\n
Encode / Decode URL
\n
\n\t
\n\t\t\n\t\t\n\t
\n
`},2277(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},2340(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},2345(e){e.exports=[{property:"addWebm",title:"Include Video",description:"Whether to add all video files regardless of a sound filename.",default:"soundBoards",displayGroup:"Filter",options:{always:"Always",soundBoards:"Boards with sound",never:"Never"}},{property:"fatboxRerouter",title:"Fatbox Rerouter",description:"Use fatbox instead of catbox. (Make sure to add fatbox to allowed hosts if missing!)",default:!1,displayGroup:"Filter"},{property:"allow",title:"Allowed Hosts",description:"Which domains sounds are allowed to be loaded from.",default:["4cdn.org","catbox.moe","fatbox.moe","dmca.gripe","lewd.se","pomf.cat","zz.ht","zz.fo"],actions:[{title:"Reset",handler:'settings.reset("allow")',mods:".prevent"}],displayGroup:"Filter",displayMethod:"textarea",attrs:"rows=10",format:e=>e.join("\n"),parse:e=>e.split("\n")},{property:"filters",default:["# Image MD5 or sound URL"],title:"Filters",description:"List of URLs or image MD5s to filter, one per line.\nLines starting with a # will be ignored.",actions:[{title:"Reset",handler:'settings.reset("filters")',mods:".prevent"}],displayGroup:"Filter",displayMethod:"textarea",attrs:"rows=10",format:e=>e.join("\n"),parse:e=>e.split("\n")}]},2473(e,t,a){const n=a(218);e.exports={initialize(){const{top:e,bottom:t}=Player.position.getHeaderOffset();Player.config.offsetTop=e+"px",Player.config.offsetBottom=t+"px",Player.on("show",async function(){const[e,t]=(await GM.getValue("position")||"").split(":"),[a,n]=(await GM.getValue("size")||"").split(":");+a&&+n&&Player.position.resize(a,n,!0),+e&&+t&&Player.position.move(e,t),Player.config.limitPostWidths&&(Player.position.setPostWidths(),window.addEventListener("scroll",Player.position.setPostWidths))}),Player.on("hide",function(){Player.position.setPostWidths(),window.removeEventListener("scroll",Player.position.setPostWidths)}),Player.on("config",e=>{"limitPostWidths"!==e&&"minPostWidth"!==e||(window.removeEventListener("scroll",Player.position.setPostWidths),Player.position.setPostWidths(),Player.config.limitPostWidths&&window.addEventListener("scroll",Player.position.setPostWidths))}),new MutationObserver(function(){document.querySelectorAll("#hoverUI .postContainer, .inline .postContainer, .backlink_container article").forEach(e=>{e.style.maxWidth=null,e.style.minWidth=null})}).observe(document.body,{childList:!0,subtree:!0}),Player.syncTab("position",e=>Player.position.move(...e.split(":").concat(!0))),Player.syncTab("size",e=>Player.position.resize(...e.split(":")))},setPostWidths(){const e=document.documentElement.clientWidth-Player.container.offsetLeft+10,t=!Player.isHidden&&Player.config.limitPostWidths,a=Player.container.offsetTop,r=Player.container.getBoundingClientRect().height+a;document.querySelectorAll(n.limitWidthOf).forEach(n=>{const s=t&&n.getBoundingClientRect(),l=t&&s.top+s.height>a&&s.topdocument.documentElement.clientWidth&&(e.style.left=a.left+a.width-n+"px"),a.top+a.height+r>document.documentElement.clientHeight-Player.position.getHeaderOffset().bottom&&(e.style.top=a.top-r+"px")}}},2475(e,t,a){var n=a(6325);const r=a(218),s=a(5303),l=a(5080);e.exports={public:["switch","next","previous"],savedThemesTemplate:a(6305),themeKeybindsTemplate:a(3038),async initialize(){Player.theme.render(),Player.userTemplate.maintain(Player.theme,"customCSS"),Player.theme.validateOrder();const e=new MutationObserver(n.debounce(()=>Player.theme.applyBoardTheme(),500));e.observe(document.head,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["href","disabled","rel"]}),e.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),e.observe(document.body,{attributes:!0,attributeFilter:["class"]})},render(){Player.userStylesheet=Player.userStylesheet||n.element('',document.head),Player.userStylesheet.innerHTML=Player.userTemplate.build({template:"/* Sounds Player User CSS */\n\n"+Player.config.customCSS,sound:Player.playing,ignoreButtons:!0,ignoreDisplayBlocks:!0,ignoreSoundName:!0,ignoreVersion:!0})},forceBoardTheme(){Player.theme.applyBoardTheme({force:!0}),Player.settings.save()},applyBoardTheme(e={}){const t=n.element(``,document.body),a=document.defaultView.getComputedStyle(t);if("rgba(0, 0, 0, 0)"===a.backgroundColor)return;Object.assign(a,{page_background:window.getComputedStyle(document.body).backgroundColor});const l={"colors.text":a.color,"colors.background":a.backgroundColor,"colors.odd_row":a.backgroundColor,"colors.border":a.borderBottomColor,"colors.even_row":a.borderBottomColor===a.color?a.backgroundColor:a.borderBottomColor,"colors.page_background":window.getComputedStyle(document.body).backgroundColor,"colors.playing":(()=>{const e=Player.colorpicker.rgb2hsv(...Player.colorpicker.parseRGB(a.backgroundColor)),t=Player.colorpicker.hsv2rgb(e[0],Math.min(1,e[1]+.25),Math.min(1,e[2]+.15));return`rgb(${t[0]}, ${t[1]}, ${t[2]})`})()};s.find(e=>"colors"===e.property).settings.forEach(t=>{const a=e.force||t.default===n.get(Player.config,t.property);l[t.property]&&(t.default=l[t.property]),a&&Player.set(t.property,t.default,{bypassSave:!0,bypassRender:!0,bypassStylesheet:!0})}),document.body.removeChild(t),e.bypassRender||(Player.display.updateCSSVars(),Player.settings.render())},next(){const e=["Default"].concat(Player.config.savedThemesOrder),t=e.indexOf(Player.config.selectedTheme),a=e[(t+e.length+1)%e.length];Player.theme.switch(a)},previous(){const e=["Default"].concat(Player.config.savedThemesOrder),t=e.indexOf(Player.config.selectedTheme),a=e[(t+e.length-1)%e.length];Player.theme.switch(a)},switch(e){if("Default"!==e&&!Player.config.savedThemes[e])return Player.logError(`Theme '${e}' does not exist.`,null,"warning");Player.set("selectedTheme",e),"Default"===e?(["headerTemplate","footerTemplate","rowTemplate","chanXTemplate","customCSS"].forEach(e=>{Player.settings.reset(e,{bypassRender:!0,bypassStylesheet:!0})}),Player.settings.render(),Player.display.updateCSSVars()):Player.settings.load(Player.config.savedThemes[e])},validateOrder(){const e=Player.config.savedThemesOrder;let t;Player.config.savedThemesOrder=e.concat(Object.keys(Player.config.savedThemes)).filter((a,n)=>Player.config.savedThemes[a]&&(t=e.indexOf(a),-1===t||t===n))},parseSwitch(e,t,a){t=[...t];const n=a.currentTarget.parentNode.dataset.name;"Default"===n||Player.config.savedThemes[n]||Player.logError(`No theme named '${n}'.`,null,"warning");const r=Player.hotkeys.parseKey(e);if(r.key){let e=t.find(e=>e.themeName===n);e||t.push(e={themeName:n}),Object.assign(e,r)}else t=t.filter(e=>e.themeName!==n);return t},handleSwitch(e){Player.theme.switch(e._binding.themeName)},moveUp:e=>Player.theme._swapOrder(e,-1),moveDown:e=>Player.theme._swapOrder(e,1),_swapOrder(e,t){const a=e.currentTarget.closest("[data-theme]").dataset.theme,n=Player.config.savedThemesOrder,r=n.indexOf(a);r+t>=0&&r+te!==n),a.parentNode.removeChild(a),Player.settings.set("savedThemes",t,{bypassValidation:!0,bypassRender:!0});const r=Player.config.hotkey_bindings.switchTheme.find(e=>e.themeName===n);r&&Player.set("hotkey_bindings.switchTheme",Player.config.hotkey_bindings.switchTheme.splice(r,1),{bypassValidation:!0})},restoreDefaults(){Object.assign(Player.config.savedThemes,Player.settings.findDefault("savedThemes").default),Player.theme.validateOrder(),Player.set("savedThemes",Player.config.savedThemes,{bypassValidation:!0})},showSaveOptions(e){const t=Player.$(`.${ns}-theme-save-options`);if(t)return Player.container.removeChild(t);const a=n.element(l({settingsConfig:s}),Player.container);Player.position.showRelativeTo(a,e.currentTarget),Player.$(`.${ns}-save-theme-name`).focus()},toggleSaveFields(){Player.$(`.${ns}-theme-save-options`).classList.toggle("fields-collapsed"),Player.position.showRelativeTo(Player.$(`.${ns}-theme-save-options`),Player.$('[\\@click^="theme.showSaveOptions"]'))},toggleSaveButtonText(e){Player.$(`.${ns}-save-theme`).innerHTML=Player.config.savedThemes[e.currentTarget.value]?"Update":"Create"},save(){const e=Player.$(`.${ns}-save-theme-name`).value;if(!e)return Player.logError("A name is required to save a theme.",null,"warning");const t=[...Player.$all(`.${ns}-theme-save-options input:checked`)].reduce((e,t)=>n.set(e,t.value,n.get(Player.config,t.value)),{});Player.config.savedThemes[e]=t,-1===Player.config.savedThemesOrder.indexOf(e)&&Player.config.savedThemesOrder.push(e),Player.set("savedThemes",Player.config.savedThemes,{bypassValidation:!0}),Player.container.removeChild(Player.$(`.${ns}-theme-save-options`))}}},2487(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},2602(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},2663(e,t,a){var n=a(6325);e.exports=(e={})=>`
\n\t\t\t\tSelect an image and sound to combine as a sound image.\n\t\t\t\tThe sound will be uploaded to the selected file host and the url will be added to the image filename. \n\t\t\t\t \n\t\t\t\tMultiple sound files, or a comma-separated list of sound URLs, can be given for a single image.\n\t\t\t\tIf you do have multiple sounds the name will also be a considered comma-separated list. \n\t\t\t\tDismiss\n\t\t\t
`},5303(e,t,a){e.exports=[...a(1277),...a(7022),...a(2345),...a(6270),...a(5066),...a(8620),{property:"viewStyle",default:"playlist"},{property:"showPlaylistSearch",default:!0},{property:"imageHeight",default:125},{property:"offsetTop",default:"0"},{property:"offsetBottom",default:"0"}]},5305(e,t,a){var n=a(6325);const r=a(8433),s=a(6533);e.exports={template:a(2230),...r,...s,initialize(){r.initialize(),s.initialize()},render(){n.elementHTML(Player.$(`.${ns}-tools`).innerHTML,Player.tools.template()),r.afterRender(),s.afterRender()},toggle(){"tools"===Player.config.viewStyle?Player.playlist.restore():Player.display.setViewStyle("tools")},handleDecoded(e){Player.$(`.${ns}-encoded-input`).value=encodeURIComponent(e.currentTarget.value)},handleEncoded(e){Player.$(`.${ns}-decoded-input`).value=decodeURIComponent(e.currentTarget.value)}}},5331(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},5463(e){e.exports={catbox:{filepath:"//files.catbox.moe/",decode:!1},audio:{decode:!0},sound:{decode:!0}}},5535(e,t,a){var n=a(4302),r=a(6325);const{postIdPrefix:s}=a(218);e.exports=[{property:"repeat",tplName:"repeat",action:"playlist.toggleRepeat",actionMods:".prevent",values:{all:{attrs:['title="Repeat All"'],icon:n.arrowRepeat},one:{attrs:['title="Repeat One"'],icon:n.arrowClockwise},none:{attrs:['title="No Repeat"'],class:"muted",icon:n.arrowRepeat}}},{property:"shuffle",tplName:"shuffle",action:"playlist.toggleShuffle",actionMods:".prevent",values:{true:{attrs:['title="Shuffled"'],icon:n.shuffle},false:{attrs:['title="Ordered"'],class:"muted",icon:n.shuffle}}},{property:"viewStyle",tplName:"playlist",action:"playlist.toggleView",values:{default:{attrs:['title="Player"'],class:"muted",icon:()=>"playlist"===Player.playlist._lastView?n.arrowsExpand:n.arrowsCollapse},playlist:{attrs:['title="Hide Playlist"'],icon:n.arrowsExpand},image:{attrs:['title="Show Playlist"'],icon:n.arrowsCollapse}}},{property:"hoverImages",tplName:"hover-images",action:"playlist.toggleHoverImages",values:{true:{attrs:['title="Hover Images Enabled"'],icon:n.image},false:{attrs:['title="Hover Images Disabled"'],class:"muted",icon:n.image}}},{tplName:"add",action:"playlist.selectLocalFiles",actionMods:".prevent",icon:n.plus,attrs:['title="Add local files"']},{tplName:"reload",action:"posts.refresh",actionMods:".prevent",icon:n.reboot,attrs:['title="Reload the playlist"']},{property:"viewStyle",tplName:"settings",action:"settings.toggle()",actionMods:".prevent",icon:n.gear,attrs:['title="Settings"'],values:{default:{class:"muted"},settings:{}}},{property:"viewStyle",tplName:"threads",action:"threads.toggle",actionMods:".prevent",icon:n.search,attrs:['title="Threads"'],values:{default:{class:"muted"},threads:{}}},{property:"viewStyle",tplName:"tools",action:"tools.toggle",actionMods:".prevent",icon:n.tools,attrs:['title="Tools"'],values:{default:{class:"muted"},tools:{}}},{tplName:"close",action:"hide",actionMods:".prevent",icon:n.close,attrs:['title="Hide the player"']},{tplName:"playing",requireSound:!0,action:'playlist.scrollToPlaying("center")',actionMods:".prevent",icon:n.musicNoteList,attrs:['title="Scroll the playlist to the currently playing sound."']},{tplName:"post",requireSound:!0,icon:n.chatRightQuote,showIf:e=>e.sound.post,attrs:e=>["href="+("#"+s+e.sound.post),'title="Jump to the post for the current sound"']},{tplName:"image",requireSound:!0,icon:n.image,attrs:e=>[`href=${e.sound.image}`,'title="Open the image in a new tab"','target="_blank"']},{tplName:"sound",requireSound:!0,icon:n.soundwave,attrs:e=>[`href=${e.sound.src}`,'title="Open the sound in a new tab"','target="_blank"']},{tplName:/dl-(image|sound)/,requireSound:!0,action:e=>{const t=e.sound["image"===e.tplNameMatch[1]?"image":"src"],a=e.sound["image"===e.tplNameMatch[1]?"filename":"name"]||"";return`tools.download("${r.escAttr(t,!0)}", "${r.escAttr(a,!0)}")`},actionMods:".prevent",icon:e=>"image"===e.tplNameMatch[1]?n.fileEarmarkImage:n.fileEarmarkMusic,attrs:e=>[`title="${"image"===e.tplNameMatch[1]?"Download the image with the original filename":"Download the sound"}"`]},{tplName:/filter-(image|sound)/,requireSound:!0,action:e=>`playlist.addFilter("${"image"===e.tplNameMatch[1]?e.sound.imageMD5:e.sound.src.replace(/^(https?:)?\/\//,"")}")`,actionMods:".prevent",icon:n.filter,showIf:e=>"sound"===e.tplNameMatch[1]||e.sound.imageMD5,attrs:e=>[`title="Add the ${"image"===e.tplNameMatch[1]?"image MD5":"sound URL"} to the filters."`]},{tplName:"remove",requireSound:!0,action:e=>`remove("${e.sound.id}")`,icon:n.trash,attrs:e=>['title="Filter the image."',`data-id="${e.sound.id}"`]},{tplName:"menu",requireSound:!0,class:`${ns}-item-menu-button`,action:e=>`playlist.handleItemMenu($event, "${e.sound.id}")`,actionMods:".prevent.stop",icon:n.chevronDown},{tplName:"view-menu",action:'display.showMenu($event.currentTarget, "views")',actionMods:".prevent.stop",icon:n.chevronDown,attrs:['title="Switch View"']},{tplName:"theme-menu",action:'display.showMenu($event.currentTarget, "themes")',actionMods:".prevent.stop",icon:n.layoutTextWindow,attrs:['title="Switch Theme"']},{tplName:"untz",action:"display.untz",icon:n.speaker,attrs:['title="UNTZ"']}]},5540(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},5563(e,t,a){var n=a(4302);e.exports=(e={})=>`
\n\t\t\tThis may take a while. You can leave it running in the background, but if you background the tab your browser will slow it down.\n\t\t\tYou'll be prompted to download the zip file once complete.
`,Player.container),t.infoEl._keepOpenFor=[t],Player.position.showRelativeTo(t.infoEl,t))},_popoverMouseLeave:e=>{const t=e.currentTarget;t.infoEl&&!t.infoEl._clicked&&(t.infoEl.parentNode.removeChild(t.infoEl),delete t.infoEl)},_popoverClick:e=>{const t=e.currentTarget;t.infoEl&&Player.container.contains(t.infoEl)?(t.infoEl._clicked=!t.infoEl._clicked)||Player.display._popoverMouseLeave(e):Player.display._popoverMouseEnter(e)},_initNoSleep:e=>{const t=e?"addEventListener":"removeEventListener";c&&!!e!==Player.display._noSleepEnabled&&(Player.audio[t]("play",p),Player.audio[t]("pause",u),Player.audio[t]("ended",u),Player.display._noSleepEnabled=!!e,Player.audio.paused||c[e?"enable":"disable"]())},untz(){const e=Player.$(`.${ns}-image-link`);if(Player.untzing=!Player.untzing,Player.audio.playbackRate=Player.audio.defaultPlaybackRate=Player.untzing?1.3:1,Player.container.classList[Player.untzing?"add":"remove"]("untz"),Player.untzing){const t=Player.$(".image-color-overlay");let a=0;t.style.filter=`brightness(1.5); hue-rotate(${a}deg)`,function e(){t.style.filter=`hue-rotate(${a=360-a}deg)`,Player.untzColorTO=setTimeout(e,500)}(),function t(){Player.untzing&&(e.style.transform=`scale(${1+.05*Math.random()})`,e.style.filter=`brightness(${1+.5*Math.random()}) blur(${3*Math.random()}px)`,Player.untzBounceTO=setTimeout(t,200))}()}else e.style.transform=null,e.style.filter=null,clearTimeout(Player.untzBounceTO),clearTimeout(Player.untzColorTO)}}},6818(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},6844(e){e.exports=(e={})=>(Player.threads.boardList||[]).map(e=>{let t=Player.threads.selectedBoards.includes(e.board);return t||Player.threads.showAllBoards?`\n\t\t`:""}).join("")},6933(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},7022(e){e.exports=[{property:"shuffle",title:"Shuffle",displayGroup:"Playback",default:!1},{property:"repeat",title:"Repeat",displayGroup:"Playback",default:"all",options:{all:"All",one:"One",none:"None"}},{property:"preventSleep",title:"Prevent Sleep",displayGroup:"Playback",description:"Prevent sleeping while audio is playing. This only works when the browser and tab are in the foreground.",default:!0},{property:"autoplayNext",title:"Autoplay Next",displayGroup:"Playback",description:"Automatically play the next sound when the current one finishes.",default:!0},{property:"restartSeconds",title:"Restart After",displayGroup:"Playback",description:"How long into a track until selecting previous restarts the track instead. Set to 0 to disable.",default:3,parse:e=>+e>=0&&+e<1/0?+e:0},{title:"Inline Player",displayGroup:"Playback",settings:[{property:"playExpandedImages",title:"Expanded Image",description:"Play audio when sound images are expanded.",default:!0,dependentRender:["expandedControls"]},{property:"expandedControls",title:"Expanded Controls",description:"Show playback controls for expanded images.",default:!0,attrs:()=>Player.config.playExpandedImages?"":"disabled"},{property:"expandedLoopMaster",title:"Master Source",default:"sound",description:"Which media source to play in full for audio and video of different durations.",options:{sound:"Audio",video:"Video"}},{property:"expandedAllowFiltered",title:"Allow Filtered",default:!0,description:"Allow sounds that have been filtered to be played inline. Sounds from unknown hosts will not be played regardless of this setting."},{property:"expandedRepeat",title:"Repeat",default:"all",description:"How to repeat expanded images with multiple sounds.",options:{all:"All",one:"One",none:"None"}},{property:"playHoveredImages",title:"Hover Image",description:"Play audio when sound hover images are shown. This applies to hover images displayed by the native extention or 4chan X.",default:!0}]}]},7119(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},7453(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},7568(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},7654(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},7870(e){e.exports=(e={})=>`
`).join(""))},handleFileRemove(e){const t=+e.currentTarget.getAttribute("data-idx"),a=e.currentTarget.closest(`.${ns}-file-input`).querySelector('input[type="file"]'),n=new DataTransfer;for(let e=0;e{const a=e.type.startsWith("video"),n=e.type.startsWith("image")||"video/webm"===e.type||"video/mp4"===e.type,r=e.type.startsWith("audio");if(a||n||r){const a="video/webm"!==e.type&&"video/mp4"!==e.type||!t?n?Player.tools.imgInput:Player.tools.sndInput:t,r=new DataTransfer;a.multiple&&[...a.files].forEach(e=>r.items.add(e)),r.items.add(e),a.files=r.files,Player.tools.handleFileSelect(a),a===Player.tools.imgInput&&Player.tools.handleImageSelect(),a===Player.tools.sndInput&&Player.tools.useSoundURL&&Player.tools.toggleSoundInput("file")}}),!1},async handleCreate(){Player.tools._createdImageURL&&URL.revokeObjectURL(Player.tools._createdImageURL),Player.tools._createdImage=null,o.status.style.display="block",o.status.innerHTML="Creating sound image",Player.$(`.${ns}-create-button`).disabled=!0;const e=Player.config.uploadHosts[Player.$(`.${ns}-create-sound-host`).value],t=Player.tools.useSoundURL;let a=Player.tools.imgInput.files[0],r=t&&Player.$(`.${ns}-create-sound-snd-url`).value.split(",").map(e=>e.trim()).filter(e=>e),l=(Player.$(`.${ns}-use-video`)||{}).checked&&a&&a.type.startsWith("video")?a&&[a]:[...Player.tools.sndInput.files];const i=Player.$(`.${ns}-create-sound-name`).value,d=i?((r||l).length>1?i.split(","):[i]).map(e=>e.trim()):a&&[a.name.replace(/\.[^/.]+$/,"")];try{if(!a)throw new PlayerError("Select an image or video.","warning");if(a.type.startsWith("video")&&await Player.tools.hasAudio(a))throw o.status.innerHTML+=" Audio not allowed for the image video. Remove the audio from the video and try again.",new PlayerError("Audio not allowed for the image video.","warning");const i=d.join("").length+8*(r||l).length;if(t){try{r=r.map(e=>new URL(e)&&e.replace(/^(https?:)?\/\//,""))}catch(e){throw new PlayerError("The provided sound URL is invalid.","warning")}if(2188)throw new PlayerError("The generated image filename is too long.","warning");l=await Promise.all(l.map(async e=>{if(e.type.startsWith("video")&&!await Player.tools.hasAudio(e))throw new PlayerError(`The selected video has no audio. (${e.name})`,"warning");return e}));try{r=await Promise.all(l.map(async t=>Player.tools.postFile(t,e)))}catch(e){throw new PlayerError("Upload failed.","error",e)}}if(!r.length)throw new PlayerError("No sounds selected.","warning");let c="";for(let e=0;eFailed! "+(e instanceof PlayerError?e.reason:""),Player.logError("Failed to create sound image",e)}Player.$(`.${ns}-create-button`).disabled=!1},hasAudio:e=>!(!e.type.startsWith("audio")&&!e.type.startsWith("video"))&&new Promise((t,a)=>{const n=URL.createObjectURL(e),r=document.createElement("video");r.addEventListener("loadeddata",()=>{URL.revokeObjectURL(n),t(r.mozHasAudio||!!r.webkitAudioDecodedByteCount)}),r.addEventListener("error",a),r.src=n}),async postFile(e,t){const a=Player.tools._uploadIdx++;if(!t||t.invalid)throw new PlayerError("Invalid upload host.","error");const r=new FormData;return Object.keys(t.data).forEach(a=>{null!==t.data[a]&&r.append(a,"$file"===t.data[a]?e:t.data[a])}),o.status.innerHTML+=` Uploading ${e.name}`,new Promise((s,l)=>{GM.xmlHttpRequest({method:"POST",url:t.url,data:r,responseType:t.responsePath?"json":"text",headers:t.headers,onload:async r=>{if(r.status<200||r.status>=300)return l(r);const o=t.responsePath?n.get(r.response,t.responsePath):t.responseMatch?(r.responseText.match(new RegExp(t.responseMatch))||[])[1]:r.responseText,i=(t.soundUrl?t.soundUrl.replace("%s",o):o).trim();Player.$(`.${ns}-upload-status-${a}`).innerHTML=`Uploaded ${e.name} to ${i}`,s(i)},upload:{onprogress:t=>{const n=t.total>0?t.total:e.size;Player.$(`.${ns}-upload-status-${a}`).innerHTML=`Uploading ${e.name} - ${Math.floor(t.loaded/n*100)}%`}},onerror:l})})},addCreatedToPlayer(){Player.playlist.addFromFiles([Player.tools._createdImage])},addCreatedToQR(){if(!is4chan)return;const e=document.querySelector(isChanX?".qr-link":".open-qr-link"),t=new DataTransfer;if(t.items.add(Player.tools._createdImage),isChanX&&e){e.click();const a=new CustomEvent("drop",{view:window,bubbles:!0,cancelable:!0});a.dataTransfer=t,document.querySelector("#qr").dispatchEvent(a)}else e?(e.click(),document.querySelector("#qrFile").files=t.files):(document.querySelector("#togglePostFormLink a").click(),document.querySelector("#postFile").files=t.files,document.querySelector(".postForm").scrollIntoView())}}},8472(e,t,a){"use strict";a.d(t,{A:()=>n});const n=''},8475(e){e.exports=(e={})=>`
\n\t\n
`},8563(e,t,a){var n=a(6325);e.exports={template:()=>Player.userTemplate.build({template:Player.config.headerTemplate+``,location:"header",sound:Player.playing,defaultName:"4chan Sounds",outerClass:`${ns}-col-auto`}),initialize(){Player.userTemplate.maintain(Player.header,"headerTemplate")},render(){n.elementHTML(Player.$(`.${ns}-header`),Player.header.template())}}},8620(e){e.exports=[{property:"defaultUploadHost",default:"catbox",parse:"settings.hosts.setDefault"},{property:"uploadHosts",title:"Hosts",actions:[{title:"Add",handler:"settings.hosts.add",mods:".prevent"},{title:"Restore Defaults",handler:"settings.hosts.restoreDefaults",mods:".prevent"}],displayGroup:"Hosts",displayMethod:"settings.hosts.template",parse:"settings.hosts.parse",looseCompare:!0,wideDesc:!0,description:'Each host needs a unique name and URL that points to an upload endpoint.
The form data is a JSON representation of the data sent with the upload, with the file being indicated as "$file". The form data and headers allow for any other information to be sent, such as a user token.
A response path or match can optionally be provided to get a link to the uploaded file from the response. Use "Response Path" for JSON responses to set where a link or filename can be found in the response. For all other responses "Response Match" takes a regular expression (without slashes) that is applied to the result, with the first capture group being the link or filename. File URL format can be set if you only have part of the link, such as the filename. The response, or response path/match result, will be inserted in place of %s.',mix:!0,default:{catbox:{default:!0,url:"https://catbox.moe/user/api.php",data:{reqtype:"fileupload",fileToUpload:"$file",userhash:null},filenameLength:29},pomf:{url:"https://pomf.cat/upload.php",data:{"files[]":"$file"},responsePath:"files.0.url",soundUrl:"a.pomf.cat/%s",filenameLength:23},zz:{url:"https://zz.ht/api/upload",responsePath:"files.0.url",data:{"files[]":"$file"},headers:{token:null},filenameLength:19},lewd:{url:"https://lewd.se/upload",data:{file:"$file"},headers:{token:null,shortUrl:!0},responsePath:"data.link",filenameLength:30}}}]},8808(e){e.exports=(e={})=>{if(!e.tags)return'