text: var webextMenus=function(){"use strict";const e=browser.menus||browser.contextMenus,n=new Set(["all","bookmark","browser_action","launcher","page_action","tab","tools_menu"]),t=Object.values(e.ContextType).filter(e=>!n.has(e));return function(n){const o=new Map,s=[],c=[];function i(e){return e.contexts?e.contexts:null!=e.parentId?i(o.get(e.parentId)):["page"]}function r(n){n.id=e.create(Object.assign({},n.options)),n.isCreated=!0}function a(n){e.remove(n.id),n.isCreated=!1}function u(e){if(e.nextSibling)for(const n of Object.values(e.nextSibling))n.isCreated&&a(n),u(n)}function f(e){if(e.nextSibling)for(const n of Object.values(e.nextSibling))!n.isCreated&&n.show&&r(n),f(n)}return function(e){const n={};for(const a of e){null!=a.id&&o.set(a.id,a),a.options=Object.assign({},a),"function"==typeof a.checked&&(delete a.options.checked,c.push(a)),a.oncontext?(delete a.options.oncontext,s.push(a),a.show=!1):(r(a),a.show=!0);for(const e of i(a).reduce((e,n)=>("all"===n?t.forEach(n=>e.add(n)):e.add(n),e),new Set)){n[e]||(n[e]=new Map);const t=n[e].get(a.parentId);t&&(t.nextSibling||(t.nextSibling={}),t.nextSibling[e]=a),n[e].set(a.parentId,a)}}}(n),{update:function(){!function(){const e=[];for(const n of s){const t=Boolean(n.oncontext());n.show!==t&&(t?(e.push(n),n.show=!0):(a(n),n.show=!1))}for(const n of e)n.isCreated||(u(n),r(n),f(n))}(),function(){for(const n of c)e.update(n.id,{checked:n.checked()})}()}}}}();
  //# sourceMappingURL=webext-menus.min.js.map
  