PageSourceSearch

https://www.ehn.org/static/dist/social-ux/8696.b8090912d44fa9a8d557.bundle.js

js ehn.org collected 2026-09-24 08:46:10 UTC 16,960 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunksocialUX=self.webpackChunksocialUX||[]).push([[8696],{6580:function(t,e,r){r.d(e,{Tj:function(){return i},pb:function(){return o},qI:function(){return c},qh:function(){return u}});var n=r(2452),o=(0,n.A)((function(t,e){return e.filter(t)})),i=(0,n.A)((function(t,e){return e.map(t)})),u=(0,n.A)((function(t,e){return e.indexOf(t)})),c=(0,n.A)((function(t,e){return e.flatMap(t)}))},8696:function(t,e,r){r.r(e),r.d(e,{default:function(){return It}});var n=r(2452);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function c(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var s=r(3201);function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var f=function(t,e){return t.getUserInfo().then((function(t){return t.runnerSite.permissions})).catch((function(t){return console.log(t),{}})).then((function(r){var n=e.closest("[data-section-id]"),o=n?parseInt(n.dataset.sectionId,10):null,i=e.closest("[data-source]"),u=i?i.dataset.source:null,c=function(t,e){try{return JSON.parse(t)}catch(t){return[]}}(e.dataset.frozenSections);return{appContext:t,postElement:e,sectionId:o,source:u,permissions:r,postId:e.getAttribute("elid")||e.dataset.userPrefs,isFrozen:c.includes(o)}}))},p=r(406),y=r(6580),m=r(1335),b=r(5874);function d(t,e,r,n){var o={post_id:t,action:e?"unfreeze_post":"freeze_post",section_id:r,position:n};return(0,b.af)("/core/roar/post_actions","POST",o)}var v,h=r(2104),g=r(7698);function A(t){return v=t}var O=function(t){if(t<0)throw t;return t},S=(0,m.A)((function(t,e){(0,h.A)(t.isFrozen?"Post unfrozen":"Post frozen","success"),t.isFrozen=!t.isFrozen,e.classList.toggle("active")})),j=function(t){console.error(t),(0,h.A)(t.error||t.message||"There was an error freezing this post","error")},w=r(6044),P=r(7107),I=r(6128);function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var C="There was an error removing this post",z={title:"Information",body:"Are you sure you want to delete this post?",negativeAction:{label:"Cancel",callback:P.A}},k=(0,n.A)((function(t,e){return e!=t})),N=(0,m.A)((function(t){t.remove(),(0,h.A)("Post successfully removed","success")})),q=(0,n.A)((function(t,e){t.classList.remove("hidden"),(0,h.A)(e.error||e.message||C,"error")})),x=(0,m.A)((function(t,e,r){var n=(0,I.A)(".post-context-".concat(e),t);if(n&&n.post&&n.post.sections){var o=n.post.sections;return t.classList.add("hidden"),function(t,e){var r={sections:e,post_id:t,action:"move_post_to_sections"};return(0,b.af)("/core/roar/post_actions","POST",r)}(e,o.filter(k(r))).then(N(t)).catch(q(t))}(0,h.A)(C,"error")}));function U(t){var e=t.postId,r=t.sectionId,n=t.postElement;return{label:"Remove",callback:x(n,e,r)}}var F=(0,n.A)((function(t,e){return r=t.replace("{POST_ID}",e.postId),window.open(r,"_blank");var r})),M={freeze:function(t,e){return(r=t.sectionId,(0,g.A)(v).catch((function(){return(0,b.mQ)("/core/feeds/site/section_posts_ordered?section_id=".concat(r,"&limit=100&offset=0"))})).then(A)).then((0,y.qh)(parseInt(t.postId,10))).then(O).then((0,p.A)(d,t.postId,t.isFrozen,t.sectionId)).then(S(t,e)).catch(j);var r},remove:function(t){(0,w.A)(t.appContext,D(D({},z),{},{possitiveAction:U(t)}))},edit:F("/r/entryeditor/{POST_ID}"),socialScheduling:F("/r/entryeditor/{POST_ID}#social_scheduling"),socialCopy:F("/r/entryeditor/{POST_ID}#social"),stats:F("/r/entryeditor/{POST_ID}#stats")},L=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.every((function(e){return e(t)}))}},$=function(t){return![null,void 0].includes(t.sectionId)&&!isNaN(Number(t.sectionId))},Q=(0,n.A)((function(t,e){return e.permissions[t]||!1})),R=r(8359);function H(t){var e=document.createElement("template");return e.innerHTML=t,e.content.firstElementChild}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var B=function(t){return Object.entries(t||{}).reduce((function(t,e){var r,n,o=(n=2,function(t){if(Array.isArray(t))return t}(r=e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,c=[],a=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;a=!1}else for(;
1!(a=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{if(!a&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(s)throw o}}return c}}(r,n)||function(t,e){if(t){if("string"==typeof t)return X(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],u=o[1];return"".concat(t," data-").concat(i,'="').concat(u,'"')}),"")};function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function K(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function V(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?K(Object(r),!0).forEach((function(e){W(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function W(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=J(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=J(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==J(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Y,Z,tt,et=(0,R.A)((function(t){var e=t.className,r=t.title,n=t.icon,o=t.iconClass,i=t.dataAttrs,u=t.isActive;return'<span\n        class="'.concat(function(t,e){return["hover-menu",t,e?"active":""].join(" ")}(e,u),'"\n        title="').concat(r,'"\n        ').concat(B(i),'>\n        <i class="').concat(o||"material-icons",'">').concat(n||"","</i>\n    </span>")}),H),rt={freeze:function(t){return t.isFrozen}},nt=(0,n.A)((function(t,e){var r=e.name in rt&&rt[e.name](t);return V(V({},e),{},{isActive:r})})),ot=function(t){return function(e){return e.then(t)}},it=(0,R.A)((function(t){return[t,[{name:"edit",className:"edit",title:"Edit",icon:"edit",requirement:Q("edit_post")},{name:"freeze",className:"freeze",title:"Freeze Post: keep this story in this spot on the page",icon:"ac_unit",requirement:L($,Q("reorder_frontpage"))},{name:"socialScheduling",className:"editor-tab",title:"Social Scheduling",icon:"share",requirement:Q("edit_post"),dataAttrs:{"tab-id":"social_scheduling"}},{name:"socialCopy",className:"editor-tab",title:"Social Copy",icon:null,iconClass:"icons--social",requirement:Q("edit_post"),dataAttrs:{"tab-id":"stats"}},{name:"stats",className:"editor-tab",title:"Stats",icon:"trending_up",requirement:Q("edit_post"),dataAttrs:{"tab-id":"social_scheduling"}},{name:"remove",className:"remove",title:"Remove",icon:"delete",requirement:L($,Q("delete_post"))}]]}),(function(t){var e,r,n=(r=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,c=[],a=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{if(!a&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(s)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return l(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}
1(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=n[0],i=n[1];return[o,i.filter((function(t){return t.requirement(o)}))]}),(function(t){var e,r,n=(r=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,c=[],a=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{if(!a&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(s)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return G(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(t,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=n[0],i=n[1],u=(0,R.A)(nt(o),et);return[o,i.map((function(t){return V(V({},t),{},{html:u(t)})}))]}),(tt="click",Y=function(t,e){return t.addEventListener(tt,(function(r){return e(t,r)})),t},Z=M,function(t){var e,r,n=(r=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,c=[],a=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{if(!a&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(s)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=n[0];return n[1].map((function(t){return u(u({},t),{},{html:Y(t.html,(function(e){return Z[t.name](o,e)}))})}))}),(function(t){var e,r=H('<div class="user-prefs">\n            <div class="hover-menu-options"></div>\n        </div>');return(0,R.A)(function(t){return function(e){return(0,g.A)(e.querySelector(t))}}(".hover-menu-options"),ot((e=t.map((function(t){return t.html})),function(t){return e.forEach((function(e){return t.appendChild(e)})),t})),ot((function(){return r})))(r)})),ut=(0,n.A)((function(t,e){return f(t,e).then(it).then((function(t){return e.matches("[data-user-prefs]")?e.appendChild(t):(n=t,(r=e).parentNode.insertBefore(n,r.nextSibling));var r,n}))})),ct=r(6088),at=function(){return r.e(2721).then(r.bind(r,2721))},st=function(){return r.e(9029).then(r.bind(r,9029))},lt=function(){return r.e(7502).then(r.bind(r,7502))};function ft(t){return t.default}function pt(t){var e=t.profile;return e&&e.type_name&&"technical"===e.type_name.toLowerCase()}function yt(t){return t?r.e(1902).then(r.bind(r,1902)).then(ft):Promise.resolve(P.A)}var mt,bt=(0,n.A)((function(t,e){e(t)})),dt=r(4724),vt=Date.now();function ht(t){return mt={runnerSite:t.parent_site,profileSite:t.user_site,user:t.user,sites:t.sites,menu:t.menu}}var gt=r(6121),At=r(9496);function Ot(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,c=[],a=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{if(!a&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return St(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?St(t,e):void 0}}
1(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function St(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var jt=[function(t){var e,r,n;return(0,gt.ux)()&&(0,At.A)("https://fonts.googleapis.com/icon?family=Material+Icons",P.A,P.A),(0,At.A)("/static/css-build/roar/runner/base/user-prefs.css?ts=".concat((n=(0===(r=(e=new Date).getDay())?-6:1)-r,e.setDate(e.getDate()+n),e.setHours(0,0,0,0),e.getTime())),P.A,P.A),t},function(t){return(0,s.A)("article[elid],[data-user-prefs]",ut(t))},function(t){return t.settings.useRiver?(function(t){(0,ct.A)(".rebel-use-info-wrapper",at,t)}(t),t):t},function(t){return(0,ct.A)(".site-avatar-edit,.site-about-edit,.site-title-edit",st,t,!0),t},function(t){return(0,ct.A)("nav.menu-global ul#main-menu",lt,t),t},function(t){return(0,b.mQ)("/core/account/data").then(pt).then(yt).then(bt(t)).catch(console.error),t}],wt=(0,n.A)((function(t,e){(0,Ot(e,1)[0])(t)})),Pt=(0,n.A)((function(t,e){var r=Ot(e,2);r[0],(0,r[1])(t)}));function It(t,e,r){var n=!1;function o(t,r){t?e.forEach(Pt(t)):e.forEach(wt(r)),e.length=0,n=!1}function i(t,r){e.push([t,r])}function u(t){return n?new Promise(i):(n=!0,(e=t,!e&&mt?Promise.resolve(mt):(vt=Date.now(),(0,b.mQ)("/core/users/light_settings.js?v=".concat(vt)).then(ht))).then((function(t){return o(null,t),t})).catch((function(t){throw o(t),t})));var e}function c(){u(!0).then((function(t){r.forEach((function(e){return e(null,t)}))})).catch((function(t){r.forEach((function(e){return e(t,null)}))}))}return t.getUserInfo=u,t.listenForUserInfo=function(t){r.push(t),u().then((function(e){t(null,e)})).catch((function(e){t(e,null)}))},t.refreshUserInfo=c,r.length&&c(),(0,dt.A)(jt,t)}}}]);
2//# sourceMappingURL=8696.b8090912d44fa9a8d557.bundle.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.