HEX
Server: LiteSpeed
System: Linux cde2.duelhost.dk 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User: dtptviut (1121)
PHP: 8.0.30
Disabled: exec,system,passthru,shell_exec,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/dtptviut/domains/faceroller.dk/private_html/wp-content/plugins/404-to-301/build/addons.js
(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{activateLicense:()=>x,deactivateLicense:()=>j,refresh:()=>f,replaceItem:()=>g,setItems:()=>p,setLoading:()=>y,setRefreshing:()=>v});var s={};e.r(s),e.d(s,{getItemById:()=>S,getItems:()=>b,isLoading:()=>w,isRefreshing:()=>E});var i={};e.r(i),e.d(i,{getItems:()=>k});var r={};e.r(r),e.d(r,{abort:()=>M,setStarting:()=>P,setStatus:()=>C,start:()=>F,tick:()=>D});var n={};e.r(n),e.d(n,{getRemaining:()=>H,getStatus:()=>O,isRunning:()=>B,isStarting:()=>$});var a={};e.r(a),e.d(a,{getStatus:()=>U});const o=window.wp.apiFetch;var c=e.n(o);(()=>{if("undefined"!=typeof d404&&(d404.restNonce&&c().use(c().createNonceMiddleware(d404.restNonce)),d404.adminUrl)){const e=d404.adminUrl.replace(/wp-admin\/?$/,"");c().use(c().createRootURLMiddleware(`${e}wp-json/`))}})();const d=window.wp.data,l={items:[],isLoading:!1,isRefreshing:!1},u={API_FETCH:({request:e})=>c()(e)},h=window.wp.i18n,m=window.wp.notices,_="/404-to-301/v1/addons",p=e=>({type:"SET_ITEMS",items:e}),g=e=>({type:"REPLACE_ITEM",addon:e}),y=e=>({type:"SET_LOADING",isLoading:!!e}),v=e=>({type:"SET_REFRESHING",isRefreshing:!!e});function*f(){yield v(!0);try{const e=yield{type:"API_FETCH",request:{path:`${_}/refresh`,method:"POST"}};yield p(Array.isArray(e?.items)?e.items:[]),(0,d.dispatch)(m.store).createSuccessNotice((0,h.__)("Add-on list refreshed.","404-to-301"))}catch(e){(0,d.dispatch)(m.store).createErrorNotice(e?.message||(0,h.__)("Could not refresh the add-on list.","404-to-301"))}finally{yield v(!1)}}function*x(e,t){try{const s=yield{type:"API_FETCH",request:{path:`${_}/${encodeURIComponent(e)}/license`,method:"POST",data:{key:t}}};return s?.success?(yield g(s.addon),(0,d.dispatch)(m.store).createSuccessNotice((0,h.__)("License activated.","404-to-301")),{success:!0}):{success:!1,error:(0,h.__)("License activation failed. Please double-check the key and try again.","404-to-301")}}catch(e){return{success:!1,error:e?.message||(0,h.__)("License activation failed. Please try again.","404-to-301")}}}function*j(e){try{const t=yield{type:"API_FETCH",request:{path:`${_}/${encodeURIComponent(e)}/license`,method:"DELETE"}};return t?.success?(yield g(t.addon),(0,d.dispatch)(m.store).createSuccessNotice((0,h.__)("License deactivated.","404-to-301")),{success:!0}):{success:!1,error:(0,h.__)("License deactivation failed. Please try again.","404-to-301")}}catch(e){return{success:!1,error:e?.message||(0,h.__)("License deactivation failed. Please try again.","404-to-301")}}}const b=e=>e.items,S=(e,t)=>e.items.find(e=>Number(e.id)===Number(t)),w=e=>e.isLoading,E=e=>e.isRefreshing,N="/404-to-301/v1/addons";function*k(){yield y(!0);try{const e=yield{type:"API_FETCH",request:{path:N}};yield p(Array.isArray(e?.items)?e.items:[])}catch(e){(0,d.dispatch)(m.store).createErrorNotice(e?.message||(0,h.__)("Could not load the add-on list.","404-to-301")),yield p([])}finally{yield y(!1)}}const L="d404/addons",A=(0,d.createReduxStore)(L,{reducer:(e=l,t)=>{switch(t.type){case"SET_ITEMS":return{...e,items:t.items};case"REPLACE_ITEM":return t.addon&&t.addon.id?{...e,items:e.items.map(e=>Number(e.id)===Number(t.addon.id)?{...e,...t.addon}:e)}:e;case"SET_LOADING":return{...e,isLoading:t.isLoading};case"SET_REFRESHING":return{...e,isRefreshing:t.isRefreshing};default:return e}},controls:u,actions:t,selectors:s,resolvers:i});(0,d.register)(A);const I={status:null,isStarting:!1},T={API_FETCH:({request:e})=>c()(e)},R="/404-to-301/v1/migration",C=e=>({type:"SET_STATUS",status:e}),P=e=>({type:"SET_STARTING",isStarting:!!e});function*F(){yield P(!0);try{const e=yield{type:"API_FETCH",request:{path:R,method:"POST"}};return yield C(e),yield P(!1),e}catch(e){return(0,d.dispatch)(m.store).createErrorNotice(e?.message||(0,h.__)("Could not start the migration.","404-to-301")),yield P(!1),null}}function*D(){try{const e=yield{type:"API_FETCH",request:{path:`${R}/tick`,method:"POST"}};return yield C(e),e}catch(e){return(0,d.dispatch)(m.store).createErrorNotice(e?.message||(0,h.__)("Migration tick failed — will retry on next page load.","404-to-301")),null}}function*M(){try{const e=yield{type:"API_FETCH",request:{path:R,method:"DELETE"}};return yield C(e),(0,d.dispatch)(m.store).createSuccessNotice((0,h.__)("Migration aborted.","404-to-301")),e}catch(e){return(0,d.dispatch)(m.store).createErrorNotice(e?.message||(0,h.__)("Could not abort the migration.","404-to-301")),null}}const O=e=>e.status,B=e=>!!e.status?.running,H=e=>e.status?.remaining||0,$=e=>e.isStarting,q="/404-to-301/v1/migration";function*U(){try{const e=yield{type:"API_FETCH",request:{path:q}};yield C(e)}catch(e){}}const G=(0,d.createReduxStore)("d404/migration",{reducer:(e=I,t)=>{switch(t.type){case"SET_STATUS":return{...e,status:t.status};case"SET_STARTING":return{...e,isStarting:t.isStarting};default:return e}},controls:T,actions:r,selectors:n,resolvers:a});(0,d.register)(G);const z=window.wp.domReady;var V=e.n(z);const J=window.wp.element,W=window.wp.components,K=window.wp.primitives,X=window.ReactJSXRuntime,Q=(0,X.jsx)(K.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,X.jsx)(K.Path,{d:"m11.3 17.2-5-5c-.1-.1-.1-.3 0-.4l2.3-2.3-1.1-1-2.3 2.3c-.7.7-.7 1.8 0 2.5l5 5H7.5v1.5h5.3v-5.2h-1.5v2.6zm7.5-6.4-5-5h2.7V4.2h-5.2v5.2h1.5V6.8l5 5c.1.1.1.3 0 .4l-2.3 2.3 1.1 1.1 2.3-2.3c.6-.7.6-1.9-.1-2.5z"})}),Y=({src:e,srcLarge:t,alt:s})=>{const[i,r]=(0,J.useState)(!1),n=t&&t!==e?`${e} 1x, ${t} 2x`:void 0;return(0,X.jsxs)(X.Fragment,{children:[!i&&(0,X.jsx)("span",{className:"d404-addon-banner__spinner","aria-hidden":"true",children:(0,X.jsx)(W.Spinner,{})}),(0,X.jsx)("img",{src:e,srcSet:n,alt:s,loading:"lazy",className:"d404-addon-banner__img",onLoad:()=>r(!0),onError:()=>r(!0)})]})},Z=({children:e,kind:t="default"})=>(0,X.jsx)("span",{className:`d404-addon-badge d404-addon-badge--${t}`,children:e}),ee=({isActive:e,isLicenseActive:t})=>e?t?(0,X.jsx)(Z,{kind:"success",children:(0,h.__)("Licensed","404-to-301")}):(0,X.jsx)(Z,{kind:"warning",children:(0,h.__)("Unlicensed","404-to-301")}):null,te=({addon:e,onManageLicense:t})=>{let s;s=e.is_wporg?(0,h.__)("Download","404-to-301"):e.is_premium?(0,h.__)("Buy Now","404-to-301"):(0,h.__)("Get it","404-to-301");const i=(0,X.jsx)(W.Button,{variant:e.is_premium?"primary":"secondary",href:e.link||e.homepage||void 0,target:"_blank",rel:"noopener noreferrer",children:s});return(0,X.jsxs)(W.Card,{className:"d404-addon-card",isRounded:!0,size:"small",children:[e.banner&&(0,X.jsxs)(W.CardMedia,{className:"d404-addon-banner",children:[(0,X.jsx)(Y,{src:e.banner,srcLarge:e.banner_large,alt:e.title}),e.is_active&&(0,X.jsx)("span",{className:"d404-addon-status","aria-label":(0,h.__)("Active","404-to-301"),children:(0,h.__)("Active","404-to-301")})]}),(0,X.jsxs)(W.CardHeader,{children:[(0,X.jsx)(W.FlexBlock,{children:(0,X.jsx)("strong",{children:e.title})}),(0,X.jsx)(W.FlexItem,{children:(0,X.jsxs)(W.Flex,{gap:1,align:"center",justify:"flex-end",children:[e.is_premium?(0,X.jsx)(Z,{kind:"premium",children:(0,h.__)("Premium","404-to-301")}):(0,X.jsx)(Z,{kind:"free",children:(0,h.__)("Free","404-to-301")}),!e.is_wporg&&(0,X.jsx)(ee,{isActive:e.is_active,isLicenseActive:e.is_license_active})]})})]}),(0,X.jsx)(W.CardBody,{className:"d404-addon-description",children:(0,X.jsx)("p",{style:{margin:0},children:e.description})}),(0,X.jsxs)(W.CardFooter,{children:[(0,X.jsx)(W.FlexItem,{children:e.is_active?e.is_wporg?(0,X.jsx)("span",{className:"d404-addon-active-label",children:(0,h.__)("Installed","404-to-301")}):(0,X.jsx)(W.Button,{variant:"secondary",onClick:()=>t(e),children:e.is_license_active?(0,h.__)("Manage License","404-to-301"):(0,h.__)("Activate License","404-to-301")}):i}),e.homepage&&(0,X.jsx)(W.FlexItem,{children:(0,X.jsx)(W.Button,{variant:"link",href:e.homepage,target:"_blank",rel:"noopener noreferrer",children:(0,h.__)("More details","404-to-301")})})]})]})},se=({addon:e,onActivate:t,onDeactivate:s,onClose:i})=>{const[r,n]=(0,J.useState)(e.license_key||""),[a,o]=(0,J.useState)(!1),[c,d]=(0,J.useState)("");return(0,J.useEffect)(()=>{n(e.license_key||"")},[e.license_key]),(0,X.jsx)(W.Modal,{title:(0,h.sprintf)(/* translators: %s: addon title. */ /* translators: %s: addon title. */
(0,h.__)("Manage license — %s","404-to-301"),e.title||""),onRequestClose:i,className:"d404-license-modal",size:"medium",children:(0,X.jsxs)(W.__experimentalVStack,{spacing:4,children:[e.is_license_active?(0,X.jsx)(W.Notice,{status:"success",isDismissible:!1,children:(0,h.__)("A license is currently active for this add-on. Deactivate it to enter a different key.","404-to-301")}):(0,X.jsx)("p",{style:{margin:0},children:(0,h.__)("Paste your license key below to activate this add-on.","404-to-301")}),(0,X.jsx)(W.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,type:"password",label:(0,h.__)("License key","404-to-301"),value:r,onChange:e=>{n(e),d("")},readOnly:e.is_license_active,placeholder:(0,h.__)("Enter license key","404-to-301")}),c&&(0,X.jsx)(W.Notice,{status:"error",isDismissible:!1,children:c}),(0,X.jsxs)(W.Flex,{justify:"flex-end",gap:2,children:[(0,X.jsx)(W.FlexItem,{children:(0,X.jsx)(W.Button,{variant:"tertiary",onClick:i,disabled:a,children:(0,h.__)("Cancel","404-to-301")})}),(0,X.jsx)(W.FlexItem,{children:(0,X.jsx)(W.Button,{variant:e.is_license_active?"secondary":"primary",isDestructive:e.is_license_active,isBusy:a,disabled:a||!e.is_license_active&&!r.trim(),onClick:async()=>{if(a)return;if(!e.is_license_active&&!r.trim())return void d((0,h.__)("Enter a license key first.","404-to-301"));o(!0),d("");const n=e.is_license_active?await s(e.id):await t(e.id,r.trim());o(!1),n?.success?i():d(n?.error||(0,h.__)("Something went wrong. Please try again.","404-to-301"))},children:e.is_license_active?(0,h.__)("Deactivate License","404-to-301"):(0,h.__)("Activate License","404-to-301")})})]})]})})},ie=[{label:(0,h.__)("Documentation","404-to-301"),icon:"admin-page",href:"https://docs.duckdev.com/404-to-301/"},{label:(0,h.__)("Support Forums","404-to-301"),icon:"groups",href:"https://wordpress.org/support/plugin/404-to-301/"},{label:(0,h.__)("Priority Support","404-to-301"),icon:"superhero",href:"https://duckdev.com/contact/"}],re=[{href:"https://duckdev.com/about/",icon:"admin-site",label:(0,h.__)("About Us","404-to-301")},{href:"https://profiles.wordpress.org/joelcj91/",icon:"wordpress",label:(0,h.__)("WP.org Profile","404-to-301")}],ne=({links:e})=>(0,X.jsx)(W.Flex,{className:"d404-link-row",gap:2,justify:"flex-start",wrap:!0,children:e.map(e=>(0,X.jsx)(W.FlexItem,{children:(0,X.jsx)(W.Button,{__next40pxDefaultSize:!0,variant:"secondary",target:"_blank",rel:"noopener noreferrer",icon:e.icon,href:e.href,children:e.label})},e.href))});class ae extends J.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("404 to 301 admin error:",e,t)}render(){const{error:e}=this.state;return e?(0,X.jsxs)(W.Notice,{status:"error",isDismissible:!1,children:[(0,X.jsx)("p",{children:(0,X.jsx)("strong",{children:(0,h.__)("Something went wrong while rendering this page.","404-to-301")})}),(0,X.jsx)("p",{children:e.message||String(e)})]}):this.props.children}}const oe=ae,ce=({children:e})=>(0,X.jsxs)(W.SlotFillProvider,{children:[(0,X.jsx)(oe,{children:e}),(0,X.jsx)(W.Popover.Slot,{})]});window.ReactDOM,window.wp.coreData;const de=()=>{const e=(0,d.useSelect)(e=>e(m.store).getNotices().filter(e=>"snackbar"===e.type),[]),{removeNotice:t}=(0,d.useDispatch)(m.store);return e.length?(0,X.jsx)(W.SnackbarList,{className:"d404-notices",notices:e,onRemove:t}):null};function le(e){var t,s,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=le(e[t]))&&(i&&(i+=" "),i+=s)}else for(s in e)e[s]&&(i&&(i+=" "),i+=s);return i}const ue=function(){for(var e,t,s=0,i="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=le(e))&&(i&&(i+=" "),i+=t);return i},he=({wide:e=!1,children:t})=>(0,X.jsx)("div",{className:ue("d404-page-body",{"d404-page-body--wide":e}),children:t}),me=({title:e,children:t})=>{const s="undefined"!=typeof d404&&d404.version||"";return(0,X.jsxs)("div",{className:"d404-page-header",children:[(0,X.jsxs)("div",{className:"d404-page-title",children:[(0,X.jsx)("h1",{children:e}),s&&(0,X.jsx)("abbr",{className:"d404-version",title:`Version: ${s}`,children:s})]}),t]})},_e=({current:e,navs:t,onChange:s})=>(0,X.jsx)("nav",{className:"d404-tabs",style:{gridTemplateColumns:Object.keys(t).map(()=>"1fr").join(" ")},children:Object.keys(t).map(i=>(0,X.jsx)("a",{href:`#${i}`,className:ue("d404-tab",{active:i===e}),onClick:e=>{e.preventDefault(),s(i)},children:t[i]},i))});window.wp.compose,window.wp.htmlEntities;const pe=[{value:301,label:(0,h.__)("301 — Moved Permanently (SEO)","404-to-301"),terminal:!1},{value:302,label:(0,h.__)("302 — Found","404-to-301"),terminal:!1},{value:303,label:(0,h.__)("303 — See Other","404-to-301"),terminal:!1},{value:307,label:(0,h.__)("307 — Temporary Redirect","404-to-301"),terminal:!1},{value:308,label:(0,h.__)("308 — Permanent Redirect","404-to-301"),terminal:!1},{value:410,label:(0,h.__)("410 — Gone","404-to-301"),terminal:!0},{value:451,label:(0,h.__)("451 — Unavailable for Legal Reasons","404-to-301"),terminal:!0}],ge="undefined"!=typeof d404&&Array.isArray(d404.redirectStatuses)&&d404.redirectStatuses.length>0?d404.redirectStatuses:pe,ye=(ge.map(({value:e,label:t})=>({value:e,label:t})),ge.filter(e=>e.terminal).map(e=>e.value),ge.filter(e=>!e.terminal).map(e=>({value:String(e.value),label:e.label})),{catalog:{label:(0,h.__)("Add-ons","404-to-301"),component:()=>{const{items:e,isLoading:t,isRefreshing:s,refresh:i,activateLicense:r,deactivateLicense:n}=(()=>{const{items:e,isLoading:t,isRefreshing:s}=(0,d.useSelect)(e=>{const t=e(L);return{items:t.getItems(),isLoading:t.isLoading(),isRefreshing:t.isRefreshing()}},[]),{refresh:i,activateLicense:r,deactivateLicense:n}=(0,d.useDispatch)(L);return{items:e,isLoading:t,isRefreshing:s,refresh:i,activateLicense:r,deactivateLicense:n}})(),[a,o]=(0,J.useState)(null),c=null!==a?e.find(e=>Number(e.id)===Number(a)):null;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(W.Flex,{justify:"flex-end",align:"center",className:"d404-addons-toolbar",children:(0,X.jsx)(W.FlexItem,{children:(0,X.jsx)(W.Button,{variant:"secondary",icon:Q,onClick:i,isBusy:s,disabled:s||t,children:s?(0,h.__)("Refreshing…","404-to-301"):(0,h.__)("Refresh","404-to-301")})})}),t&&0===e.length?(0,X.jsx)("div",{className:"d404-page-loader",children:(0,X.jsx)(W.Spinner,{})}):0===e.length?(0,X.jsx)(W.Notice,{status:"info",isDismissible:!1,children:(0,h.__)("No add-ons available yet. Try the Refresh button above or check back later.","404-to-301")}):(0,X.jsx)("div",{className:"d404-addons-grid",children:e.map(e=>(0,X.jsx)(te,{addon:e,onManageLicense:e=>o(e.id)},e.id))}),c&&(0,X.jsx)(se,{addon:c,onActivate:r,onDeactivate:n,onClose:()=>o(null)})]})}},support:{label:(0,h.__)("Support","404-to-301"),component:()=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(W.PanelBody,{title:(0,h.__)("Support Information","404-to-301"),children:[(0,X.jsx)("p",{children:(0,h.__)("Access our detailed documentation to handle most situations. For human feedback or community help, visit our wp.org forum. Premium customers receive priority support by contacting us directly.","404-to-301")}),(0,X.jsx)(ne,{links:ie})]}),(0,X.jsxs)(W.PanelBody,{title:(0,h.__)("About the Author","404-to-301"),children:[(0,X.jsx)("p",{children:(0,h.__)("Hey, I'm Joel James, a Software Engineer based in Kerala, India. I'm passionate about open source and dedicate a lot of my time to contributing to it. If you like this plugin, I'd encourage you to check out my other WordPress plugins as well!","404-to-301")}),(0,X.jsx)(ne,{links:re})]})]})}}),ve=()=>{const e=Object.keys(ye),[t,s]=(0,J.useState)(e[0]),i=Object.fromEntries(Object.entries(ye).map(([e,t])=>[e,t.label])),r=(ye[t]||ye[e[0]]).component,n="catalog"===t;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(me,{title:(0,h.__)("404 to 301 - Add-ons","404-to-301"),children:(0,X.jsx)(_e,{current:t,navs:i,onChange:s})}),(0,X.jsxs)(he,{wide:n,children:[(0,X.jsx)(de,{}),(0,X.jsx)(r,{})]})]})};V()(()=>{const e=document.getElementById("404-to-301-addons");e&&(0,J.createRoot)(e).render((0,X.jsx)(ce,{children:(0,X.jsx)(ve,{})}))})})();