(self.webpackChunk=self.webpackChunk||[]).push([[34],{78249:(t,e,o)=>{var i={"./comment_component/comment_component.scss":12511,"./comment_votes_tooltip_component/comment_votes_tooltip_component.scss":22658,"./favorites_tooltip_component/favorites_tooltip_component.scss":90643,"./file_upload_component/file_upload_component.scss":69636,"./forum_post_component/forum_post_component.scss":81437,"./media_asset_component/media_asset_component.scss":21033,"./media_asset_gallery_component/media_asset_gallery_component.scss":55548,"./media_asset_preview_component/media_asset_preview_component.scss":80510,"./paginator_component/paginator_component.scss":10640,"./popup_menu_component/popup_menu_component.scss":40833,"./post_gallery_component/post_gallery_component.scss":48724,"./post_navbar_component/post_navbar_component.scss":17157,"./post_preview_component/post_preview_component.scss":44924,"./post_votes_component/post_votes_component.scss":43826,"./post_votes_tooltip_component/post_votes_tooltip_component.scss":33430,"./source_data_component/source_data_component.scss":95513,"./tab_panel_component/tab_panel_component.scss":76285,"./tag_list_component/tag_list_component.html.scss":12449,"comment_component/comment_component.scss":12511,"comment_votes_tooltip_component/comment_votes_tooltip_component.scss":22658,"favorites_tooltip_component/favorites_tooltip_component.scss":90643,"file_upload_component/file_upload_component.scss":69636,"forum_post_component/forum_post_component.scss":81437,"media_asset_component/media_asset_component.scss":21033,"media_asset_gallery_component/media_asset_gallery_component.scss":55548,"media_asset_preview_component/media_asset_preview_component.scss":80510,"paginator_component/paginator_component.scss":10640,"popup_menu_component/popup_menu_component.scss":40833,"post_gallery_component/post_gallery_component.scss":48724,"post_navbar_component/post_navbar_component.scss":17157,"post_preview_component/post_preview_component.scss":44924,"post_votes_component/post_votes_component.scss":43826,"post_votes_tooltip_component/post_votes_tooltip_component.scss":33430,"source_data_component/source_data_component.scss":95513,"tab_panel_component/tab_panel_component.scss":76285,"tag_list_component/tag_list_component.html.scss":12449};function s(t){var e=a(t);return o(e)}function a(t){if(!o.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}s.keys=function(){return Object.keys(i)},s.resolve=a,t.exports=s,s.id=78249},55052:(t,e,o)=>{var i={"./artist_commentaries.js":66974,"./autocomplete.js":84835,"./blacklists.js":51678,"./comment_component.js":33875,"./comment_votes_tooltip_component.js":83688,"./common.js":62855,"./cookie.js":94141,"./current_user.js":55056,"./draggable.js":88186,"./dtext.js":77994,"./favorite_groups.js":68441,"./favorites_tooltip_component.js":9196,"./file_upload_component.js":22472,"./forum_post_component.js":68699,"./help_tooltip_component.js":966,"./iqdb_queries.js":63881,"./media_asset_component.js":81922,"./mod_queue.js":41207,"./news_updates.js":28326,"./notes.js":36520,"./pools.js":83013,"./popup_menu_component.js":78122,"./post_mode_menu.js":24596,"./post_tooltips.js":84785,"./post_version.js":7832,"./post_votes_tooltip_component.js":3045,"./posts.js":86168,"./preview_size_menu_component.js":2201,"./related_tag.js":29196,"./responsive.js":65263,"./shortcuts.js":36381,"./source_data_component.js":28517,"./tag_counter.js":47620,"./time_series_component.js":85718,"./ugoira.js":74569,"./uploads.js":44741,"./user_tooltips.js":88254,"./utility.js":20866,"src/javascripts/artist_commentaries.js":66974,"src/javascripts/autocomplete.js":84835,"src/javascripts/blacklists.js":51678,"src/javascripts/comment_component.js":33875,"src/javascripts/comment_votes_tooltip_component.js":83688,"src/javascripts/common.js":62855,"src/javascripts/cookie.js":94141,"src/javascripts/current_user.js":55056,"src/javascripts/draggable.js":88186,"src/javascripts/dtext.js":77994,"src/javascripts/favorite_groups.js":68441,"src/javascripts/favorites_tooltip_component.js":9196,"src/javascripts/file_upload_component.js":22472,"src/javascripts/forum_post_component.js":68699,"src/javascripts/help_tooltip_component.js":966,"src/javascripts/iqdb_queries.js":63881,"src/javascripts/media_asset_component.js":81922,"src/javascripts/mod_queue.js":41207,"src/javascripts/news_updates.js":28326,"src/javascripts/notes.js":36520,"src/javascripts/pools.js":83013,"src/javascripts/popup_menu_component.js":78122,"src/javascripts/post_mode_menu.js":24596,"src/javascripts/post_tooltips.js":84785,"src/javascripts/post_version.js":7832,"src/javascripts/post_votes_tooltip_component.js":3045,"src/javascripts/posts.js":86168,"src/javascripts/preview_size_menu_component.js":2201,"src/javascripts/related_tag.js":29196,"src/javascripts/responsive.js":65263,"src/javascripts/shortcuts.js":36381,"src/javascripts/source_data_component.js":28517,"src/javascripts/tag_counter.js":47620,"src/javascripts/time_series_component.js":85718,"src/javascripts/ugoira.js":74569,"src/javascripts/uploads.js":44741,"src/javascripts/user_tooltips.js":88254,"src/javascripts/utility.js":20866};function s(t){var e=a(t);return o(e)}function a(t){if(!o.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}s.keys=function(){return Object.keys(i)},s.resolve=a,t.exports=s,s.id=55052},44353:(t,e,o)=>{var i={"./base/000_vars.scss":25038,"./base/010_reset.scss":79045,"./base/020_base.scss":47302,"./base/030_links.scss":73947,"./base/040_colors.scss":74879,"./common/autocomplete.scss":97900,"./common/blacklists.scss":10137,"./common/buttons.scss":26762,"./common/diffs.scss":82210,"./common/dtext.scss":59655,"./common/fonts.css":21344,"./common/inline.scss":97261,"./common/jquery_ui_custom.scss":26757,"./common/main_layout.scss":15569,"./common/messages.scss":85615,"./common/news.scss":13625,"./common/notices.scss":35849,"./common/page_header.scss":43282,"./common/recent_posts.scss":54934,"./common/simple_form.scss":1687,"./common/tables.scss":63091,"./common/tags.scss":25125,"./common/user_styles.scss":88260,"./common/utilities.scss":52390,"./common/versions.scss":68777,"./specific/artists.scss":73661,"./specific/bans.scss":74312,"./specific/common_tooltips.scss":63477,"./specific/dmails.scss":59992,"./specific/error.scss":40480,"./specific/forum.scss":2487,"./specific/notes.scss":27775,"./specific/pools.scss":12916,"./specific/post_mode_menu.scss":20701,"./specific/post_tooltips.scss":42532,"./specific/post_versions.scss":58298,"./specific/posts.scss":53083,"./specific/related_tags.scss":51463,"./specific/uploads.scss":62868,"./specific/user_feedback.scss":81042,"./specific/user_tooltips.scss":99497,"./specific/user_upgrades.scss":16046,"./specific/users.scss":17201,"./specific/wiki_page_versions.scss":60070,"./specific/z_responsive.scss":18748,"src/styles/base/000_vars.scss":25038,"src/styles/base/010_reset.scss":79045,"src/styles/base/020_base.scss":47302,"src/styles/base/030_links.scss":73947,"src/styles/base/040_colors.scss":74879,"src/styles/common/autocomplete.scss":97900,"src/styles/common/blacklists.scss":10137,"src/styles/common/buttons.scss":26762,"src/styles/common/diffs.scss":82210,"src/styles/common/dtext.scss":59655,"src/styles/common/fonts.css":21344,"src/styles/common/inline.scss":97261,"src/styles/common/jquery_ui_custom.scss":26757,"src/styles/common/main_layout.scss":15569,"src/styles/common/messages.scss":85615,"src/styles/common/news.scss":13625,"src/styles/common/notices.scss":35849,"src/styles/common/page_header.scss":43282,"src/styles/common/recent_posts.scss":54934,"src/styles/common/simple_form.scss":1687,"src/styles/common/tables.scss":63091,"src/styles/common/tags.scss":25125,"src/styles/common/user_styles.scss":88260,"src/styles/common/utilities.scss":52390,"src/styles/common/versions.scss":68777,"src/styles/specific/artists.scss":73661,"src/styles/specific/bans.scss":74312,"src/styles/specific/common_tooltips.scss":63477,"src/styles/specific/dmails.scss":59992,"src/styles/specific/error.scss":40480,"src/styles/specific/forum.scss":2487,"src/styles/specific/notes.scss":27775,"src/styles/specific/pools.scss":12916,"src/styles/specific/post_mode_menu.scss":20701,"src/styles/specific/post_tooltips.scss":42532,"src/styles/specific/post_versions.scss":58298,"src/styles/specific/posts.scss":53083,"src/styles/specific/related_tags.scss":51463,"src/styles/specific/uploads.scss":62868,"src/styles/specific/user_feedback.scss":81042,"src/styles/specific/user_tooltips.scss":99497,"src/styles/specific/user_upgrades.scss":16046,"src/styles/specific/users.scss":17201,"src/styles/specific/wiki_page_versions.scss":60070,"src/styles/specific/z_responsive.scss":18748};function s(t){var e=a(t);return o(e)}function a(t){if(!o.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}s.keys=function(){return Object.keys(i)},s.resolve=a,t.exports=s,s.id=44353},74386:(t,e,o)=>{var i={"./pixiv-ugoira-player.js":77867,"vendor/pixiv-ugoira-player.js":77867};function s(t){var e=a(t);return o(e)}function a(t){if(!o.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}s.keys=function(){return Object.keys(i)},s.resolve=a,t.exports=s,s.id=74386},41307:(t,e,o)=>{"use strict";o(41817),o(72443),o(69007),o(16066),o(83510),o(41840),o(32159),o(21703),o(9170),o(32120),o(52262),o(67635),o(77287),o(84944),o(86535),o(26699),o(66992),o(57658),o(85827),o(96644),o(65069),o(2707),o(33792),o(99244),o(30541),o(18264),o(39575),o(35837),o(38862),o(25438),o(61874),o(9494),o(31354),o(56977),o(19601),o(59595),o(35500),o(38559),o(46314),o(94869),o(33952),o(54678),o(91058),o(88674),o(17922),o(34668),o(17727),o(83593),o(81299),o(24603),o(28450),o(74916),o(92087),o(77601),o(39714),o(24506),o(27852),o(32023),o(4723),o(76373),o(15306),o(68757),o(64765),o(23123),o(23157),o(73210),o(48702),o(55674),o(44197),o(76495),o(87145),o(35109),o(65125),o(82472),o(49743),o(8255),o(29135),o(48675),o(33105),o(63408),o(14590),o(98145),o(95206),o(3462),o(33824),o(12974),o(4129),o(16586),o(19258),o(84811),o(34286),o(52550),o(1999),o(61886),o(59422),o(8e4),o(83475),o(46273),o(56882),o(78525),o(27004),o(3087),o(97391),o(4763),o(66342),o(40787),o(1094),o(23647),o(68216),o(88449),o(31672),o(74326),o(15581),o(78631),o(48746),o(57640),o(25387),o(64211),o(12771),o(62962),o(71790),o(51568),o(26349),o(30800),o(67427),o(32279),o(13384),o(2490),o(85567),o(18359),o(5332),o(79433),o(59849),o(59461),o(82499),o(34514),o(26877),o(64994),o(9924),o(72608),o(41874),o(66043),o(23748),o(71501),o(10072),o(23042),o(99137),o(71957),o(96306),o(103),o(8582),o(90618),o(74592),o(88440),o(58276),o(35082),o(12813),o(18222),o(24838),o(38563),o(50336),o(7512),o(74442),o(87713),o(46603),o(70100),o(10490),o(13187),o(60092),o(19041),o(30666),o(51638),o(62975),o(15728),o(46056),o(44299),o(5162),o(50292),o(29427),o(99964),o(75238),o(4987),o(1025),o(77479),o(34582),o(47896),o(12647),o(98558),o(84018),o(97507),o(61605),o(49076),o(34999),o(88921),o(96248),o(27561),o(13599),o(11477),o(64362),o(15389),o(46006),o(3440),o(90401),o(66244),o(45164),o(89772),o(91238),o(88910),o(54837),o(87485),o(56767),o(69916),o(76651),o(61437),o(63252),o(35285),o(17454),o(39865),o(86035),o(50058),o(67501),o(85576),o(98275),o(71842),o(609),o(21568),o(54534),o(95090),o(34744),o(48824),o(44130),o(35954),o(16850),o(26182),o(8922),o(5835),o(23767),o(8585),o(8970),o(84444),o(68696),o(78206),o(76478),o(79715),o(12714),o(5964),o(43561),o(32049),o(86020),o(56585),o(33948),o(87714),o(82801),o(1174),o(84633),o(85844),o(71550),o(61295),o(60285),o(83753),o(41637);var i=o(39492),s=o(90837),a=o(70421),n=o(11095),r=o(4002),c=o.n(r),l=(o(22506),o(84835)),p=o(66974),d=o(51678),g=o(33875),u=o(83688),m=o(94141),f=o(55056),h=o(88186),_=o(77994),b=o(9196),v=o(22472),w=o(68699),y=o(966),x=o(63881),k=o.n(x),z=o(36520),j=o(81922),E=o(78122),T=o(86168),S=o(24596),D=o(84785),C=o(3045),I=o(2201),O=o(29196),L=o(36381),A=o(47620),M=o(85718),H=o(44741),N=o(88254),R=o(20866),P=o(74569);function U(t){t.keys().forEach(t)}o(18535).start(),o(50840),o(57384),U(o(74386)),o(50425),o(92993),o(79366),o(92466),o(70446),o(56268),o(22330),o(36773),o(70701),U(o(55052)),U(o(44353)),U(o(78249));let F={};F.Autocomplete=l.default,F.ArtistCommentary=p.default,F.Blacklist=d.default,F.CommentComponent=g.default,F.CommentVotesTooltipComponent=u.default,F.Cookie=m.default,F.CurrentUser=f.default,F.Draggable=h.default,F.Dtext=_.default,F.FavoritesTooltipComponent=b.default,F.FileUploadComponent=v.default,F.ForumPostComponent=w.default,F.HelpTooltipComponent=y.default,F.IqdbQuery=k(),F.MediaAssetComponent=j.default,F.Note=z.default,F.PopupMenuComponent=E.default,F.Post=T.default,F.PostModeMenu=S.default,F.PostTooltip=D.default,F.PostVotesTooltipComponent=C.default,F.PreviewSizeMenuComponent=I.default,F.RelatedTag=O.default,F.Shortcuts=L.default,F.TagCounter=A.default,F.TimeSeriesComponent=M.default,F.Upload=H.default,F.UserTooltip=N.default,F.Utility=R.default,F.Ugoira=P.default,F.notice=R.default.notice,F.error=R.default.error,window.$=c(),window.jQuery=c(),window.morphdom=i.Z,window.Alpine=s.Z,window.Danbooru=F,s.Z.plugin(a.Z),s.Z.plugin(n.Z),$((()=>s.Z.start()))},66974:(t,e,o)=>{"use strict";o.r(e);var i=o(20866),s=o(18535),a=o.n(s);let n={initialize_all:function(){$("#c-posts").length&&$("#a-show").length&&($("#original-artist-commentary").length&&$("#translated-artist-commentary").length&&this.initialize_commentary_display_tabs(),this.initialize_edit_commentary_dialog())},initialize_commentary_display_tabs:function(){$("#commentary-sections li a").on("click.danbooru",(function(t){"#original"===t.target.hash?($("#original-artist-commentary").show(),$("#translated-artist-commentary").hide()):"#translated"===t.target.hash&&($("#original-artist-commentary").hide(),$("#translated-artist-commentary").show()),$("#commentary-sections li").removeClass("active"),$(t.target).parent("li").addClass("active"),t.preventDefault()}))},initialize_edit_commentary_dialog:function(){$("#add-commentary-dialog").dialog({autoOpen:!1,width:700,buttons:{Submit:function(){let t=$("#add-commentary-dialog #edit-commentary").get(0);a().fire(t,"submit"),$(this).dialog("close")},Cancel:function(){$(this).dialog("close")}}}),$("#add-commentary-dialog #edit-commentary").submit((function(){$("#add-commentary-dialog").dialog("close")})),$("#add-commentary").on("click.danbooru",(function(t){t.preventDefault(),$("#add-commentary-dialog").dialog("open")})),$('#fetch-commentary select[name="commentary_source_type"]').change((function(){$("#fetch-commentary input").toggle()})),$('#fetch-commentary button[type="submit"]').on("click.danbooru",n.fetch_commentary)},fetch_commentary:function(){var t="";i.default.notice("Fetching artist commentary...");var e=$('#fetch-commentary select[name="commentary_source_type"]').val();if("Source"===e){var o=$('#fetch-commentary input[name="commentary_source"]').val();t=n.from_source(o)}else if("Post"===e){var s=$('#fetch-commentary input[name="commentary_post_id"]').val();t=n.from_post_id(s)}return t.then(n.fill_commentary).then((function(t){var e=t?"Artist commentary copied.":"Artist commentary copied; conflicting fields ignored.";i.default.notice(e)})).catch((function(){i.default.notice("Fetching artist commentary failed.")})),!1},from_source:function(t){return $.get("/source.json?url="+encodeURIComponent(t)).then((function(e){return{original_title:e.artist_commentary.dtext_title,original_description:e.artist_commentary.dtext_description,source:t}}))},from_post_id:function(t){return $.get("/posts/"+encodeURIComponent(t)+"/artist_commentary.json").then((function(e){return e.source="post #"+t,e}))},fill_commentary:function(t){var e=n.merge_commentaries($("#artist_commentary_original_description").val().trim(),t);return $("#artist_commentary_original_description").val(e),[n.update_field($("#artist_commentary_original_title"),t.original_title),n.update_field($("#artist_commentary_translated_title"),t.translated_title),n.update_field($("#artist_commentary_translated_description"),t.translated_description)].every((function(t){return t}))},merge_commentaries:function(t,e){var o=$(".image-container").data().source,i=$(".image-container").data().normalizedSource;return e.original_description&&t&&e.original_description!==t?t+"\n\n[tn]\nSource: "+i+"\n[/tn]\n\nh6. "+(e.original_title||"Untitled")+"\n\n"+e.original_description+"\n\n[tn]\nSource: "+e.source+"\n[/tn]":e.source!==o?e.original_description+"\n\n[tn]\nSource: "+e.source+"\n[/tn]":e.original_description||t},update_field:function(t,e){return t.closest(".input").removeClass("field_with_errors"),""===t.val().trim()?(t.val(e),!0):t.val().trim()===e||(t.closest(".input").addClass("field_with_errors"),!1)}};$((function(){n.initialize_all()})),e.default=n},84835:(t,e,o)=>{"use strict";o.r(e);let i={VERSION:1,MAX_RESULTS:20,initialize_all:function(){$.widget("ui.autocomplete",$.ui.autocomplete,{options:{delay:0,minLength:1,autoFocus:!1,focus:function(){return!1}},_create:function(){this.element.on("keydown.Autocomplete.tab",null,"tab",i.on_tab),this._super()},_renderItem:i.render_item,search:function(t,e){$(this).data("ui-autocomplete")&&($(this).data("ui-autocomplete").menu.bindings=$()),this._super(t,e)}}),this.initialize_tag_autocomplete(),this.initialize_mention_autocomplete($("form div.input.dtext textarea")),this.initialize_fields($('[data-autocomplete="tag"]'),"tag"),this.initialize_fields($('[data-autocomplete="artist"]'),"artist"),this.initialize_fields($('[data-autocomplete="pool"]'),"pool"),this.initialize_fields($('[data-autocomplete="user"]'),"user"),this.initialize_fields($('[data-autocomplete="wiki-page"]'),"wiki_page"),this.initialize_fields($('[data-autocomplete="favorite-group"]'),"favorite_group"),this.initialize_fields($('[data-autocomplete="saved-search-label"]'),"saved_search_label")},initialize_fields:function(t,e){t.autocomplete({source:async function(t,o){o(await i.autocomplete_source(t.term,e))}})},initialize_mention_autocomplete:function(t){t.autocomplete({select:function(t,e){return i.insert_completion(this,e.item.value),!1},source:async function(t,e){for(var o=this.element.get(0).selectionStart,s=null,a=o;a>=1;--a){if(" "===t.term[a-1])return;if("@"===t.term[a-1]){if(1===a||/[ \r\n]/.test(t.term[a-2])){s=t.term.substring(a,o);break}return}}if(s){e(await i.autocomplete_source(s,"mention"))}}})},initialize_tag_autocomplete:function(){$('[data-autocomplete="tag-query"], [data-autocomplete="tag-edit"]').autocomplete({select:function(t,e){return i.insert_completion(this,e.item.value),!1},source:async function(t,e){let o=i.current_term(this.element);e(await i.autocomplete_source(o,"tag_query"))}})},current_term:function(t){let e=t.get(0).value,o=t.get(0).selectionStart,s=new RegExp(`^[-~(]*(${i.tag_prefixes().join("|")})?`);return e.substring(0,o).match(/\S*$/)[0].replace(s,"").toLowerCase()},insert_completion:function(t,e){var o=t.value.substring(0,t.selectionStart).replace(/^[ \t]+|[ \t]+$/gm,""),s=t.value.substring(t.selectionStart).replace(/^[ \t]+|[ \t]+$/gm,""),a=new RegExp(`([-~(]*(?:${i.tag_prefixes().join("|")})?)\\S+$`,"g");o=o.replace(a,"$1")+e+" ",t.value=o+s,t.selectionStart=t.selectionEnd=o.length,$(t).trigger("input")},on_tab:function(t){var e=$(this).autocomplete("instance"),o=e.menu.element;if(o.is(":visible")){if(0===o.has(".ui-state-active").length){var s=o.find(".ui-menu-item").first().data().uiAutocompleteItem.value;i.insert_completion(this,s),e.close()}t.preventDefault()}},render_item:function(t,e){return e.html.data("ui-autocomplete-item",e),t.append(e.html)},autocomplete_source:async function(t,e){if(""===t)return[];let o=await $.get("/autocomplete",{"search[query]":t,"search[type]":e,version:i.VERSION,limit:i.MAX_RESULTS});return $(o).find("li").toArray().map((t=>{let e=$(t);return{value:e.attr("data-autocomplete-value"),html:e}}))},tag_prefixes:function(){return JSON.parse($("meta[name=autocomplete-tag-prefixes]").attr("content"))}};$(document).ready((function(){i.initialize_all()})),e.default=i},51678:(t,e,o)=>{"use strict";o.r(e);var i=o(20866),s=o(94141);let a={entries:[],parse_entry:function(t){var e={tags:t,require:[],exclude:[],optional:[],disabled:!1,hits:0,min_score:null};return i.default.splitWords(t).forEach((function(t){if("-"===t.charAt(0))e.exclude.push(t.slice(1));else if("~"===t.charAt(0))e.optional.push(t.slice(1));else if(t.match(/^score:<.+/)){var o=t.match(/^score:<(.+)/)[1];e.min_score=parseInt(o)}else e.require.push(t)})),e},parse_entries:function(){var t=(i.default.meta("blacklisted-tags")||"nozomiisthebestlovelive").replace(/(rating:\w)\w+/gi,"$1").toLowerCase().split(/,/);(t=t.filter((t=>""!==t.trim()))).forEach((function(t){var e=a.parse_entry(t);a.entries.push(e)}))},toggle_entry:function(t){var e=$(t.target),o=e.text(),i=$.grep(a.entries,(function(t,e){return t.tags===o}))[0];i&&(i.disabled=!i.disabled,i.disabled?e.addClass("blacklisted-inactive"):e.removeClass("blacklisted-inactive")),a.apply(),t.preventDefault()},update_sidebar:function(){a.entries.forEach((function(t){if(0===t.hits.length)return;var e=$("
  • "),o=$(""),i=$("");o.text(t.tags),o.attr("href",`/posts?tags=${encodeURIComponent(t.tags)}`),o.attr("title",t.tags),o.on("click.danbooru",a.toggle_entry);let s=new Set(t.hits).size;i.html(s),i.addClass("count"),e.append(o),e.append(" "),e.append(i),$("#blacklist-list").append(e)})),$("#blacklist-box").show()},disable_all:function(){a.entries.forEach((function(t){t.disabled=!0})),a.posts().removeClass("blacklisted-active"),$("#disable-all-blacklists").hide(),$("#re-enable-all-blacklists").show(),$("#blacklist-list a").addClass("blacklisted-inactive")},enable_all:function(){a.entries.forEach((function(t){t.disabled=!1})),a.apply(),$("#disable-all-blacklists").show(),$("#re-enable-all-blacklists").hide(),$("#blacklist-list a").removeClass("blacklisted-inactive")},initialize_disable_all_blacklists:function(){"1"===s.default.get("dab")?a.disable_all():$("#disable-all-blacklists").show(),$("#disable-all-blacklists").on("click.danbooru",(function(t){s.default.put("dab","1"),a.disable_all(),t.preventDefault()})),$("#re-enable-all-blacklists").on("click.danbooru",(function(t){s.default.put("dab","0"),a.enable_all(),t.preventDefault()}))},apply:function(){a.entries.forEach((function(t){t.hits=[]}));var t=0;return a.posts().each((function(e,o){t+=a.apply_post(o)})),t},apply_post:function(t){var e=0;return a.entries.forEach((function(o){if(a.post_match(t,o)){let i=$(t).data("id");o.hits.push(i),e+=1}})),e>0?a.post_hide(t):a.post_unhide(t),e},posts:function(){return $(".post-preview, .image-container, #c-comments .post, .mod-queue-preview.post-preview")},post_match:function(t,e){if(e.disabled)return!1;var o=$(t),s=parseInt(o.attr("data-score")),a=null===e.min_score||s0&&(a.update_sidebar(),a.initialize_disable_all_blacklists())}};$(document).ready((function(){0!==$("#blacklist-box").length&&a.initialize_all()})),e.default=a},33875:(t,e,o)=>{"use strict";o.r(e);var i=o(20866);class s{static initialize(){$("#c-posts #a-show, #c-comments").length&&($(document).on("click.danbooru.comment",".edit_comment_link",s.showEditForm),$(document).on("click.danbooru.comment",".expand-comment-response",s.showNewCommentForm),$(document).on("click.danbooru.comment",".comment-copy-id",s.copyID),$(document).on("click.danbooru.comment",".comment-copy-link",s.copyLink))}static showNewCommentForm(t){$(t.target).hide();var e=$(t.target).closest("div.new-comment").find("form");e.show(),e[0].scrollIntoView(!1),e.find("textarea").selectEnd(),t.preventDefault()}static showEditForm(t){$(this).closest(".comment").find(".edit_comment").show(),t.preventDefault()}static async copyID(t){let e=`comment #${$(this).closest(".comment").data("id")}`;i.default.copyToClipboard(e),t.preventDefault()}static async copyLink(t){let e=$(this).closest(".comment").data("id"),o=`${window.location.origin}/comments/${e}`;i.default.copyToClipboard(o),t.preventDefault()}}$(document).ready(s.initialize),e.default=s},83688:(t,e,o)=>{"use strict";o.r(e);var i=o(20866),s=o(31051);function a(t,e,o){return(e=function(t){var e=function(t,e){if("object"!==typeof t||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class n{static initialize(){0!==$(n.TARGET_SELECTOR).length&&(n.instance=(0,i.createTooltip)("comment-tooltip",{delay:[n.SHOW_DELAY,n.HIDE_DELAY],duration:n.DURATION,target:n.TARGET_SELECTOR,onShow:n.onShow,onHide:n.onHide}))}static async onShow(t){let e=$(t.reference),o=$(t.popper),a=e.parents("[data-id]").data("id");(0,s.Bn)({exclude:t});try{o.addClass("tooltip-loading"),t._request=$.get(`/comments/${a}/votes`,{variant:"tooltip"});let e=await t._request;t.setContent(e),o.removeClass("tooltip-loading")}catch(n){0!==n.status&&"abort"!==n.statusText&&i.default.error(`Error displaying votes for comment #${a} (error: ${n.status} ${n.statusText})`)}}static async onHide(t){var e;"pending"===(null===(e=t._request)||void 0===e?void 0:e.state())&&t._request.abort()}}a(n,"TARGET_SELECTOR","span.comment-score"),a(n,"SHOW_DELAY",125),a(n,"HIDE_DELAY",125),a(n,"DURATION",250),a(n,"instance",null),$(document).ready(n.initialize),e.default=n},62855:(t,e,o)=>{"use strict";o.r(e);var i=o(94141);$((function(){$("#hide-upgrade-account-notice").on("click.danbooru",(function(t){$("#upgrade-account-notice").hide(),i.default.put("hide_upgrade_account_notice","1",604800),t.preventDefault()})),$("#hide-promotion-notice").on("click.danbooru",(function(t){$("#promotion-notice").hide(),i.default.put("hide_winter_sale_notice","1",3600),i.default.put("hide_upgrade_account_notice","1",604800),t.preventDefault()})),$("#hide-dmail-notice").on("click.danbooru",(function(t){var e=$("#dmail-notice");e.hide();var o=e.data("id");i.default.put("hide_dmail_notice",o),t.preventDefault()})),$("#hide-verify-account-notice").on("click.danbooru",(function(t){$("#verify-account-notice").hide(),i.default.put("hide_verify_account_notice","1",259200),t.preventDefault()})),$("#close-notice-link").on("click.danbooru",(function(t){$("#notice").fadeOut("fast"),t.preventDefault()})),location.hostname.endsWith("danbooru.me")&&(location.hostname="danbooru.donmai.us")})),window.submitInvisibleRecaptchaForm=function(){document.getElementById("signup-form").submit()}},94141:(t,e,o)=>{"use strict";o.r(e);let i={put:function(t,e,o=63072e4){let i=`${t}=${encodeURIComponent(e)}; Path=/; SameSite=Lax;`;o&&(i+=` Max-Age=${o};`),"https:"===location.protocol&&(i+=" Secure;"),document.cookie=i},get:function(t){for(var e=t+"=",o=document.cookie.split(";"),i=0;i{"use strict";o.r(e);let i={data:function(t){return $("body").data(`current-user-${t}`)},update:function(t){return $.ajax(`/users/${i.data("id")}.json`,{method:"PUT",data:{user:t}})},darkMode:function(){let t=i.data("theme");return"dark"===t||"auto"===t&&window.matchMedia("(prefers-color-scheme: dark)").matches}};e.default=i},88186:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>i});class i{constructor(t){this.selector=t,this.initialize()}initialize(){$(document).on("pointerdown.danbooru",this.selector,(t=>{if(0!==t.button||!t.originalEvent.isPrimary)return;let e=!0,o=t.target,i=t.pointerId,s=`drag-${i}`;o.setPointerCapture(i),$(o).addClass("dragging"),$(o).trigger("drag:start",[t,this]),t.preventDefault(),$(document.body).on(`pointermove.${s}`,(s=>{requestAnimationFrame((()=>{if(s.pointerId!==i||!e)return;let a={x:s.clientX-t.clientX,y:s.clientY-t.clientY};$(o).trigger("drag:move",[s,a,this]),s.preventDefault()}))})),$(document.body).on(`pointerup.${s} pointercancel.${s}`,(t=>{t.pointerId===i&&(e=!1,$(o).removeClass("dragging"),$(document.body).off(`pointerup.${s} pointercancel.${s} pointermove.${s}`),$(o).trigger("drag:stop",[t,this]),t.preventDefault())}))}))}}},77994:(t,e,o)=>{"use strict";o.r(e);let i={initialize_all:function(){i.initialize_links()},initialize_links:function(){$(document).on("click.danbooru",".dtext-preview-button",i.click_button)},call_preview:async function(t,e,o,i){e.val("Edit"),o.hide(),i.text("Loading...").fadeIn("fast");let s=o.is("input"),a=await $.post("/dtext_preview",{body:o.val(),inline:s});i.html(a).fadeIn("fast")},call_edit:function(t,e,o,i){e.val("Preview"),i.hide(),o.slideDown("fast")},click_button:function(t){var e=$(t.target),o=e.parents("form"),s=e.data("preview-field"),a=o.find(`div.input.${s} .dtext-previewable`),n=a.find("> input, > textarea"),r=a.find("div.dtext-preview");e.val().match(/preview/i)?i.call_preview(t,e,n,r):i.call_edit(t,e,n,r),t.preventDefault()}};$(document).ready((function(){i.initialize_all()})),e.default=i},68441:(t,e,o)=>{"use strict";o.r(e);var i=o(18535),s=o.n(i);let a={initialize_all:function(){$("#c-posts").length&&$("#a-show").length&&this.initialize_add_to_favgroup_dialog()},initialize_add_to_favgroup_dialog:function(){$("#add-to-favgroup-dialog").dialog({autoOpen:!1,width:700,buttons:{Cancel:function(){$(this).dialog("close")}}}),$("#open-favgroup-dialog-link").on("click.danbooru",a.open_favgroup_dialog)},open_favgroup_dialog:function(t){if(1===$(".add-to-favgroup").length){let t=$(".add-to-favgroup").get(0);s().fire(t,"click")}else $("#add-to-favgroup-dialog").dialog("open");t.preventDefault()}};$((function(){a.initialize_all()})),e.default=a},9196:(t,e,o)=>{"use strict";o.r(e);var i=o(20866),s=o(31051);function a(t,e,o){return(e=function(t){var e=function(t,e){if("object"!==typeof t||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class n{static initialize(){0!==$(n.TARGET_SELECTOR).length&&(n.instance=(0,i.createTooltip)("favorites-tooltip",{delay:[n.SHOW_DELAY,n.HIDE_DELAY],duration:n.DURATION,target:n.TARGET_SELECTOR,onShow:n.onShow,onHide:n.onHide}))}static async onShow(t){let e=$(t.reference),o=$(t.popper),a=e.parents("[data-id]").data("id");(0,s.Bn)({exclude:t});try{o.addClass("tooltip-loading"),t._request=$.get(`/posts/${a}/favorites?variant=tooltip`);let e=await t._request;t.setContent(e),o.removeClass("tooltip-loading")}catch(n){0!==n.status&&"abort"!==n.statusText&&i.default.error(`Error displaying favorites for post #${a} (error: ${n.status} ${n.statusText})`)}}static async onHide(t){var e;"pending"===(null===(e=t._request)||void 0===e?void 0:e.state())&&t._request.abort()}}a(n,"TARGET_SELECTOR","span.post-favcount a"),a(n,"SHOW_DELAY",125),a(n,"HIDE_DELAY",125),a(n,"DURATION",250),a(n,"instance",null),$(document).ready(n.initialize),e.default=n},22472:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>p});var i,s,a,n=o(20247),r=o(20866),c=o(48403),l=o.n(c);class p{static initialize(){$(".file-upload-component").toArray().forEach((t=>{new p($(t))}))}constructor(t){this.$component=t,this.$component.on("ajax:success",(t=>this.onSubmit(t))),this.$component.on("ajax:error",(t=>this.onError(t))),this.$dropTarget.on("paste.danbooru",(t=>this.onPaste(t))),this.dropzone=this.initializeDropzone(),/^https?:\/\//.test(this.$sourceField.val())&&this.$component.find("input[type='submit']").click()}initializeDropzone(){if(!window.FileReader)return this.$dropzone.addClass("hidden"),this.$component.find("input[type='file']").removeClass("hidden"),null;let t=new n.Z(this.$dropTarget.get(0),{url:"/uploads.json",paramName:"upload[files]",clickable:this.$dropzone.get(0),previewsContainer:this.$dropzone.get(0),thumbnailHeight:null,thumbnailWidth:null,addRemoveLinks:!1,parallelUploads:this.maxFiles,maxFiles:this.maxFiles,maxFilesize:this.maxFileSize,maxThumbnailFilesize:this.maxFileSize,timeout:0,uploadMultiple:!0,createImageThumbnails:!1,acceptedFiles:".jpg,.jpeg,.png,.gif,.webp,.avif,.mp4,.webm,.zip,.rar,.7z",previewTemplate:this.$component.find(".dropzone-preview-template").html()});return t.on("complete",(t=>{this.$dropzone.find(".dz-progress").hide()})),t.on("addedfile",(t=>{this.$dropzone.removeClass("error"),this.$dropzone.find(".dropzone-hint").hide()})),t.on("success",(t=>{this.$dropzone.addClass("success");let e=JSON.parse(t.xhr.response);this.pollStatus(e)})),t.on("error",((e,o)=>{this.$dropzone.find(".dropzone-hint").show(),t.removeFile(e),r.default.error(o)})),t}onPaste(t){let e=t.originalEvent.clipboardData.getData("text");this.$component.find("input[name='upload[source]']:not([disabled])").val(e),/^https?:\/\//.test(e)&&this.$component.find("input[type='submit']:not([disabled])").click(),t.preventDefault()}onSubmit(t){let e=t.originalEvent.detail[0];this.pollStatus(e)}loadingStart(){this.$component.find(".spinner-icon").removeClass("hidden"),this.$component.find("input").attr("disabled","disabled"),this.$component.find("form").addClass("pointer-events-none cursor-wait opacity-50")}loadingStop(){this.$component.find(".spinner-icon").addClass("hidden"),this.$component.find("input").removeAttr("disabled"),this.$component.find("form").removeClass("pointer-events-none cursor-wait opacity-50")}async pollStatus(t){for(this.loadingStart();t.media_asset_count<=1&&"completed"!==t.status&&"error"!==t.status;)await r.default.delay(p.POLL_DELAY),t=await $.get(`/uploads/${t.id}.json`);if("error"===t.status)this.$dropzone.removeClass("success"),this.loadingStop(),r.default.error(`Upload failed: ${t.error}.`);else{let e=new URLSearchParams(window.location.search),o=e.has("url");e.delete("url"),e.delete("ref");let i=new URL(`/uploads/${t.id}`,window.location.origin);i.search=e.toString(),o?window.location.replace(i):window.location.assign(i)}}async onError(t){let e=t.originalEvent.detail[0].errors,o=Object.keys(e).map((t=>e[t].map((e=>"base"===t?`${e}`:`${l()(t)} ${e}`)))).join("; ");r.default.error(o)}get $dropzone(){return this.$component.find(".dropzone-container")}get $sourceField(){return this.$component.find("input[name='upload[source]']")}get maxFileSize(){return Number(this.$component.attr("data-max-file-size"))/1048576}get maxFiles(){return Number(this.$component.attr("data-max-files-per-upload"))}get $dropTarget(){return $(this.$component.attr("data-drop-target")||this.$component)}}i=p,a=250,(s=function(t){var e=function(t,e){if("object"!==typeof t||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===typeof e?e:String(e)}(s="POLL_DELAY"))in i?Object.defineProperty(i,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[s]=a,$(p.initialize)},68699:(t,e,o)=>{"use strict";o.r(e);var i=o(20866);class s{static initialize(){$("#c-forum-topics #a-show, #c-forum-posts #a-show").length&&($(document).on("click.danbooru.forum_post",".edit_forum_post_link",s.showEditPostForm),$(document).on("click.danbooru.forum_post",".edit_forum_topic_link",s.showEditTopicForm),$(document).on("click.danbooru.forum_post","#new-response-link",s.showNewForumPostForm),$(document).on("click.danbooru.forum_post",".forum-post-copy-id",s.copyID),$(document).on("click.danbooru.forum_post",".forum-post-copy-link",s.copyLink))}static showNewForumPostForm(t){$("#topic-response").show(),$("#forum_post_body").get(0).scrollIntoView(!1),$("#forum_post_body").selectEnd(),t.preventDefault()}static showEditPostForm(t){$(this).closest(".forum-post").find(".edit_forum_post").show(),t.preventDefault()}static showEditTopicForm(t){$(this).closest(".forum-post").find(".edit_forum_topic").show(),t.preventDefault()}static async copyID(t){let e=`forum #${$(this).closest(".forum-post").data("id")}`;i.default.copyToClipboard(e),t.preventDefault()}static async copyLink(t){let e=$(this).closest(".forum-post").data("id"),o=`${window.location.origin}/forum_posts/${e}`;i.default.copyToClipboard(o),t.preventDefault()}}$(document).ready(s.initialize),e.default=s},966:(t,e,o)=>{"use strict";o.r(e);var i=o(20866);class s{static initialize(){(0,i.createTooltip)("help-tooltip",{target:"a.help-tooltip-link",trigger:"click",touch:"hold",duration:50,content(t){let e=$(t).next(".help-tooltip-content");return e.show(),e.get(0)}})}}$(document).ready(s.initialize),e.default=s},63881:()=>{let t={initialize_all:function(){$(document).on("click.danbooru","a.toggle-iqdb-posts-low-similarity",(function(t){$(".iqdb-low-similarity").toggleClass("hidden"),$("a.toggle-iqdb-posts-low-similarity").toggle(),t.preventDefault()}))}};$(document).ready(t.initialize_all)},81922:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>a});var i=o(74691),s=o.n(i);class a{static initialize(){$(".media-asset-component").toArray().forEach((t=>{new a(t)}))}constructor(t){this.$component=$(t),this.$container=this.$component.find(".media-asset-container"),this.$image=this.$component.find(".media-asset-image"),this.$zoomLevel=this.$component.find(".media-asset-zoom-level"),this.scrollOnZoom="true"===this.$component.attr("data-scroll-on-zoom"),this.dynamicHeight="true"===this.$component.attr("data-dynamic-height"),this.updateHeight(),$(window).on("load.danbooru",(t=>this.updateHeight())),$(window).on("scroll.danbooru",(t=>this.updateHeight())),this.$image.length&&(this.$image.on("click.danbooru",(t=>this.toggleFit(t))),this.$image.on("load.danbooru",(t=>this.updateZoom())),new ResizeObserver((()=>this.updateZoom())).observe(this.$image.get(0)),this.updateZoom())}toggleFit(t){let e=this.$image.get(0).getBoundingClientRect(),o=(t.clientY-e.top)/this.$image.height(),i=this.$component.height()-this.$image.height();this.canZoomOut?this.$component.addClass("media-asset-component-fit-height media-asset-component-fit-width"):this.canZoomHeight&&this.$component.removeClass("media-asset-component-fit-height");let a=this.$component.offset().top,n=this.$image.height(),r=s()(a+o*n-window.innerHeight/2,Math.min(window.scrollY,a),a+n+i-window.innerHeight);this.scrollOnZoom&&window.scrollTo({top:r}),this.updateZoom()}updateZoom(){this.$image.removeClass("cursor-zoom-in cursor-zoom-out"),this.$zoomLevel.removeClass("hidden").text(`${Math.round(100*this.zoomLevel)}%`),this.canZoomIn?this.$image.addClass("cursor-zoom-in"):this.canZoomOut&&this.$image.addClass("cursor-zoom-out")}updateHeight(){this.$component.css("--header-initial-height",Math.max(0,this.$component.parent().offset().top)+"px"),this.$component.css("--header-visible-height",Math.max(0,this.$component.parent().offset().top-$(window).scrollTop())+"px"),this.$component.attr("data-dynamic-height-initialized","true")}get zoomLevel(){return this.$image.width()/Number(this.$image.attr("width"))}get canZoomIn(){return this.canZoomHeight}get canZoomHeight(){return!this.isZoomed&&this.$image.height(){"use strict";o.r(e);var i=o(20866);let s={detailed_rejection_dialog:function(){return $("#post_disapproval_post_id").val($(this).data("post-id")),$("#detailed-rejection-dialog").find("form")[0].reset(),i.default.dialog("Detailed Rejection","#detailed-rejection-dialog"),!1}};$((function(){$(document).on("click.danbooru",".detailed-rejection-link",s.detailed_rejection_dialog)})),e.default=s},28326:(t,e,o)=>{"use strict";o.r(e);var i=o(94141);let s={initialize:function(){if($("#news-updates").length){var t=$("#news-updates").data("id").toString();i.default.get("news-ticker")===t?$("#news-updates").hide():($("#news-updates").show(),$("#close-news-ticker-link").on("click.danbooru",(function(e){return $("#news-updates").hide(),i.default.put("news-ticker",t),!1})))}}};$((function(){s.initialize()})),e.default=s},36520:(t,e,o)=>{"use strict";o.r(e);o(87285),o(91707);var i,s,a=o(55056),n=o(20866);function r(t,e,o){return(e=function(t){var e=function(t,e){if("object"!==typeof t||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class c{constructor({x:t,y:e,w:o,h:i,id:s=null,original_body:a=null,sanitized_body:l=null}={}){r(this,"id",null),r(this,"x",null),r(this,"y",null),r(this,"w",null),r(this,"h",null),r(this,"box",null),r(this,"body",null),r(this,"$note_container",null),r(this,"has_rotation",!1),this.$note_container=$(".note-container"),this.id=s,this.post_id=this.$note_container.data("id"),this.embed="true"===n.default.meta("post-has-embedded-notes"),this.original_body=a,this.x=t,this.y=e,this.w=o,this.h=i,this.box=new c.Box(this),this.body=new c.Body(this),this.box.place_note(t,e,o,i),this.body.display_text(l),c.notes.add(this)}is_new(){return null===this.id}get scale_factor(){return this.$note_container.width()/this.post_width}get post_width(){return parseInt(this.$note_container.attr("data-width"))}get post_height(){return parseInt(this.$note_container.attr("data-height"))}get image_width(){return parseInt(this.$note_container.width())}get image_height(){return parseInt(this.$note_container.height())}get base_font_size(){return parseFloat(this.$note_container.parent().css("font-size"))}is_selected(){return this.box.$note_box.hasClass("movable")}toggle_selected(){return this.is_selected()?this.unselect():this.select()}select(){c.unselect_all(),this.box.$note_box.addClass("movable"),n.default.keydown("up down left right","nudge_note",this.box.key_nudge.bind(this.box)),n.default.keydown("shift+up shift+down shift+left shift+right","resize_note",this.box.key_resize.bind(this.box))}unselect(){this.box.$note_box.removeClass("movable"),$(document).off("keydown.nudge_note"),$(document).off("keydown.resize_note")}normalize_sizes(t,e){0!==t.length&&t.toArray().forEach((t=>{const o=$(t),i=window.getComputedStyle(t),s=parseFloat(i.fontSize);c.NORMALIZE_ATTRIBUTES.forEach((t=>{const e=(parseFloat(i[t])||0)/s;o.css(t,e+"em")}));const a=s/e*100;o.css("font-size",a+"%"),o.attr("size",""),this.normalize_sizes(o.children(),s)}))}static find(t){return Array.from(c.notes).find((e=>e.id===t))}static load_all(){$("#notes article").toArray().forEach((t=>{var e=$(t);new c({id:e.data("id"),x:e.data("x"),y:e.data("y"),w:e.data("width"),h:e.data("height"),original_body:e.data("body"),sanitized_body:e.html()})}))}static initialize_all(){0===$("#c-posts #a-show #image").length||$("video#image").length||$("canvas#image").length||(c.load_all(),c.Box.scale_all(),$(document).on("click.danbooru","#translate",(t=>{c.TranslationMode.toggle(),t.preventDefault()})),this.initialize_highlight(),$(document).on("hashchange.danbooru.note",this.initialize_highlight),$(window).on("resize.danbooru.note_scale",c.Box.scale_all),$("#image").on("click.danbooru",c.Box.toggle_all))}static initialize_highlight(){var t=window.location.hash.match(/^#note-(\d+)$/);if(t){let e=parseInt(t[1]);c.find(e).box.show_highlighted()}}static unselect_all(){c.notes.forEach((t=>t.unselect()))}}r(c,"HIDE_DELAY",250),r(c,"NORMALIZE_ATTRIBUTES",["letter-spacing","line-height","margin-left","margin-right","margin-top","margin-bottom","padding-left","padding-right","padding-top","padding-bottom"]),r(c,"COPY_ATTRIBUTES",["background-color","border-radius","transform","justify-content","align-items"]),r(c,"BOX_LEVEL_CLASSES",Array.from({length:5},((t,e)=>"level-"+(e+1)))),r(c,"RESIZE_HANDLES","se, nw"),r(c,"MIN_NOTE_SIZE",10),r(c,"dragging",!1),r(c,"notes",new Set),r(c,"timeouts",[]),r(c,"Box",class{constructor(t){r(this,"note",null),r(this,"$note_box",null),r(this,"$inner_border",null),this.note=t,this.$note_box=$('
    '),this.note.$note_container.append(this.$note_box),t.embed&&(this.$note_box.addClass("embedded"),this.$inner_border=$('
    '),this.$note_box.append(this.$inner_border)),this.note.is_new()&&this.$note_box.addClass("unsaved"),this.$note_box.draggable({containment:this.note.$note_container}),this.$note_box.resizable({containment:this.note.$note_container,handles:c.RESIZE_HANDLES,minWidth:c.MIN_NOTE_SIZE,minHeight:c.MIN_NOTE_SIZE}),this.$note_box.on("click.danbooru",this.on_click.bind(this)),this.$note_box.on("mouseenter.danbooru",this.on_mouseenter.bind(this)),this.$note_box.on("mouseleave.danbooru",this.on_mouseleave.bind(this)),this.$note_box.on("dragstart.danbooru resizestart.danbooru",this.on_dragstart.bind(this)),this.$note_box.on("dragstop.danbooru resizestop.danbooru",this.on_dragstop.bind(this))}on_click(){n.default.test_max_width(660)?this.$note_box.hasClass("viewing")?(this.note.body.hide(),this.$note_box.removeClass("viewing")):($(".note-box").removeClass("viewing"),this.note.body.show(),this.$note_box.addClass("viewing")):this.note.toggle_selected()}on_mouseenter(){c.dragging||this.note.body.show()}on_mouseleave(){this.note.body.hide()}on_dragstart(){this.$note_box.addClass("unsaved"),c.Body.hide_all(),c.dragging=!0}on_dragstop(){let t=this.$note_box.position().left/this.note.scale_factor,e=this.$note_box.position().top/this.note.scale_factor,o=this.$note_box.width()/this.note.scale_factor,i=this.$note_box.height()/this.note.scale_factor;this.place_note(t,e,o,i),this.note.body.show(),c.dragging=!1}place_note(t,e,o,i,s=!1){if(this.note.embed&&this.note.has_rotation&&!s){let o=this.get_min_max_position();t=o.norm_left/this.note.scale_factor,e=o.norm_top/this.note.scale_factor}this.note.w=Math.round((0,n.clamp)(o,c.MIN_NOTE_SIZE,this.note.post_width)),this.note.h=Math.round((0,n.clamp)(i,c.MIN_NOTE_SIZE,this.note.post_height)),this.note.x=Math.round((0,n.clamp)(t,0,this.note.post_width-this.note.w)),this.note.y=Math.round((0,n.clamp)(e,0,this.note.post_height-this.note.h)),this.$note_box.css({top:100*this.note.y/this.note.post_height+"%",left:100*this.note.x/this.note.post_width+"%",width:100*this.note.w/this.note.post_width+"%",height:100*this.note.h/this.note.post_height+"%"})}copy_style_attributes(){let t=this.$note_box,e=t.find(".note-box-attributes"),o=!1;if(c.COPY_ATTRIBUTES.forEach((i=>{const s=this.permitted_style_values(i,e);t.css(i,s),"transform"===i&&s.startsWith("rotate")&&(o=!0)})),o){const e=Math.round(parseFloat(t.css("left"))),o=Math.round(parseFloat(t.css("top"))),i=this.get_min_max_position();e!==i.norm_left||o!==i.norm_top?(t.css({top:i.percent_top,left:i.percent_left}),t.addClass("out-of-bounds")):t.removeClass("out-of-bounds"),this.note.has_rotation=!0}else this.note.has_rotation=!1;t.removeClass(c.BOX_LEVEL_CLASSES);const i=(e.attr("class")||"").split(/\s+/).filter((t=>c.BOX_LEVEL_CLASSES.includes(t)))[0];i&&t.addClass(i)}permitted_style_values(t,e){if(0===e.length)return"";let o=e.attr("style").split(";").filter((e=>e.match(RegExp(`(^| )${t}:`))));if(0===o.length)return"";let[,i]=o[0].trim().split(":").map((t=>t.trim()));if("background-color"===t){return e.css("background-color").startsWith("rgba")?"":i}if("transform"===t){let t=i.match(/rotate\([^)]+\)/);return t?t[0]:""}return i}key_nudge(t){switch(t.originalEvent.key){case"ArrowUp":this.note.y--;break;case"ArrowDown":this.note.y++;break;case"ArrowLeft":this.note.x--;break;case"ArrowRight":this.note.x++}this.place_note(this.note.x,this.note.y,this.note.w,this.note.h,!0),c.Body.hide_all(),this.$note_box.addClass("unsaved"),t.preventDefault()}key_resize(t){switch(t.originalEvent.key){case"ArrowUp":this.note.h--;break;case"ArrowDown":this.note.h++;break;case"ArrowLeft":this.note.w--;break;case"ArrowRight":this.note.w++}this.place_note(this.note.x,this.note.y,this.note.w,this.note.h),c.Body.hide_all(),this.$note_box.addClass("unsaved"),t.preventDefault()}get_min_max_position(t=null,e=null,o=null,i=null){let s=this.$note_box;const a=window.getComputedStyle(s[0]);t=null===t?parseFloat(a.top):t,e=null===e?parseFloat(a.left):e,o=o||s.height(),i=i||s.width();const r=this.note.image_height,c=this.note.image_width,l=this.get_bounding_box(o,i);return l.max_x-l.min_x<=c&&l.max_y-l.min_y<=r?(t=Math.min(Math.max(t,-l.min_y,0),r-l.max_y-2,r-l.min_y-l.max_y-2,r),e=Math.min(Math.max(e,-l.min_x,0),c-l.max_x-2,c-l.min_x-l.max_x-2,c)):(n.default.error("Box too large to be rotated!"),s.css("transform","none")),{norm_top:Math.round(t),norm_left:Math.round(e),percent_top:t/r*100+"%",percent_left:e/c*100+"%"}}get_bounding_box(t=null,e=null){let o=this.$note_box;t=t||o.height();let i=[[0,0],[e=e||o.width(),0],[0,t],[e,t]];const s=window.getComputedStyle(o[0]).transform.match(/matrix\(([-e0-9.]+), ([-e0-9.]+)/);if(!s)return{min_x:0,min_y:0,max_x:e,max_y:t,norm_coord:i,degrees:0};const a=Math.round(1e3*s[1])/1e3,n=Math.round(1e3*s[2])/1e3;let r=e/2,c=t/2,l=1/0,p=0,d=1/0,g=0;const u=i.map((t=>{let e=t[0]-r,o=t[1]-c,i=e*a-o*n+r,s=e*n+o*a+c;return l=Math.min(l,i),p=Math.max(p,i),d=Math.min(d,s),g=Math.max(g,s),[i,s]})).map((t=>[t[0]-l,t[1]-d])),m=Math.asin(n)/.017453292519943295;return{min_x:l,min_y:d,max_x:p,max_y:g,norm_coord:u,degrees:m}}show_highlighted(){this.note.body.show(),$(".note-box-highlighted").removeClass("note-box-highlighted"),this.$note_box.addClass("note-box-highlighted"),this.$note_box[0].scrollIntoView(!1)}static scale_all(){let t=$(".note-container");if(0===t.length)return;c.Body.hide_all();let e=parseFloat(t.data("large-width")),o=100*(t.width()/e);t.css("font-size",o+"%")}static toggle_all(){c.Body.hide_all(),$(".note-container").toggleClass("hide-notes")}}),r(c,"Body",class{constructor(t){r(this,"note",null),r(this,"$note_body",null),this.note=t,this.$note_body=$('
    '),this.note.$note_container.append(this.$note_body),this.$note_body.on("mouseover.danbooru",this.on_mouseover.bind(this)),this.$note_body.on("mouseout.danbooru",this.on_mouseout.bind(this)),this.$note_body.on("click.danbooru",this.on_click.bind(this))}initialize(){let t=this.$note_body,e=this.note.box.$note_box;if(this.note.embed&&this.note.has_rotation){const o=this.note.box.get_bounding_box();let i=o.norm_coord.reduce((function(t,e){return t[1]>e[1]||t[1]===e[1]&&t[0]0&&s<=45?t.width():0);t.css({top:e.position().top+i[1]+5,left:a+i[0]})}else t.css({top:e.position().top+e.height()+5,left:e.position().left});this.bound_position()}bound_position(){var t=this.note.$note_container,e=t.offset().left+t.width();let o=this.$note_body;o.offset().left+o.width()>e&&o.css({left:o.position().left-10-(o.offset().left+o.width()-e)})}show(){c.Body.hide_all(),this.resized||(this.resize(),this.resized=!0),this.$note_body.show(),this.initialize()}hide(t=c.HIDE_DELAY){c.timeouts.push(setTimeout((()=>this.$note_body.hide()),t))}static hide_all(){c.timeouts.forEach(clearTimeout),c.timeouts=[],$(".note-container div.note-body").hide()}resize(){let t=this.$note_body;t.css("min-width","");var e=t.width(),o=t.height(),i=1.6180339887,s=0,a=0,n=0,r=0;if(e/os)}else if(t[0].scrollWidth<=t.width()){n=20,r=e;do{a=(n+r)/2,t.css("min-width",a),t.height()>o?n=a:r=a}while(r-n>4);t.height()>o&&t.css("min-width",r)}}display_text(t){if(this.set_text(t),this.note.embed){let t=this.note.box.$inner_border;t.css("font-size",this.note.base_font_size+"px"),this.note.normalize_sizes(t.children(),this.note.base_font_size),t.css("font-size",""),this.note.box.copy_style_attributes()}this.resize(),this.bound_position()}set_text(t){var e;t=(t=(t=(t=null!==(e=t)&&void 0!==e?e:"").replace(//g,'

    ')).replace(/<\/tn>/g,"

    ")).replace(/\n/g,"
    "),this.note.embed?(this.note.box.$inner_border.html(t),this.$note_body.html("Click to edit")):t?this.$note_body.html(t):this.$note_body.html("Click to edit")}async preview_text(t){this.display_text("Loading...");let e=await $.post("/note_previews",{body:t});this.display_text(e.body),this.initialize(),this.$note_body.show()}on_mouseover(t){this.show()}on_mouseout(){this.hide()}on_click(t){$(t.target).is("a")||(a.default.data("is-anonymous")?n.default.notice("You must be logged in to edit notes"):c.Edit.show(this.note))}}),r(c,"Edit",class{static show(t){if($(".note-box").hasClass("editing"))return;let e=$('');e.val(t.original_body),e.css({height:"85%",resize:"none"});let o=$("
    "),i=t.is_new()?"Creating new note":`Editing note #${t.id}`;o.append(""+i+' (
    view help)'),o.append(e),o.dialog({width:360,height:240,position:{my:"right",at:"right-20",of:window},classes:{"ui-dialog":"note-edit-dialog"},open:()=>{n.default.keydown("ctrl+return","save_note",(()=>this.save(o,t)),".note-edit-dialog textarea"),$(".note-edit-dialog textarea").on("input.danbooru",(e=>this.on_input(t))),$(".note-box").addClass("editing")},close:()=>{$(".note-box").removeClass("editing")},buttons:{Save:()=>c.Edit.save(o,t),Preview:()=>c.Edit.preview(o,t),Cancel:()=>c.Edit.cancel(o,t),Delete:()=>c.Edit.destroy(o,t),History:()=>c.Edit.history(o,t)}}),e.selectEnd()}static on_input(t){t.box.$note_box.addClass("unsaved")}static async save(t,e){let o=e.box.$note_box,i=t.find("textarea").val(),s={x:e.x,y:e.y,width:e.w,height:e.h,body:i};e.original_body=i,e.body.preview_text(i);try{if(e.is_new()){s.post_id=e.post_id;let t=await $.ajax("/notes.json",{type:"POST",data:{note:s}});e.id=t.id}else await $.ajax(`/notes/${e.id}.json`,{type:"PUT",data:{note:s}});t.dialog("close"),o.removeClass("unsaved")}catch(a){n.default.error("Error: "+(a.responseJSON.reason||a.responseJSON.reasons.join("; ")))}}static async preview(t,e){let o=t.find("textarea").val();e.body.preview_text(o)}static cancel(t,e){t.dialog("close")}static async destroy(t,e){(e.is_new()||confirm("Do you really want to delete this note?"))&&(e.is_new()||await $.ajax(`/notes/${e.id}.json`,{type:"DELETE"}),e.box.$note_box.remove(),e.body.$note_body.remove(),c.notes.delete(e),t.dialog("close"))}static history(t,e){e.is_new()||(window.location.href=`/note_versions?search[note_id]=${e.id}`),t.dialog("close")}}),r(c,"TranslationMode",(r(i=class{static toggle(){$("body").hasClass("mode-translation")?c.TranslationMode.stop():c.TranslationMode.start()}static start(){$(document.body).addClass("mode-translation"),$("#image").off("click.danbooru",c.Box.toggle_all),$("#image").on("mousedown.danbooru.note",c.TranslationMode.Drag.start),n.default.notice('Translation mode is on. Drag on the image to create notes. Turn translation mode off (shortcut is n).'),$("#notice a:contains(Turn translation mode off)").on("click.danbooru",c.TranslationMode.stop)}static stop(){$("#note-preview").hide(),$("#image").on("click.danbooru",c.Box.toggle_all),$("#image").off("mousedown.danbooru.note",c.TranslationMode.Drag.start),$(document).off("mouseup.danbooru",c.TranslationMode.Drag.stop),$(document).off("mousemove.danbooru",c.TranslationMode.Drag.drag),$(document.body).removeClass("mode-translation"),$("#close-notice-link").click()}},"Drag",(r(s=class{static start(t){1===t.which&&(t.preventDefault(),$(document).on("mousemove.danbooru",c.TranslationMode.Drag.drag),$(document).on("mouseup.danbooru",c.TranslationMode.Drag.stop),c.TranslationMode.Drag.dragStartX=t.pageX,c.TranslationMode.Drag.dragStartY=t.pageY,c.dragging=!0)}static drag(t){var e=$("#image"),o=e.offset();let i=(0,n.clamp)(t.pageX,o.left,c.TranslationMode.Drag.dragStartX),s=(0,n.clamp)(t.pageY,o.top,c.TranslationMode.Drag.dragStartY),a=(0,n.clamp)(t.pageX,c.TranslationMode.Drag.dragStartX,o.left+e.width()),r=(0,n.clamp)(t.pageY,c.TranslationMode.Drag.dragStartY,o.top+e.height()),l=i-o.left,p=s-o.top,d=a-i,g=r-s;(d>=c.MIN_NOTE_SIZE||g>=c.MIN_NOTE_SIZE)&&$("#note-preview").show(),$("#note-preview").is(":visible")&&$("#note-preview").css({left:l,top:p,width:d,height:g})}static stop(){if(c.dragging=!1,$(document).off("mousemove.danbooru",c.TranslationMode.Drag.drag),$(document).off("mouseup.danbooru",c.TranslationMode.Drag.stop),$("#note-preview").is(":visible")){let t=$(".note-container").width()/parseInt($(".note-container").attr("data-width"));new c({x:$("#note-preview").position().left/t,y:$("#note-preview").position().top/t,w:$("#note-preview").width()/t,h:$("#note-preview").height()/t}),$("#note-preview").hide(),$(".note-container").removeClass("hide-notes")}else c.Box.toggle_all()}},"dragStartX",0),r(s,"dragStartY",0),s)),i)),$((function(){c.initialize_all()})),e.default=c},83013:(t,e,o)=>{"use strict";o.r(e),o(62526),o(71902);let i={initialize_all:function(){$("#c-posts").length&&$("#a-show").length&&this.initialize_add_to_pool_link(),$("#c-pool-orders,#c-favorite-group-orders").length&&this.initialize_simple_edit()},initialize_add_to_pool_link:function(){$("#add-to-pool-dialog").dialog({autoOpen:!1}),$("#pool").on("click.danbooru",(function(t){t.preventDefault(),$("#add-to-pool-dialog").dialog("open")}))},initialize_simple_edit:function(){$("#sortable").sortable({placeholder:"ui-state-placeholder"}),$("#sortable").disableSelection(),$("#ordering-form").submit((function(t){$.ajax({type:"put",url:t.target.action,data:$("#sortable").sortable("serialize")+"&"+$(t.target).serialize()}),t.preventDefault()}))}};$(document).ready((function(){i.initialize_all()})),e.default=i},78122:(t,e,o)=>{"use strict";o.r(e);var i=o(20866);class s{static initialize(){(0,i.createTooltip)("popup-menu-tooltip",{target:"a.popup-menu-button",placement:"bottom-start",trigger:"click",touch:"hold",appendTo:"parent",animation:null,content:s.content}),$(document).on("click.danbooru",".popup-menu-content",s.onMenuItemClicked)}static content(t){let e=$(t).parents(".popup-menu").find(".popup-menu-content");return e.show(),e.get(0)}static onMenuItemClicked(t){let e=$(t.target).parents(".popup-menu").data("hide-on-click"),o=$(t.target).parents("li").data("hide-on-click");if(void 0!==o?o:e){var i;let e=null===(i=$(t.target).parents("[data-tippy-root]").get(0))||void 0===i?void 0:i._tippy;null===e||void 0===e||e.hide()}}}$(document).ready(s.initialize),e.default=s},24596:(t,e,o)=>{"use strict";o.r(e);var i=o(86168),s=o(20866);let a={initialize:function(){($("#c-posts").length||$("#c-favorites").length||$("#c-pools").length)&&(this.initialize_selector(),this.initialize_preview_link(),this.initialize_edit_form(),this.initialize_tag_script_field(),this.initialize_shortcuts(),a.change())},initialize_shortcuts:function(){s.default.keydown("1 2 3 4 5 6 7 8 9 0","change_tag_script",a.change_tag_script)},show_notice:function(t,e=0){"add-fav"===t?s.default.notice("Switched to favorite mode. Click a post to favorite it."):"remove-fav"===t?s.default.notice("Switched to unfavorite mode. Click a post to unfavorite it."):"edit"===t?s.default.notice("Switched to edit mode. Click a post to edit it."):"tag-script"===t&&s.default.notice(`Switched to tag script #${e}. To switch tag scripts, use the number keys.`)},change_tag_script:function(t){if("tag-script"===$("#mode-box select").val()){var e=localStorage.getItem("current_tag_script_id")||"1",o=t.which>=96?t.which-48:t.which,i=String.fromCharCode(o),s=localStorage.getItem("tag-script-"+i);$("#tag-script-field").val(s),localStorage.setItem("current_tag_script_id",i),e!==i&&a.show_notice("tag-script",i),t.preventDefault()}},initialize_selector:function(){let t=localStorage.getItem("mode");null===t?(localStorage.setItem("mode","view"),$("#mode-box select").val("view")):$("#mode-box select").val(t),$("#mode-box select").on("change.danbooru",(function(t){a.change(),$("#tag-script-field:visible").focus().select()}))},initialize_preview_link:function(){$(document).on("click.danbooru",".post-preview-container a",a.click)},initialize_edit_form:function(){$("#quick-edit-div").hide(),$(document).on("click.danbooru","#quick-edit-form button[name=cancel]",(function(t){a.close_edit_form(),t.preventDefault()})),$(document).on("click.danbooru","#quick-edit-form input[type=submit]",(async function(t){t.preventDefault();let e=$("#quick-edit-form").attr("data-post-id");await i.default.update(e,"quick-edit",{post:{tag_string:$("#post_tag_string").val()}})}))},close_edit_form:function(){$("#quick-edit-div").slideUp("fast"),$("#post_tag_string").data("uiAutocomplete").close()},initialize_tag_script_field:function(){$("#tag-script-field").blur((function(t){var e=$(this).val();if(e){var o=localStorage.getItem("current_tag_script_id");localStorage.setItem("tag-script-"+o,e)}else $("#mode-box select").val("view"),a.change()}))},change:function(){$("#quick-edit-div").slideUp("fast");var t=$("#mode-box select").val();if(void 0!==t)if($("body").attr("data-mode-menu-active","view"!==t),$("body").attr("data-mode-menu",t),localStorage.setItem("mode",t,1),"tag-script"===t){var e=localStorage.getItem("current_tag_script_id");e||(e="1",localStorage.setItem("current_tag_script_id",e));var o=localStorage.getItem("tag-script-"+e);$("#tag-script-field").val(o).show(),a.show_notice(t,e)}else $("#tag-script-field").hide(),a.show_notice(t)},open_edit:function(t){var e=$("#post_"+t);$("#quick-edit-div").slideDown("fast"),$("#quick-edit-form").attr("data-post-id",t),$("#post_tag_string").val(e.data("tags")+" ").focus().selectEnd()},click:function(t){var e=$("#mode-box select").val(),o=$(t.target).closest("article").data("id");if("add-fav"===e)i.default.tag(o,"fav:me");else if("remove-fav"===e)i.default.tag(o,"-fav:me");else if("edit"===e)a.open_edit(o);else{if("tag-script"!==e)return;var s,n=localStorage.getItem("current_tag_script_id"),r=null!==(s=localStorage.getItem("tag-script-"+n))&&void 0!==s?s:"";i.default.tag(o,r)}t.preventDefault()}};$((function(){a.initialize()})),e.default=a},84785:(t,e,o)=>{"use strict";o.r(e);var i=o(55056),s=o(20866),a=o(31051);o(22506);let n={POST_SELECTOR:"*:not(.ui-sortable-handle) > .post-preview .post-preview-image, .dtext-post-id-link",SHOW_DELAY:500,HIDE_DELAY:125,DURATION:250,instance:null,initialize:function(){n.disabled()||(n.instance=(0,s.createTooltip)("post-tooltip",{delay:[n.SHOW_DELAY,n.HIDE_DELAY],duration:n.DURATION,target:n.POST_SELECTOR,touch:!1,onCreate:n.on_create,onShow:n.on_show,onHide:n.on_hide}),$(document).on("click.danbooru.postTooltip",".post-tooltip-disable",n.on_disable_tooltips))},on_create:function(t){if(t.reference===document.body)return;let e=t.reference.getAttribute("title");e&&(t.reference.setAttribute("data-title",e),t.reference.setAttribute("title","")),$(t.reference).on("mousemove.danbooru",(e=>{t.clearDelayTimeouts(),t.reference.dispatchEvent(new Event("mouseenter"))}))},on_show:async function(t){let e=null,o=!1,i=$(t.reference),n=$(t.popper);if((0,a.Bn)({exclude:t}),!n.has(".post-tooltip-body").length){i.is(".dtext-post-id-link")?(o=!0,e=/\/posts\/(\d+)/.exec(i.attr("href"))[1]):e=i.parents("[data-id]").data("id");try{n.addClass("tooltip-loading"),t._request=$.get(`/posts/${e}`,{variant:"tooltip",preview:o});let i=await t._request;t.setContent(i),n.removeClass("tooltip-loading")}catch(r){0!==r.status&&"abort"!==r.statusText&&s.default.error(`Error displaying tooltip for post #${e} (error: ${r.status} ${r.statusText})`)}}},on_hide:function(t){var e;"pending"===(null===(e=t._request)||void 0===e?void 0:e.state())&&t._request.abort()},disabled:function(t){return i.default.data("disable-post-tooltips")},on_disable_tooltips:async function(t){t.preventDefault(),(0,a.Bn)(),i.default.data("is-anonymous")?s.default.notice('You must login to disable tooltips'):(await i.default.update({disable_post_tooltips:!0}),s.default.notice('Tooltips disabled; check your account settings to re-enable.'),n.instance[0].destroy())}};$(document).ready(n.initialize),e.default=n},7832:(t,e,o)=>{"use strict";o.r(e);var i=o(20866);let s={initialize_all:function(){$("#c-post-versions #a-index").length&&s.initialize_undo()},initialize_undo:function(){$(".post-version-select-column").on("click.danbooru",(function(t){$(t.target).find(".post-version-select-checkbox:not(:disabled)").prop("checked",((t,e)=>!e)).change()})),$("#post-version-select-all-checkbox").on("change.danbooru",(function(t){$("td .post-version-select-checkbox:not(:disabled)").prop("checked",$("#post-version-select-all-checkbox").prop("checked")).change()})),$(".post-version-select-checkbox").on("change.danbooru",(function(t){let e=$("td .post-version-select-checkbox:checked");$("#subnav-undo-selected-link").text(`Undo selected (${e.length})`).toggle(e.length>0)})),$("#subnav-undo-selected-link").on("click.danbooru",s.undo_selected)},undo_selected:async function(){event.preventDefault();let t=0,e=$("td .post-version-select-checkbox:checked").parents("tr");for(let o of e){let s=$(o).data("id");await $.ajax(`/post_versions/${s}/undo.json`,{method:"PUT"}),t++,i.default.notice(`${t}/${e.length} changes undone.`)}}};$(document).ready(s.initialize_all),e.default=s},3045:(t,e,o)=>{"use strict";o.r(e);var i=o(20866);function s(t,e,o){return(e=function(t){var e=function(t,e){if("object"!==typeof t||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class a{static initialize(){a.instance=(0,i.createTooltip)("post-votes-tooltip",{delay:[a.SHOW_DELAY,a.HIDE_DELAY],duration:a.DURATION,target:a.TARGET_SELECTOR,onShow:a.onShow,onHide:a.onHide})}static async onShow(t){let e=$(t.reference),o=$(t.popper),s=e.parents("[data-id]").data("id");try{o.addClass("tooltip-loading"),t._request=$.get(`/post_votes?search[post_id]=${s}`,{variant:"tooltip"});let e=await t._request;t.setContent(e),o.removeClass("tooltip-loading")}catch(a){0!==a.status&&"abort"!==a.statusText&&i.default.error(`Error displaying votes for post #${s} (error: ${a.status} ${a.statusText})`)}}static async onHide(t){var e;"pending"===(null===(e=t._request)||void 0===e?void 0:e.state())&&t._request.abort()}}s(a,"TARGET_SELECTOR","span.post-votes span.post-score > a"),s(a,"SHOW_DELAY",375),s(a,"HIDE_DELAY",125),s(a,"DURATION",250),s(a,"instance",null),$(document).ready(a.initialize),e.default=a},86168:(t,e,o)=>{"use strict";o.r(e);var i=o(55056),s=o(20866),a=o(50840),n=o.n(a),r=o(94141),c=o(36520),l=o(74569),p=o(18535),d=o.n(p);function g(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,i)}return o}function u(t){for(var e=1;e{f.initialize_saved_searches()}))},initialize_gestures:function(){if(!i.default.data("disable-mobile-gestures")){var t=$("body");if(!t.data("hammer")&&s.default.test_max_width(660)){$(".image-container").css({overflow:"visible"});var e=$(".paginator a[rel~=prev]").length,o=$(".paginator a[rel~=next]").length,a=new(n())(t[0],{touchAction:"pan-y",recognizers:[[n().Swipe,{threshold:f.SWIPE_THRESHOLD,velocity:f.SWIPE_VELOCITY,direction:n().DIRECTION_HORIZONTAL}]],inputClass:n().TouchInput});t.data("hammer",a),e&&a.on("swiperight",(async function(t){$("body").css({"transition-timing-function":"ease","transition-duration":"0.2s",opacity:"0",transform:"translateX(150%)"}),await s.default.delay(200),f.swipe_prev(t)})),o&&a.on("swipeleft",(async function(t){$("body").css({"transition-timing-function":"ease","transition-duration":"0.2s",opacity:"0",transform:"translateX(-150%)"}),await s.default.delay(200),f.swipe_next(t)}))}}},initialize_edit_dialog:function(){$("#open-edit-dialog").show().on("click.danbooru",(function(t){f.open_edit_dialog(),t.preventDefault()}))},open_edit_dialog:function(){if(1!==$("#edit-dialog").length){$(document).trigger("danbooru:open-post-edit-dialog"),$("#edit").show(),$("#comments").hide(),$("#post-sections li").removeClass("active"),$("#post-edit-link").parent("li").addClass("active"),$(".upload-container").css("display","block");var t=$("#post_tag_string");$("body.c-uploads .docking-menu-tab").hide();var e=$("
    ").attr("id","edit-dialog");$("#form").appendTo(e),e.dialog({title:"Edit tags",width:f.EDIT_DIALOG_WIDTH,height:Math.max(.5*$(window).height(),f.EDIT_DIALOG_MIN_HEIGHT),position:{my:"right top",at:"right-20 top+20",of:window},drag:function(e,o){t.data("uiAutocomplete").close()},close:f.close_edit_dialog}),e.dialog("widget").draggable("option","containment","none");var o=$("