diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e5abfa6..00730d43 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,13 @@ version: 2 jobs: php_lint: - working_directory: ~/likecoin-wordpress + working_directory: ~/nftpress docker: - image: composer:2.8.9 steps: - checkout - restore_cache: - key: likecoin-wordpress-{{ .Environment.CACHE_UUID }}-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }} + key: nftpress-{{ .Environment.CACHE_UUID }}-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }} - run: name: Install phpcs command: composer install @@ -18,18 +18,18 @@ jobs: name: Complete Lint Test command: ./vendor/bin/phpcs likecoin --standard=WordPress --extensions=php --ignore=*/assets/js/*,*/assets/blocks/* - save_cache: - key: likecoin-wordpress-{{ .Environment.CACHE_UUID }}-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }} + key: nftpress-{{ .Environment.CACHE_UUID }}-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }} paths: - ./vendor - ./wpcs eslint: - working_directory: ~/likecoin-wordpress + working_directory: ~/nftpress docker: - image: node:14 steps: - checkout - restore_cache: - key: likecoin-wordpress-{{ .Environment.CACHE_UUID }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }} + key: nftpress-{{ .Environment.CACHE_UUID }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }} - run: name: Dependencies command: npm install @@ -37,11 +37,11 @@ jobs: name: Lint Test command: npm run lint - save_cache: - key: likecoin-wordpress-{{ .Environment.CACHE_UUID }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }} + key: nftpress-{{ .Environment.CACHE_UUID }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }} paths: - ./node_modules build_zip: - working_directory: ~/likecoin-wordpress + working_directory: ~/nftpress docker: - image: alpine:3.8 steps: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3df71946..ba1e9d9e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Feel free to open up an issue in case you have any doubt, or before you start wo ## Development Setup -We use docker-based development workflow, please refer to [setup](https://github.com/likecoin/likecoin-wordpress#development-setup) section of [README.md](https://github.com/likecoin/likecoin-wordpress/blob/master/README.md). +We use docker-based development workflow, please refer to [setup](https://github.com/nftpress/nftpress#development-setup) section of [README.md](https://github.com/likecoin/nftpress/blob/master/README.md). ## Issues / Bug reports @@ -22,6 +22,6 @@ We use docker-based development workflow, please refer to [setup](https://github - [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) for php, [airbnb](https://github.com/airbnb/javascript) for javascript. -- It must pass all [tests](https://github.com/likecoin/likecoin-wordpress#test) +- It must pass all [tests](https://github.com/likecoin/nftpress#test) - We try our best to review PRs as soon as possible, be patient in case there is a hold up. diff --git a/README.md b/README.md index 8d8fca96..74ee4059 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ -# Web3Press WordPress Plugin By LikeCoin +# NFTPress WordPress Plugin By BROWN -[![WordPress plugin downloads](https://img.shields.io/wordpress/plugin/dt/likecoin.svg)](https://wordpress.org/plugins/likecoin/) +[![WordPress plugin downloads](https://img.shields.io/wordpress/plugin/dt/likecoin.svg)](https://wordpress.org/plugins/nftpress/) [![WordPress plugin rating](https://img.shields.io/wordpress/plugin/r/likecoin.svg)](https://wordpress.org/plugins/likecoin/) -[![WordPress plugin version](https://img.shields.io/wordpress/plugin/v/likecoin.svg)](https://wordpress.org/plugins/likecoin/) -[![WordPress version tested](https://img.shields.io/wordpress/v/likecoin.svg)](https://wordpress.org/plugins/likecoin/) -[![CircleCI](https://circleci.com/gh/likecoin/likecoin-wordpress.svg?style=svg)](https://circleci.com/gh/likecoin/likecoin-wordpress) -[![Greenkeeper badge](https://badges.greenkeeper.io/likecoin/likecoin-wordpress.svg)](https://greenkeeper.io/) +[![WordPress plugin version](https://img.shields.io/wordpress/plugin/v/likecoin.svg)](https://wordpress.org/plugins/nftpress/) +[![WordPress version tested](https://img.shields.io/wordpress/v/likecoin.svg)](https://wordpress.org/plugins/nftpress/) Integrates Liker ID functionality into your own WordPress site. diff --git a/likecoin/assets/js/admin-settings/index.asset.php b/likecoin/assets/js/admin-settings/index.asset.php index f33f0724..f3bd96d0 100644 --- a/likecoin/assets/js/admin-settings/index.asset.php +++ b/likecoin/assets/js/admin-settings/index.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'b3c1d1535c55c0294675'); + array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '00097e1ab2fe756e82de'); diff --git a/likecoin/assets/js/admin-settings/index.js b/likecoin/assets/js/admin-settings/index.js index 25de4668..2b3a6189 100644 --- a/likecoin/assets/js/admin-settings/index.js +++ b/likecoin/assets/js/admin-settings/index.js @@ -1 +1 @@ -(()=>{var e={556:(e,t,n)=>{e.exports=n(694)()},694:(e,t,n)=>{"use strict";var r=n(925);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=r[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{"use strict";var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>Dn,hasStandardBrowserEnv:()=>Bn,hasStandardBrowserWebWorkerEnv:()=>Un,navigator:()=>xn,origin:()=>Fn});const t=window.React,r=window.wp.element,i=window.ReactDOM;function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var f;function m(e,t,n){return void 0===n&&(n="/"),function(e,t,n,r){let i=P(("string"==typeof t?h(t):t).pathname||"/",n);if(null==i)return null;let o=E(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(o);let a=null;for(let e=0;null==a&&e{let a={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};a.relativePath.startsWith("/")&&(l(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let s=C([r,a.relativePath]),c=n.concat(a);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),E(e.children,t,c,s)),(null!=e.path||e.index)&&t.push({path:s,score:O(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of y(e.path))i(e,t,n);else i(e,t)}),t}function y(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=y(r.join("/")),s=[];return s.push(...a.map(e=>""===e?o:[o,e].join("/"))),i&&s.push(...a),s.map(t=>e.startsWith("/")&&""===t?"/":t)}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(f||(f={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const g=/^:[\w-]+$/,b=3,_=2,k=1,v=10,S=-2,w=e=>"*"===e;function O(e,t){let n=e.split("/"),r=n.length;return n.some(w)&&(r+=S),t&&(r+=_),n.filter(e=>!w(e)).reduce((e,t)=>e+(g.test(t)?b:""===t?k:v),r)}function R(e,t,n){void 0===n&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let e=0;e(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=s[n]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[n];return e[r]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:a,pattern:e}}function L(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return c(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function P(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function N(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function A(e,t){let n=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function I(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=h(e):(i=o({},e),l(!i.pathname||!i.pathname.includes("?"),N("?","pathname","search",i)),l(!i.pathname||!i.pathname.includes("#"),N("#","pathname","hash",i)),l(!i.search||!i.search.includes("#"),N("#","search","hash",i)));let a,s=""===e||""===i.pathname,c=s?"/":i.pathname;if(null==c)a=n;else{let e=t.length-1;if(!r&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?h(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:x(r),hash:B(i)}}(i,a),d=c&&"/"!==c&&c.endsWith("/"),p=(s||"."===c)&&n.endsWith("/");return u.pathname.endsWith("/")||!d&&!p||(u.pathname+="/"),u}const C=e=>e.join("/").replace(/\/\/+/g,"/"),D=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),x=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",B=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const U=["post","put","patch","delete"],F=(new Set(U),["get",...U]);function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0}),t.useCallback(function(t,i){void 0===i&&(i={}),r.current&&("number"==typeof t?e.navigate(t):e.navigate(t,j({fromRouteId:n},i)))},[e,n])}():function(){$()||l(!1);let e=t.useContext(W),{basename:n,future:r,navigator:i}=t.useContext(H),{matches:o}=t.useContext(z),{pathname:a}=G(),s=JSON.stringify(A(o,r.v7_relativeSplatPath)),c=t.useRef(!1);return J(()=>{c.current=!0}),t.useCallback(function(t,r){if(void 0===r&&(r={}),!c.current)return;if("number"==typeof t)return void i.go(t);let o=I(t,JSON.parse(s),a,"path"===r.relative);null==e&&"/"!==n&&(o.pathname="/"===o.pathname?n:C([n,o.pathname])),(r.replace?i.replace:i.push)(o,r.state,r)},[n,i,s,a,e])}()}const Y=t.createContext(null);function X(e,n){let{relative:r}=void 0===n?{}:n,{future:i}=t.useContext(H),{matches:o}=t.useContext(z),{pathname:a}=G(),s=JSON.stringify(A(o,i.v7_relativeSplatPath));return t.useMemo(()=>I(e,JSON.parse(s),a,"path"===r),[e,s,a,r])}function Q(e,n,r,i){$()||l(!1);let{navigator:o}=t.useContext(H),{matches:s}=t.useContext(z),c=s[s.length-1],u=c?c.params:{},d=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let p,f=G();if(n){var E;let e="string"==typeof n?h(n):n;"/"===d||(null==(E=e.pathname)?void 0:E.startsWith(d))||l(!1),p=e}else p=f;let y=p.pathname||"/",g=y;if("/"!==d){let e=d.replace(/^\//,"").split("/");g="/"+y.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=m(e,{pathname:g}),_=function(e,n,r,i){var o;if(void 0===n&&(n=[]),void 0===r&&(r=null),void 0===i&&(i=null),null==e){var a;if(!r)return null;if(r.errors)e=r.matches;else{if(!(null!=(a=i)&&a.v7_partialHydration&&0===n.length&&!r.initialized&&r.matches.length>0))return null;e=r.matches}}let s=e,c=null==(o=r)?void 0:o.errors;if(null!=c){let e=s.findIndex(e=>e.route.id&&void 0!==(null==c?void 0:c[e.route.id]));e>=0||l(!1),s=s.slice(0,Math.min(s.length,e+1))}let u=!1,d=-1;if(r&&i&&i.v7_partialHydration)for(let e=0;e=0?s.slice(0,d+1):[s[0]];break}}}return s.reduceRight((e,i,o)=>{let a,l=!1,p=null,h=null;var f;r&&(a=c&&i.route.id?c[i.route.id]:void 0,p=i.route.errorElement||ee,u&&(d<0&&0===o?(ae[f="route-fallback"]||(ae[f]=!0),l=!0,h=null):d===o&&(l=!0,h=i.route.hydrateFallbackElement||null)));let m=n.concat(s.slice(0,o+1)),E=()=>{let n;return n=a?p:l?h:i.route.Component?t.createElement(i.route.Component,null):i.route.element?i.route.element:e,t.createElement(ne,{match:i,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:n})};return r&&(i.route.ErrorBoundary||i.route.errorElement||0===o)?t.createElement(te,{location:r.location,revalidation:r.revalidation,component:p,error:a,children:E(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):E()},null)}(b&&b.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:C([d,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:C([d,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),s,r,i);return n&&_?t.createElement(q.Provider,{value:{location:j({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:a.Pop}},_):_}function Z(){let e=function(){var e;let n=t.useContext(K),r=function(){let e=t.useContext(M);return e||l(!1),e}(ie.UseRouteError),i=oe(ie.UseRouteError);return void 0!==n?n:null==(e=r.errors)?void 0:e[i]}(),n=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),r?t.createElement("pre",{style:i},r):null,null)}const ee=t.createElement(Z,null);class te extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(z.Provider,{value:this.props.routeContext},t.createElement(K.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ne(e){let{routeContext:n,match:r,children:i}=e,o=t.useContext(W);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),t.createElement(z.Provider,{value:n},i)}var re=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(re||{}),ie=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ie||{});function oe(e){let n=function(){let e=t.useContext(z);return e||l(!1),e}(),r=n.matches[n.matches.length-1];return r.route.id||l(!1),r.route.id}const ae={};function se(e){let{to:n,replace:r,state:i,relative:o}=e;$()||l(!1);let{future:a,static:s}=t.useContext(H),{matches:c}=t.useContext(z),{pathname:u}=G(),d=V(),p=I(n,A(c,a.v7_relativeSplatPath),u,"path"===o),h=JSON.stringify(p);return t.useEffect(()=>d(JSON.parse(h),{replace:r,state:i,relative:o}),[d,h,o,r,i]),null}function le(e){return function(e){let n=t.useContext(z).outlet;return n?t.createElement(Y.Provider,{value:e},n):n}(e.context)}function ce(e){l(!1)}function ue(e){let{basename:n="/",children:r=null,location:i,navigationType:o=a.Pop,navigator:s,static:c=!1,future:u}=e;$()&&l(!1);let d=n.replace(/^\/*/,"/"),p=t.useMemo(()=>({basename:d,navigator:s,static:c,future:j({v7_relativeSplatPath:!1},u)}),[d,u,s,c]);"string"==typeof i&&(i=h(i));let{pathname:f="/",search:m="",hash:E="",state:y=null,key:g="default"}=i,b=t.useMemo(()=>{let e=P(f,d);return null==e?null:{location:{pathname:e,search:m,hash:E,state:y,key:g},navigationType:o}},[d,f,m,E,y,g,o]);return null==b?null:t.createElement(H.Provider,{value:p},t.createElement(q.Provider,{children:r,value:b}))}function de(e){let{children:t,location:n}=e;return Q(pe(t),n)}function pe(e,n){void 0===n&&(n=[]);let r=[];return t.Children.forEach(e,(e,i)=>{if(!t.isValidElement(e))return;let o=[...n,i];if(e.type===t.Fragment)return void r.push.apply(r,pe(e.props.children,o));e.type!==ce&&l(!1),e.props.index&&e.props.children&&l(!1);let a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=pe(e.props.children,o)),r.push(a)}),r}function he(){return he=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[n]=e[n]);return i}t.startTransition,new Promise(()=>{}),t.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const me=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ee=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"];try{window.__reactRouterVersion="6"}catch(e){}const ye=t.createContext({isTransitioning:!1});new Map;const ge=t.startTransition;i.flushSync,t.useId;const be="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,_e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ke=t.forwardRef(function(e,n){let r,{onClick:i,relative:o,reloadDocument:a,replace:s,state:c,target:u,to:d,preventScrollReset:h,viewTransition:f}=e,m=fe(e,me),{basename:E}=t.useContext(H),y=!1;if("string"==typeof d&&_e.test(d)&&(r=d,be))try{let e=new URL(window.location.href),t=d.startsWith("//")?new URL(e.protocol+d):new URL(d),n=P(t.pathname,E);t.origin===e.origin&&null!=n?d=n+t.search+t.hash:y=!0}catch(e){}let g=function(e,n){let{relative:r}=void 0===n?{}:n;$()||l(!1);let{basename:i,navigator:o}=t.useContext(H),{hash:a,pathname:s,search:c}=X(e,{relative:r}),u=s;return"/"!==i&&(u="/"===s?i:C([i,s])),o.createHref({pathname:u,search:c,hash:a})}(d,{relative:o}),b=function(e,n){let{target:r,replace:i,state:o,preventScrollReset:a,relative:s,viewTransition:l}=void 0===n?{}:n,c=V(),u=G(),d=X(e,{relative:s});return t.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let n=void 0!==i?i:p(u)===p(d);c(e,{replace:n,state:o,preventScrollReset:a,relative:s,viewTransition:l})}},[u,c,d,i,o,r,e,a,s,l])}(d,{replace:s,state:c,target:u,preventScrollReset:h,relative:o,viewTransition:f});return t.createElement("a",he({},m,{href:r||g,onClick:y||a?i:function(e){i&&i(e),e.defaultPrevented||b(e)},ref:n,target:u}))}),ve=t.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:c,viewTransition:u,children:d}=e,p=fe(e,Ee),h=X(c,{relative:p.relative}),f=G(),m=t.useContext(M),{navigator:E,basename:y}=t.useContext(H),g=null!=m&&function(e,n){void 0===n&&(n={});let r=t.useContext(ye);null==r&&l(!1);let{basename:i}=function(){let e=t.useContext(W);return e||l(!1),e}(Se.useViewTransitionState),o=X(e,{relative:n.relative});if(!r.isTransitioning)return!1;let a=P(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=P(r.nextLocation.pathname,i)||r.nextLocation.pathname;return null!=T(o.pathname,s)||null!=T(o.pathname,a)}(h)&&!0===u,b=E.encodeLocation?E.encodeLocation(h).pathname:h.pathname,_=f.pathname,k=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(_=_.toLowerCase(),k=k?k.toLowerCase():null,b=b.toLowerCase()),k&&y&&(k=P(k,y)||k);const v="/"!==b&&b.endsWith("/")?b.length-1:b.length;let S,w=_===b||!a&&_.startsWith(b)&&"/"===_.charAt(v),O=null!=k&&(k===b||!a&&k.startsWith(b)&&"/"===k.charAt(b.length)),R={isActive:w,isPending:O,isTransitioning:g},L=w?r:void 0;S="function"==typeof o?o(R):[o,w?"active":null,O?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let N="function"==typeof s?s(R):s;return t.createElement(ke,he({},p,{"aria-current":L,className:S,ref:n,style:N,to:c,viewTransition:u}),"function"==typeof d?d(R):d)});var Se,we;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Se||(Se={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(we||(we={}));const Oe=window.wp.data,Re=window.wp.apiFetch;var Te=n.n(Re);function Le(e,t){if(Oe.createReduxStore){const n=(0,Oe.createReduxStore)(e,t);return(0,Oe.register)(n),n}return(0,Oe.registerStore)(e,t),e}const Pe="likecoin/site_liker_info",Ne="/likecoin/v1/options/liker-id",Ae={DBUserCanEditOption:!0,DBErrorMessage:"",DBSiteLikerId:"",DBSiteLikerAvatar:"",DBSiteLikerDisplayName:"",DBSiteLikerWallet:"",DBDisplayOptionSelected:"none",DBPerPostOptionEnabled:!1},Ie={getSiteLikerInfo:e=>({type:"GET_SITE_LIKER_INFO",path:e}),setSiteLikerInfo:e=>({type:"SET_SITE_LIKER_INFO",info:e}),setHTTPError(e){const t=e.response.data||e.message;return 403===e.response.status?{type:"SET_FORBIDDEN_ERROR",errorMsg:t}:{type:"SET_ERROR_MESSAGE",errorMsg:t}},*postSiteLikerInfo(e){yield{type:"POST_SITE_LIKER_INFO_TO_DB",data:e},e.siteLikerInfos&&(yield{type:"CHANGE_SITE_LIKER_INFO_GLOBAL_STATE",data:e})}};Le(Pe,{reducer:(e=Ae,t)=>{switch(t.type){case"SET_SITE_LIKER_INFO":return{...e,DBSiteLikerId:t.info.site_likecoin_user.likecoin_id,DBSiteLikerAvatar:t.info.site_likecoin_user.avatar,DBSiteLikerDisplayName:t.info.site_likecoin_user.display_name,DBSiteLikerWallet:t.info.site_likecoin_user.wallet,DBDisplayOptionSelected:t.info.button_display_option,DBPerPostOptionEnabled:t.info.button_display_author_override,DBUserCanEditOption:t.info.user_can_edit};case"CHANGE_SITE_LIKER_INFO_GLOBAL_STATE":return{...e,DBSiteLikerId:t.data.siteLikerInfos.likecoin_id,DBSiteLikerAvatar:t.data.siteLikerInfos.avatar,DBSiteLikerDisplayName:t.data.siteLikerInfos.display_name,DBSiteLikerWallet:t.data.siteLikerInfos.wallet};case"SET_FORBIDDEN_ERROR":return{DBUserCanEditOption:!1,DBErrorMessage:t.errorMsg};case"SET_ERROR_MESSAGE":return{DBErrorMessage:t.errorMsg};default:return e}},controls:{GET_SITE_LIKER_INFO:()=>Te()({path:Ne}),POST_SITE_LIKER_INFO_TO_DB:e=>Te()({method:"POST",path:Ne,data:e.data})},selectors:{selectSiteLikerInfo:e=>e},resolvers:{*selectSiteLikerInfo(){try{const e=(yield Ie.getSiteLikerInfo()).data,t=!("1"!==e.button_display_author_override&&!0!==e.button_display_author_override);return e.button_display_author_override=t,e.button_display_option||(e.button_display_option=Ae.DBDisplayOptionSelected),e.site_likecoin_user||(e.site_likecoin_user={}),Ie.setSiteLikerInfo(e)}catch(e){return Ie.setHTTPError(e)}}},actions:Ie});const Ce=window.wp.i18n,De=n.p+"images/w3p_logo.443a5708.png",xe=function(){return(0,t.createElement)("header",{className:"lcp-admin-header"},(0,t.createElement)("img",{src:De,alt:(0,Ce.__)("Web3Press logo","likecoin")}),(0,t.createElement)("a",{className:"lcp-admin-header__portfolio-button",href:"https://liker.land/dashboard",rel:"noopener noreferrer",target:"_blank"},(0,Ce.__)("Your Portfolio","likecoin")," ",(0,t.createElement)("span",{className:"dashicons dashicons-external"})))};var Be=n(556),Ue=n.n(Be);const Fe=({isActive:e})=>"nav-tab"+(e?" nav-tab-active":"");function je({children:e}){return(0,t.createElement)("nav",{className:"lcp-nav-tab-wrapper nav-tab-wrapper wp-clearfix"},e)}je.propTypes={children:Ue().node.isRequired};const We=je,Me=function(){const{DBUserCanEditOption:e}=(0,Oe.useSelect)(e=>e(Pe).selectSiteLikerInfo());return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(We,null,e&&(0,t.createElement)(ve,{className:Fe,to:"",end:!0},(0,Ce.__)("General","likecoin")),e&&(0,t.createElement)(ve,{className:Fe,to:"advanced"},(0,Ce.__)("Advanced","likecoin")),(0,t.createElement)(ve,{className:Fe,to:"about"},(0,Ce.__)("About","likecoin"))),(0,t.createElement)("div",{className:"lcp-nav-tab-panel"},(0,t.createElement)(le,null)))};function He({handleSelect:e,title:n,selectRef:r,selected:i,options:o}){return(0,t.createElement)("tr",null,(0,t.createElement)("th",{className:"optionTitle",scope:"row"},(0,t.createElement)("label",{htmlFor:`dropdown-${n.replace(/\s+/g,"-").toLowerCase()}`},n)),(0,t.createElement)("td",null,(0,t.createElement)("select",{id:`dropdown-${n.replace(/\s+/g,"-").toLowerCase()}`,ref:r,onChange:t=>{e(t.target.value)},value:i},o.map(e=>(0,t.createElement)("option",{value:e.value,key:e.label},e.label)))))}He.propTypes={handleSelect:Ue().func.isRequired,title:Ue().string.isRequired,selectRef:Ue().oneOfType([Ue().func,Ue().shape({current:Ue().instanceOf(Element)})]),selected:Ue().string.isRequired,options:Ue().arrayOf(Ue().shape({value:Ue().string.isRequired,label:Ue().string.isRequired})).isRequired},He.defaultProps={selectRef:null};const qe=He;function ze({title:e}){return(0,t.createElement)("h2",{className:"title"},e)}ze.propTypes={title:Ue().string.isRequired};const Ke=ze;function $e({className:e,text:n,handleNoticeDismiss:r}){return(0,t.createElement)("div",{className:`notice ${e} is-dismissable`},(0,t.createElement)("p",null,(0,t.createElement)("strong",null,n)),(0,t.createElement)("button",{type:"button",className:"notice-dismiss",id:"notice-dismiss","aria-label":"Dismiss notice",onClick:r},(0,t.createElement)("span",{className:"screen-reader-text"},"Dismiss notice")))}$e.propTypes={className:Ue().string,text:Ue().string.isRequired,handleNoticeDismiss:Ue().func.isRequired},$e.defaultProps={className:""};const Ge=$e,Je="likecoin/site_publish",Ve={DBSiteInternetArchiveEnabled:!1,DBSiteInternetArchiveAccessKey:"",DBISCNBadgeStyleOption:"none"},Ye={getSitePublishOptions:e=>({type:"GET_SITE_PUBLISH_OPTIONS",path:e}),setSitePublishOptions:e=>({type:"SET_SITE_PUBLISH_OPTIONS",options:e}),setHTTPErrors:e=>({type:"SET_ERROR_MESSAGE",errorMsg:e}),*postSitePublishOptions(e){yield{type:"POST_SITE_PUBLISH_OPTIONS_TO_DB",data:e},yield{type:"CHANGE_SITE_PUBLISH_OPTIONS_GLOBAL_STATE",data:e}}};function Xe({title:e,children:n,details:r,append:i}){return(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"row",className:"optionTitle"},e),(0,t.createElement)("td",null,n,!!r&&(0,t.createElement)("span",{className:"description"},r),i))}Le(Je,{reducer:(e=Ve,t)=>{switch(t.type){case"SET_SITE_PUBLISH_OPTIONS":return{DBSiteInternetArchiveEnabled:t.options.lc_internet_archive_enabled,DBSiteInternetArchiveAccessKey:t.options.lc_internet_archive_access_key,DBISCNBadgeStyleOption:t.options.iscn_badge_style_option};case"CHANGE_SITE_PUBLISH_OPTIONS_GLOBAL_STATE":{const n=JSON.parse(JSON.stringify({DBSiteInternetArchiveEnabled:t.data.siteInternetArchiveEnabled,DBSiteInternetArchiveAccessKey:t.data.siteInternetArchiveAccessKey,DBISCNBadgeStyleOption:t.data.ISCNBadgeStyleOption}));return{...e,...n}}default:return e}},controls:{GET_SITE_PUBLISH_OPTIONS:e=>Te()({path:e.path}),POST_SITE_PUBLISH_OPTIONS_TO_DB:e=>Te()({method:"POST",path:"/likecoin/v1/option/publish",data:e.data})},selectors:{selectSitePublishOptions:e=>e},resolvers:{*selectSitePublishOptions(){try{const e=(yield Ye.getSitePublishOptions("/likecoin/v1/option/publish")).data;return e.iscn_badge_style_option||(e.iscn_badge_style_option=Ve.DBISCNBadgeStyleOption),Ye.setSitePublishOptions(e)}catch(e){return Ye.setHTTPErrors(e.message)}}},actions:Ye}),Xe.propTypes={title:Ue().string.isRequired,children:Ue().node,details:Ue().string,append:Ue().node},Xe.defaultProps={children:null,details:"",append:null};const Qe=Xe;function Ze({handleCheck:e,checked:n,title:r,details:i,append:o,disabled:a,checkRef:s}){return(0,t.createElement)(Qe,{title:r,details:i,append:o},(0,t.createElement)("input",{type:"checkbox",checked:n,disabled:a,onChange:()=>{e(!n)},ref:s}))}Ze.propTypes={handleCheck:Ue().func.isRequired,checked:Ue().bool.isRequired,title:Ue().string.isRequired,details:Ue().string,append:Ue().node,disabled:Ue().bool,checkRef:Ue().oneOfType([Ue().func,Ue().shape({current:Ue().instanceOf(Element)})])},Ze.defaultProps={details:"",append:null,disabled:!1,checkRef:null};const et=Ze;function tt({children:e}){return(0,t.createElement)("table",{className:"form-table",role:"presentation"},(0,t.createElement)("tbody",null,e))}tt.propTypes={children:Ue().node},tt.defaultProps={children:null};const nt=tt;function rt({children:e}){return(0,t.createElement)("div",{className:"submit"},(0,t.createElement)("button",{type:"submit",className:"button button-primary"},(0,Ce.__)("Confirm","likecoin")),e)}rt.propTypes={children:Ue().node},rt.defaultProps={children:null};const it=rt,ot=function(){const{postSiteLikerInfo:e}=(0,Oe.useDispatch)(Pe),{postSitePublishOptions:n}=(0,Oe.useDispatch)(Je),{DBUserCanEditOption:r,DBDisplayOptionSelected:i}=(0,Oe.useSelect)(e=>e(Pe).selectSiteLikerInfo()),{DBISCNBadgeStyleOption:o}=(0,Oe.useSelect)(e=>e(Je).selectSitePublishOptions()),[a,s]=(0,t.useState)(!1),[l,c]=(0,t.useState)("post"===i||"always"===i),[u,d]=(0,t.useState)("page"===i||"always"===i),p=(0,t.useRef)(),h=[{value:"light",label:(0,Ce.__)("Light Mode","likecoin")},{value:"dark",label:(0,Ce.__)("Dark Mode","likecoin")},{value:"none",label:(0,Ce.__)("Not shown","likecoin")}],[f,m]=(0,t.useState)(o);(0,t.useEffect)(()=>{m(o)},[o]),(0,t.useEffect)(()=>{c("post"===i||"always"===i),d("page"===i||"always"===i)},[i]);const E=(0,t.useCallback)(e=>{e.preventDefault(),c(!0),d(!1),m("none")},[]),y=(0,t.useCallback)(async t=>{s(!1),t.preventDefault();const r=p.current.value;let i="none";l&&u?i="always":l?i="post":u&&(i="page");const o={displayOption:i},a={ISCNBadgeStyleOption:r};try{await Promise.all([e(o),n(a)]),s(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(e){console.error(e)}},[l,u,e,n]),g=(0,t.useCallback)(e=>{e.preventDefault(),s(!1)},[]),b=(0,Ce.__)("Sorry, you are not allowed to access this page.","likecoin");return r?(0,t.createElement)("div",{className:"likecoin"},a&&(0,t.createElement)(Ge,{text:(0,Ce.__)("Settings Saved","likecoin"),className:"notice-success",handleNoticeDismiss:g}),(0,t.createElement)("form",{onSubmit:y},(0,t.createElement)(Ke,{title:(0,Ce.__)("LikeCoin widget","likecoin")}),(0,t.createElement)("p",null,(0,Ce.__)("Display LikeCoin Button/Widget when author has a Liker ID, or if post is registered on ISCN","likecoin")),(0,t.createElement)(nt,null,(0,t.createElement)(et,{checked:l,handleCheck:c,title:(0,Ce.__)("Show in Posts","likecoin"),append:(0,Ce.__)(" *Recommended","likecoin")}),(0,t.createElement)(et,{checked:u,handleCheck:d,title:(0,Ce.__)("Show in Pages","likecoin")})),(0,t.createElement)("hr",null),(0,t.createElement)(Ke,{title:(0,Ce.__)("ISCN Badge","likecoin")}),(0,t.createElement)("p",null,(0,Ce.__)("Display a badge for ISCN registered post","likecoin")),(0,t.createElement)(nt,null,(0,t.createElement)(qe,{selected:f,handleSelect:m,title:(0,Ce.__)("Display style","likecoin"),selectRef:p,options:h})),(0,t.createElement)(it,null," ",(0,t.createElement)("button",{type:"button",className:"button",onClick:E},(0,Ce.__)("Reset to default","likecoin"))))):(0,t.createElement)("p",null,b)},at=function(){const{DBUserCanEditOption:e}=(0,Oe.useSelect)(e=>e(Pe).selectSiteLikerInfo());return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(We,null,e&&(0,t.createElement)(ve,{className:Fe,to:"",end:!0},(0,Ce.__)("Website Liker ID","likecoin")),(0,t.createElement)(ve,{className:Fe,to:"user"},(0,Ce.__)("Your Liker ID","likecoin"))),(0,t.createElement)("div",{className:"lcp-nav-tab-panel"},(0,t.createElement)(le,null)))};function st(e,n){const{postSiteLikerInfo:r}=(0,Oe.useDispatch)(Pe),{DBPerPostOptionEnabled:i}=(0,Oe.useSelect)(e=>e(Pe).selectSiteLikerInfo()),o=(0,t.useRef)(),[a,s]=(0,t.useState)(i);async function l(){const e={perPostOptionEnabled:o.current.checked};await r(e)}return(0,t.useEffect)(()=>{s(i)},[i]),(0,t.useImperativeHandle)(n,()=>({submit:l})),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Ke,{title:(0,Ce.__)("LikeCoin widget advanced settings","likecoin")}),(0,t.createElement)(nt,null,(0,t.createElement)(et,{checked:a,handleCheck:s,title:(0,Ce.__)("Post option","likecoin"),details:(0,Ce.__)("Allow editors to customize display setting per post","likecoin"),append:(0,t.createElement)("p",null,(0,t.createElement)("button",{type:"button",onClick:function(e){e.preventDefault(),s(!1)},style:{background:"none",border:"none",color:"#0073aa",textDecoration:"underline",cursor:"pointer"}},(0,Ce.__)("Reset to default","likecoin"))),checkRef:o})))}st.propTypes={};const lt=(0,t.forwardRef)(st);function ct({linkAddress:e,text:n}){return(0,t.createElement)("a",{rel:"noopener noreferrer",target:"_blank",href:e},n)}ct.propTypes={linkAddress:Ue().string.isRequired,text:Ue().string.isRequired};const ut=ct,dt=function(){const e=(0,r.createInterpolateElement)((0,Ce.__)(" is a non-profit digital library offering free universal access to books, movies & music, as well as 624 billion archived web pages.","likecoin"),{InternetArchive:(0,r.createElement)(ut,{text:(0,Ce.__)("Internet Archive (archive.org)","likecoin"),linkAddress:"https://archive.org/"})});return(0,r.createElement)("p",null,e)},pt=(0,t.forwardRef)(function(e,n){const{DBSiteInternetArchiveEnabled:i,DBSiteInternetArchiveAccessKey:o}=(0,Oe.useSelect)(e=>e(Je).selectSitePublishOptions()),[a,s]=(0,t.useState)(i),[l,c]=(0,t.useState)(o),[u,d]=(0,t.useState)(""),[p,h]=(0,t.useState)(!o);(0,t.useEffect)(()=>{s(i),c(o),h(!o)},[o,i]);const{postSitePublishOptions:f}=(0,Oe.useDispatch)(Je),m=(0,t.useCallback)(()=>{let e={siteInternetArchiveEnabled:a};p&&(e={...e,siteInternetArchiveAccessKey:l,siteInternetArchiveSecret:u}),f(e)},[p,a,l,u,f]);(0,t.useImperativeHandle)(n,()=>({submit:m}));const E=(0,r.createInterpolateElement)((0,Ce.__)("An is needed for auto publishing your post to Internet Archive.","likecoin"),{Register:(0,r.createElement)(ut,{text:(0,Ce.__)("Internet Archive S3 API Key","likecoin"),linkAddress:"https://archive.org/account/s3.php"})});return(0,r.createElement)(nt,null,(0,r.createElement)(et,{checked:a,handleCheck:s,title:(0,Ce.__)("Auto archive","likecoin"),details:(0,Ce.__)("Auto publish post to Internet Archive","likecoin"),disabled:p&&!(l&&u)}),(0,r.createElement)(Qe,{title:(0,Ce.__)("Internet Archive S3 Config","likecoin")},(0,r.createElement)("p",null,E),(0,r.createElement)(nt,null,(0,r.createElement)(Qe,{title:(0,Ce.__)("S3 Access Key","likecoin")},(0,r.createElement)("input",{id:"internet_archive_access_key",type:"text",value:l,disabled:!p,onChange:e=>c(e.target.value)})),(0,r.createElement)(Qe,{title:(0,Ce.__)("S3 Secret","likecoin")},p?(0,r.createElement)("input",{id:"internet_archive_secret",type:"password",value:u,onChange:e=>d(e.target.value)}):(0,r.createElement)("button",{type:"button",className:"button",onClick:h},(0,Ce.__)("Edit","likecoin"))))))}),ht=(0,t.forwardRef)(function(e,n){const{DBSiteInternetArchiveEnabled:r}=(0,Oe.useSelect)(e=>e(Je).selectSitePublishOptions()),i=(0,t.useRef)(),[o,a]=(0,t.useState)(!!r);async function s(){const e=[];o&&e.push(i.current.submit()),await Promise.all(e)}return(0,t.useEffect)(()=>{a(!!r)},[r]),(0,t.useImperativeHandle)(n,()=>({submit:s})),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("h2",null,(0,Ce.__)("Publish to Internet Archive","likecoin")),(0,t.createElement)(dt,null),!o&&(0,t.createElement)(nt,null,(0,t.createElement)(et,{checked:o,handleCheck:a,title:(0,Ce.__)("Show settings","likecoin")})),o&&(0,t.createElement)(pt,{ref:i}))}),ft="likecoin/other_settings",mt="/likecoin/v1/option/web-monetization",Et={DBPaymentPointer:""},yt={setPaymentPointer:e=>({type:"SET_PAYMENT_POINTER",paymentPointer:e}),getPaymentPointer:()=>({type:"GET_PAYMENT_POINTER"}),setHTTPErrors:e=>({type:"SET_ERROR_MESSAGE",errorMsg:e}),*postPaymentPointer(e){yield{type:"POST_PAYMENT_POINTER",paymentPointer:e},yield{type:"CHANGE_PAYMENT_POINTER_GLOBAL_STATE",paymentPointer:e}}};Le(ft,{reducer:(e=Et,t)=>{switch(t.type){case"SET_PAYMENT_POINTER":case"CHANGE_PAYMENT_POINTER_GLOBAL_STATE":return{DBPaymentPointer:t.paymentPointer};default:return e}},controls:{GET_PAYMENT_POINTER:()=>Te()({path:mt}),POST_PAYMENT_POINTER:e=>Te()({method:"POST",path:mt,data:{paymentPointer:e.paymentPointer}})},selectors:{selectPaymentPointer:e=>e.DBPaymentPointer},resolvers:{*selectPaymentPointer(){try{const e=(yield yt.getPaymentPointer()).data.site_payment_pointer;return yt.setPaymentPointer(e)}catch(e){return yt.setHTTPErrors(e.message)}}},actions:yt});const gt=(0,r.createInterpolateElement)((0,Ce.__)(" is an API that allows websites to request small payments from users facilitated by the browser and the user's Web Monetization provider.","likecoin"),{WebMonetization:(0,r.createElement)(ut,{text:(0,Ce.__)("Web Monetization","likecoin"),linkAddress:"https://webmonetization.org/"})}),bt=(0,r.createInterpolateElement)((0,Ce.__)("You would need to register a to enable web monetization. However LikeCoin is working hard to integrate web monetization natively into our ecosystem. Follow our latest progress !","likecoin"),{PaymentPointer:(0,r.createElement)(ut,{text:(0,Ce.__)("payment pointer","likecoin"),linkAddress:"https://webmonetization.org/docs/ilp-wallets"}),Here:(0,r.createElement)(ut,{text:(0,Ce.__)("here","likecoin"),linkAddress:"https://community.webmonetization.org/likecoinprotocol"})}),_t=function(){return(0,r.createElement)("div",null,(0,r.createElement)("p",null,gt),(0,r.createElement)("p",null,bt))},kt=(0,t.forwardRef)(function(e,n){const r=(0,Oe.useSelect)(e=>e(ft).selectPaymentPointer()),{postPaymentPointer:i}=(0,Oe.useDispatch)(ft),[o,a]=(0,t.useState)(!!r);(0,t.useEffect)(()=>{a(!!r)},[r]);const s=(0,t.useRef)();async function l(){if(o)try{i(s.current.value)}catch(e){console.error(e)}}return(0,t.useImperativeHandle)(n,()=>({submit:l})),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Ke,{title:(0,Ce.__)("Web Monetization","likecoin")}),(0,t.createElement)(_t,null),(0,t.createElement)(nt,null,(0,t.createElement)(et,{checked:o,handleCheck:a,title:(0,Ce.__)("Web Monetization","likecoin"),details:(0,Ce.__)("Enable","likecoin")})),o&&(0,t.createElement)(nt,null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"row"},(0,t.createElement)("label",{htmlFor:"site_payment_pointer"},(0,Ce.__)("Payment pointer","likecoin"))),(0,t.createElement)("td",null,(0,t.createElement)("input",{type:"text",placeholder:"$wallet.example.com/alice",defaultValue:r,ref:s})," ",(0,t.createElement)("a",{rel:"noopener noreferrer",target:"_blank",href:"https://webmonetization.org/docs/ilp-wallets/"},(0,Ce.__)("What is payment pointer?","likecoin"))))))}),vt=function(){const[e,n]=(0,t.useState)(!1),r=(0,t.useRef)(),i=(0,t.useRef)(),o=(0,t.useRef)(),a=(0,t.useCallback)(async e=>{n(!1),e.preventDefault();try{await Promise.all([r.current.submit(),i.current.submit(),o.current.submit()]),n(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(e){console.error(e)}},[]),s=(0,t.useCallback)(e=>{e.preventDefault(),n(!1)},[]);return(0,t.createElement)("form",{className:"likecoin",onSubmit:a},e&&(0,t.createElement)(Ge,{text:(0,Ce.__)("Settings Saved","likecoin"),className:"notice-success",handleNoticeDismiss:s}),(0,t.createElement)(lt,{ref:r}),(0,t.createElement)("hr",null),(0,t.createElement)(ht,{ref:i}),(0,t.createElement)("hr",null),(0,t.createElement)(kt,{ref:o}),(0,t.createElement)(it,null))};function St(e,t){return function(){return e.apply(t,arguments)}}const{toString:wt}=Object.prototype,{getPrototypeOf:Ot}=Object,{iterator:Rt,toStringTag:Tt}=Symbol,Lt=(Pt=Object.create(null),e=>{const t=wt.call(e);return Pt[t]||(Pt[t]=t.slice(8,-1).toLowerCase())});var Pt;const Nt=e=>(e=e.toLowerCase(),t=>Lt(t)===e),At=e=>t=>typeof t===e,{isArray:It}=Array,Ct=At("undefined");function Dt(e){return null!==e&&!Ct(e)&&null!==e.constructor&&!Ct(e.constructor)&&Ut(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const xt=Nt("ArrayBuffer"),Bt=At("string"),Ut=At("function"),Ft=At("number"),jt=e=>null!==e&&"object"==typeof e,Wt=e=>{if("object"!==Lt(e))return!1;const t=Ot(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Tt in e||Rt in e)},Mt=Nt("Date"),Ht=Nt("File"),qt=Nt("Blob"),zt=Nt("FileList"),Kt=Nt("URLSearchParams"),[$t,Gt,Jt,Vt]=["ReadableStream","Request","Response","Headers"].map(Nt);function Yt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),It(e))for(r=0,i=e.length;r0;)if(r=n[i],t===r.toLowerCase())return r;return null}const Qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Zt=e=>!Ct(e)&&e!==Qt,en=(tn="undefined"!=typeof Uint8Array&&Ot(Uint8Array),e=>tn&&e instanceof tn);var tn;const nn=Nt("HTMLFormElement"),rn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),on=Nt("RegExp"),an=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Yt(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)},sn=Nt("AsyncFunction"),ln=(cn="function"==typeof setImmediate,un=Ut(Qt.postMessage),cn?setImmediate:un?(dn=`axios@${Math.random()}`,pn=[],Qt.addEventListener("message",({source:e,data:t})=>{e===Qt&&t===dn&&pn.length&&pn.shift()()},!1),e=>{pn.push(e),Qt.postMessage(dn,"*")}):e=>setTimeout(e));var cn,un,dn,pn;const hn="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Qt):"undefined"!=typeof process&&process.nextTick||ln,fn={isArray:It,isArrayBuffer:xt,isBuffer:Dt,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ut(e.append)&&("formdata"===(t=Lt(e))||"object"===t&&Ut(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&xt(e.buffer),t},isString:Bt,isNumber:Ft,isBoolean:e=>!0===e||!1===e,isObject:jt,isPlainObject:Wt,isEmptyObject:e=>{if(!jt(e)||Dt(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:$t,isRequest:Gt,isResponse:Jt,isHeaders:Vt,isUndefined:Ct,isDate:Mt,isFile:Ht,isBlob:qt,isRegExp:on,isFunction:Ut,isStream:e=>jt(e)&&Ut(e.pipe),isURLSearchParams:Kt,isTypedArray:en,isFileList:zt,forEach:Yt,merge:function e(){const{caseless:t}=Zt(this)&&this||{},n={},r=(r,i)=>{const o=t&&Xt(n,i)||i;Wt(n[o])&&Wt(r)?n[o]=e(n[o],r):Wt(r)?n[o]=e({},r):It(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e(Yt(t,(t,r)=>{n&&Ut(t)?e[r]=St(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Ot(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Lt,kindOfTest:Nt,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(It(e))return e;let t=e.length;if(!Ft(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Rt]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:nn,hasOwnProperty:rn,hasOwnProp:rn,reduceDescriptors:an,freezeMethods:e=>{an(e,(t,n)=>{if(Ut(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Ut(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return It(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Xt,global:Qt,isContextDefined:Zt,isSpecCompliantForm:function(e){return!!(e&&Ut(e.append)&&"FormData"===e[Tt]&&e[Rt])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(jt(e)){if(t.indexOf(e)>=0)return;if(Dt(e))return e;if(!("toJSON"in e)){t[r]=e;const i=It(e)?[]:{};return Yt(e,(e,t)=>{const o=n(e,r+1);!Ct(o)&&(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:sn,isThenable:e=>e&&(jt(e)||Ut(e))&&Ut(e.then)&&Ut(e.catch),setImmediate:ln,asap:hn,isIterable:e=>null!=e&&Ut(e[Rt])};function mn(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}fn.inherits(mn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:fn.toJSONObject(this.config),code:this.code,status:this.status}}});const En=mn.prototype,yn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{yn[e]={value:e}}),Object.defineProperties(mn,yn),Object.defineProperty(En,"isAxiosError",{value:!0}),mn.from=(e,t,n,r,i,o)=>{const a=Object.create(En);return fn.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),mn.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const gn=mn;function bn(e){return fn.isPlainObject(e)||fn.isArray(e)}function kn(e){return fn.endsWith(e,"[]")?e.slice(0,-2):e}function vn(e,t,n){return e?e.concat(t).map(function(e,t){return e=kn(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Sn=fn.toFlatObject(fn,{},null,function(e){return/^is[A-Z]/.test(e)}),wn=function(e,t,n){if(!fn.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=fn.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!fn.isUndefined(t[e])})).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&fn.isSpecCompliantForm(t);if(!fn.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(fn.isDate(e))return e.toISOString();if(fn.isBoolean(e))return e.toString();if(!s&&fn.isBlob(e))throw new gn("Blob is not supported. Use a Buffer instead.");return fn.isArrayBuffer(e)||fn.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(fn.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(fn.isArray(e)&&function(e){return fn.isArray(e)&&!e.some(bn)}(e)||(fn.isFileList(e)||fn.endsWith(n,"[]"))&&(s=fn.toArray(e)))return n=kn(n),s.forEach(function(e,r){!fn.isUndefined(e)&&null!==e&&t.append(!0===a?vn([n],r,o):null===a?n:n+"[]",l(e))}),!1;return!!bn(e)||(t.append(vn(i,n,o),l(e)),!1)}const u=[],d=Object.assign(Sn,{defaultVisitor:c,convertValue:l,isVisitable:bn});if(!fn.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!fn.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),fn.forEach(n,function(n,o){!0===(!(fn.isUndefined(n)||null===n)&&i.call(t,n,fn.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o])}),u.pop()}}(e),t};function On(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Rn(e,t){this._pairs=[],e&&wn(e,this,t)}const Tn=Rn.prototype;Tn.append=function(e,t){this._pairs.push([e,t])},Tn.toString=function(e){const t=e?function(t){return e.call(this,t,On)}:On;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Ln=Rn;function Pn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nn(e,t,n){if(!t)return e;const r=n&&n.encode||Pn;fn.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(o=i?i(t,n):fn.isURLSearchParams(t)?t.toString():new Ln(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const An=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){fn.forEach(this.handlers,function(t){null!==t&&e(t)})}},In={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Cn={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ln,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Dn="undefined"!=typeof window&&"undefined"!=typeof document,xn="object"==typeof navigator&&navigator||void 0,Bn=Dn&&(!xn||["ReactNative","NativeScript","NS"].indexOf(xn.product)<0),Un="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Fn=Dn&&window.location.href||"http://localhost",jn={...e,...Cn},Wn=function(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&fn.isArray(r)?r.length:o,s?(fn.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&fn.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&fn.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r{t(function(e){return fn.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null},Mn={transitional:In,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=fn.isObject(e);if(i&&fn.isHTMLForm(e)&&(e=new FormData(e)),fn.isFormData(e))return r?JSON.stringify(Wn(e)):e;if(fn.isArrayBuffer(e)||fn.isBuffer(e)||fn.isStream(e)||fn.isFile(e)||fn.isBlob(e)||fn.isReadableStream(e))return e;if(fn.isArrayBufferView(e))return e.buffer;if(fn.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return wn(e,new jn.classes.URLSearchParams,{visitor:function(e,t,n,r){return jn.isNode&&fn.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=fn.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return wn(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e){if(fn.isString(e))try{return(0,JSON.parse)(e),fn.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Mn.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(fn.isResponse(e)||fn.isReadableStream(e))return e;if(e&&fn.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw gn.from(e,gn.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:jn.classes.FormData,Blob:jn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};fn.forEach(["delete","get","head","post","put","patch"],e=>{Mn.headers[e]={}});const Hn=Mn,qn=fn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zn=Symbol("internals");function Kn(e){return e&&String(e).trim().toLowerCase()}function $n(e){return!1===e||null==e?e:fn.isArray(e)?e.map($n):String(e)}function Gn(e,t,n,r,i){return fn.isFunction(r)?r.call(this,t,n):(i&&(t=n),fn.isString(t)?fn.isString(r)?-1!==t.indexOf(r):fn.isRegExp(r)?r.test(t):void 0:void 0)}class Jn{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=Kn(t);if(!i)throw new Error("header name must be a non-empty string");const o=fn.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=$n(e))}const o=(e,t)=>fn.forEach(e,(e,n)=>i(e,n,t));if(fn.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(fn.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&qn[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(fn.isObject(e)&&fn.isIterable(e)){let n,r,i={};for(const t of e){if(!fn.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?fn.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=Kn(e)){const n=fn.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(fn.isFunction(t))return t.call(this,e,n);if(fn.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Kn(e)){const n=fn.findKey(this,e);return!(!n||void 0===this[n]||t&&!Gn(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=Kn(e)){const i=fn.findKey(n,e);!i||t&&!Gn(0,n[i],i,t)||(delete n[i],r=!0)}}return fn.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Gn(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return fn.forEach(this,(r,i)=>{const o=fn.findKey(n,i);if(o)return t[o]=$n(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();a!==i&&delete t[i],t[a]=$n(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return fn.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&fn.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[zn]=this[zn]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Kn(e);t[r]||(function(e,t){const n=fn.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return fn.isArray(e)?e.forEach(r):r(e),this}}Jn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),fn.reduceDescriptors(Jn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),fn.freezeMethods(Jn);const Vn=Jn;function Yn(e,t){const n=this||Hn,r=t||n,i=Vn.from(r.headers);let o=r.data;return fn.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Xn(e){return!(!e||!e.__CANCEL__)}function Qn(e,t,n){gn.call(this,null==e?"canceled":e,gn.ERR_CANCELED,t,n),this.name="CanceledError"}fn.inherits(Qn,gn,{__CANCEL__:!0});const Zn=Qn;function er(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new gn("Request failed with status code "+n.status,[gn.ERR_BAD_REQUEST,gn.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const tr=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];i||(i=l),n[o]=s,r[o]=l;let u=a,d=0;for(;u!==o;)d+=n[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),l-i{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-i;s>=o?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},o-s)))},()=>n&&a(n)]}(n=>{const o=n.loaded,a=n.lengthComputable?n.total:void 0,s=o-r,l=i(s);r=o,e({loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},nr=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},rr=e=>(...t)=>fn.asap(()=>e(...t)),ir=jn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,jn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(jn.origin),jn.navigator&&/(msie|trident)/i.test(jn.navigator.userAgent)):()=>!0,or=jn.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const a=[e+"="+encodeURIComponent(t)];fn.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),fn.isString(r)&&a.push("path="+r),fn.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ar(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const sr=e=>e instanceof Vn?{...e}:e;function lr(e,t){t=t||{};const n={};function r(e,t,n,r){return fn.isPlainObject(e)&&fn.isPlainObject(t)?fn.merge.call({caseless:r},e,t):fn.isPlainObject(t)?fn.merge({},t):fn.isArray(t)?t.slice():t}function i(e,t,n,i){return fn.isUndefined(t)?fn.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!fn.isUndefined(t))return r(void 0,t)}function a(e,t){return fn.isUndefined(t)?fn.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>i(sr(e),sr(t),0,!0)};return fn.forEach(Object.keys({...e,...t}),function(r){const o=l[r]||i,a=o(e[r],t[r],r);fn.isUndefined(a)&&o!==s||(n[r]=a)}),n}const cr=e=>{const t=lr({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:l}=t;if(t.headers=s=Vn.from(s),t.url=Nn(ar(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),fn.isFormData(r))if(jn.hasStandardBrowserEnv||jn.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(jn.hasStandardBrowserEnv&&(i&&fn.isFunction(i)&&(i=i(t)),i||!1!==i&&ir(t.url))){const e=o&&a&&or.read(a);e&&s.set(o,e)}return t},ur="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=cr(e);let i=r.data;const o=Vn.from(r.headers).normalize();let a,s,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function E(){if(!m)return;const r=Vn.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());er(function(e){t(e),f()},function(e){n(e),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=E:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(E)},m.onabort=function(){m&&(n(new gn("Request aborted",gn.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new gn("Network Error",gn.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||In;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new gn(t,i.clarifyTimeoutError?gn.ETIMEDOUT:gn.ECONNABORTED,e,m)),m=null},void 0===i&&o.setContentType(null),"setRequestHeader"in m&&fn.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),fn.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([l,u]=tr(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([s,c]=tr(p),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new Zn(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===jn.protocols.indexOf(y)?n(new gn("Unsupported protocol "+y+":",gn.ERR_BAD_REQUEST,e)):m.send(i||null)})},dr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof gn?t:new Zn(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,i(new gn(`timeout ${t} of ms exceeded`,gn.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:s}=r;return s.unsubscribe=()=>fn.asap(a),s}},pr=function*(e,t){let n=e.byteLength;if(!t||n{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*pr(n,t)}(e,t);let o,a=0,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return s(),void e.close();let o=r.byteLength;if(n){let e=a+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},fr="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,mr=fr&&"function"==typeof ReadableStream,Er=fr&&("function"==typeof TextEncoder?(yr=new TextEncoder,e=>yr.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var yr;const gr=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},br=mr&&gr(()=>{let e=!1;const t=new Request(jn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),_r=mr&&gr(()=>fn.isReadableStream(new Response("").body)),kr={stream:_r&&(e=>e.body)};var vr;fr&&(vr=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!kr[e]&&(kr[e]=fn.isFunction(vr[e])?t=>t[e]():(t,n)=>{throw new gn(`Response type '${e}' is not supported`,gn.ERR_NOT_SUPPORT,n)})}));const Sr={http:null,xhr:ur,fetch:fr&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:a,onDownloadProgress:s,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=cr(e);c=c?(c+"").toLowerCase():"text";let h,f=dr([i,o&&o.toAbortSignal()],a);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let E;try{if(l&&br&&"get"!==n&&"head"!==n&&0!==(E=await(async(e,t)=>{const n=fn.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(fn.isBlob(e))return e.size;if(fn.isSpecCompliantForm(e)){const t=new Request(jn.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return fn.isArrayBufferView(e)||fn.isArrayBuffer(e)?e.byteLength:(fn.isURLSearchParams(e)&&(e+=""),fn.isString(e)?(await Er(e)).byteLength:void 0)})(t):n})(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(fn.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=nr(E,tr(rr(l)));r=hr(n.body,65536,e,t)}}fn.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;h=new Request(t,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:i?d:void 0});let o=await fetch(h,p);const a=_r&&("stream"===c||"response"===c);if(_r&&(s||a&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=o[t]});const t=fn.toFiniteNumber(o.headers.get("content-length")),[n,r]=s&&nr(t,tr(rr(s),!0))||[];o=new Response(hr(o.body,65536,n,()=>{r&&r(),m&&m()}),e)}c=c||"text";let y=await kr[fn.findKey(kr,c)||"text"](o,e);return!a&&m&&m(),await new Promise((t,n)=>{er(t,n,{data:y,headers:Vn.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:h})})}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new gn("Network Error",gn.ERR_NETWORK,e,h),{cause:t.cause||t});throw gn.from(t,t&&t.code,e,h)}})};fn.forEach(Sr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const wr=e=>`- ${e}`,Or=e=>fn.isFunction(e)||null===e||!1===e,Rr=e=>{e=fn.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let n=t?e.length>1?"since :\n"+e.map(wr).join("\n"):" "+wr(e[0]):"as no adapter specified";throw new gn("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Tr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Zn(null,e)}function Lr(e){return Tr(e),e.headers=Vn.from(e.headers),e.data=Yn.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Rr(e.adapter||Hn.adapter)(e).then(function(t){return Tr(e),t.data=Yn.call(e,e.transformResponse,t),t.headers=Vn.from(t.headers),t},function(t){return Xn(t)||(Tr(e),t&&t.response&&(t.response.data=Yn.call(e,e.transformResponse,t.response),t.response.headers=Vn.from(t.response.headers))),Promise.reject(t)})}const Pr="1.11.0",Nr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Nr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ar={};Nr.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Pr+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new gn(r(i," has been removed"+(t?" in "+t:"")),gn.ERR_DEPRECATED);return t&&!Ar[i]&&(Ar[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},Nr.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Ir={assertOptions:function(e,t,n){if("object"!=typeof e)throw new gn("options must be an object",gn.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new gn("option "+o+" must be "+n,gn.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new gn("Unknown option "+o,gn.ERR_BAD_OPTION)}},validators:Nr},Cr=Ir.validators;class Dr{constructor(e){this.defaults=e||{},this.interceptors={request:new An,response:new An}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=lr(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Ir.assertOptions(n,{silentJSONParsing:Cr.transitional(Cr.boolean),forcedJSONParsing:Cr.transitional(Cr.boolean),clarifyTimeoutError:Cr.transitional(Cr.boolean)},!1),null!=r&&(fn.isFunction(r)?t.paramsSerializer={serialize:r}:Ir.assertOptions(r,{encode:Cr.function,serialize:Cr.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Ir.assertOptions(t,{baseUrl:Cr.spelling("baseURL"),withXsrfToken:Cr.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&fn.merge(i.common,i[t.method]);i&&fn.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=Vn.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!s){const e=[Lr.bind(this),void 0];for(e.unshift(...a),e.push(...l),u=e.length,c=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Zn(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Br(function(t){e=t}),cancel:e}}}const Ur=Br,Fr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fr).forEach(([e,t])=>{Fr[t]=e});const jr=Fr,Wr=function e(t){const n=new xr(t),r=St(xr.prototype.request,n);return fn.extend(r,xr.prototype,n,{allOwnKeys:!0}),fn.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(lr(t,n))},r}(Hn);Wr.Axios=xr,Wr.CanceledError=Zn,Wr.CancelToken=Ur,Wr.isCancel=Xn,Wr.VERSION=Pr,Wr.toFormData=wn,Wr.AxiosError=gn,Wr.Cancel=Wr.CanceledError,Wr.all=function(e){return Promise.all(e)},Wr.spread=function(e){return function(t){return e.apply(null,t)}},Wr.isAxiosError=function(e){return fn.isObject(e)&&!0===e.isAxiosError},Wr.mergeConfig=lr,Wr.AxiosHeaders=Vn,Wr.formToJSON=e=>Wn(fn.isHTMLForm(e)?new FormData(e):e),Wr.getAdapter=Rr,Wr.HttpStatusCode=jr,Wr.default=Wr;const Mr=Wr,Hr=window.lodash;function qr({defaultLikerId:e,defaultLikerDisplayName:n,defaultLikerWalletAddress:r,defaultLikerAvatar:i,likecoHost:o,onLikerIdUpdate:a,editable:s}){const l=(0,t.useRef)(),[c,u]=(0,t.useState)(e),[d,p]=(0,t.useState)(n),[h,f]=(0,t.useState)(r),[m,E]=(0,t.useState)(i),[y,g]=(0,t.useState)(!1),[b,_]=(0,t.useState)(!1),[k,v]=(0,t.useState)(!0),[S,w]=(0,t.useState)(!1),O=(0,t.useMemo)(()=>(0,Hr.debounce)(async e=>{if(e)try{const t=await Mr.get(`https://api.${o}/users/id/${e}/min`),{user:n,displayName:r,likeWallet:i,avatar:s}=t.data;u(n),p(r),f(i),E(s),g(!1),a({likerIdValue:n,likerDisplayName:r,likerWalletAddress:i,likerAvatar:s})}catch(e){g(!1),u(""),p(""),f(""),E("")}},500),[]);return(0,t.useEffect)(()=>{O(c)},[O,c]),(0,t.useEffect)(()=>{u(e),p(n),f(r),E(i),v(!!e),w(!!e),_(!e)},[e,n,r,i]),(0,t.useEffect)(()=>{w(!!c),v(!!c)},[c]),(0,t.createElement)(t.Fragment,null,s&&(!c||b)&&(0,t.createElement)("div",{className:"tablenav top"},(0,t.createElement)("div",{className:"alignleft actions"},(0,t.createElement)("input",{ref:l,id:"likecoinIdInputBox",className:"likecoinInputBox",type:"text",placeholder:(0,Ce.__)("Search your Liker ID","likecoin"),onChange:function(e){e.preventDefault(),_(!0),g(!0);const t=e.target.value;u(t)}})," ",(0,t.createElement)("a",{id:"likecoinInputLabel",className:"likecoinInputLabel",target:"_blank",rel:"noopener noreferrer",href:`https://${o}/in`},(0,Ce.__)("Sign Up / Find my Liker ID","likecoin"))),(0,t.createElement)("br",{className:"clear"})),y?c&&(0,t.createElement)("p",{className:"description"},(0,Ce.__)("Loading...","likecoin")):d&&(0,t.createElement)("table",{className:"wp-list-table widefat fixed striped table-view-list"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,Ce.__)("Liker ID","likecoin")),(0,t.createElement)("th",null,(0,Ce.__)("Wallet","likecoin")),(0,t.createElement)("th",null,(0,Ce.__)("Actions","likecoin")))),(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("td",{className:"column-username"},m&&(0,t.createElement)("img",{id:"likecoinAvatar",src:m,width:"48",height:"48",alt:"Avatar"}),(0,t.createElement)("strong",null,(0,t.createElement)("a",{id:"likecoinId",rel:"noopener noreferrer",target:"_blank",href:`https://${o}/${c}`,className:"likecoin"},d))),(0,t.createElement)("td",null,h),(0,t.createElement)("td",null,s&&(0,t.createElement)(t.Fragment,null,k&&(0,t.createElement)("button",{className:"button",type:"button",onClick:function(e){e.preventDefault(),_(!0)}},(0,Ce.__)("Change","likecoin")),S&&(0,t.createElement)(t.Fragment,null," ",(0,t.createElement)("button",{className:"button button-danger",type:"button",onClick:function(e){e.preventDefault(),u(""),p(""),f(""),E(""),a({likerIdValue:"",likerDisplayName:"",likerWalletAddress:"",likerAvatar:""})}},(0,Ce.__)("Disconnect","likecoin")))))))),(0,t.createElement)("section",null,c&&!y&&!m&&(0,t.createElement)("div",{className:"likecoin likecoinError userNotFound"},(0,t.createElement)("h4",null,(0,Ce.__)("Liker ID not found","likecoin")))))}qr.propTypes={defaultLikerId:Ue().string,defaultLikerDisplayName:Ue().string,defaultLikerWalletAddress:Ue().string,defaultLikerAvatar:Ue().string,likecoHost:Ue().string.isRequired,onLikerIdUpdate:Ue().func.isRequired,editable:Ue().bool},qr.defaultProps={defaultLikerId:"",defaultLikerDisplayName:"",defaultLikerWalletAddress:"",defaultLikerAvatar:"",editable:!1};const zr=qr,Kr="likecoin/user_liker_info",$r="/likecoin/v1/options/liker-id/user",Gr={DBUserLikerId:"",DBUserLikerAvatar:"",DBUserLikerDisplayName:"",DBUserLikerWallet:""},Jr={getUserLikerInfo:e=>({type:"GET_USER_LIKER_INFO",path:e}),setUserLikerInfo:e=>({type:"SET_USER_LIKER_INFO",info:e}),setHTTPErrors:e=>({type:"SET_ERROR_MESSAGE",errorMsg:e}),*postUserLikerInfo(e){yield{type:"POST_USER_LIKER_INFO_TO_DB",data:e},e.likecoin_user&&(yield{type:"CHANGE_USER_LIKER_INFO_GLOBAL_STATE",data:e})}};Le(Kr,{reducer:(e=Gr,t)=>{switch(t.type){case"SET_USER_LIKER_INFO":return{DBUserLikerId:t.info?t.info.likecoin_user.likecoin_id:"",DBUserLikerAvatar:t.info?t.info.likecoin_user.avatar:"",DBUserLikerDisplayName:t.info?t.info.likecoin_user.display_name:"",DBUserLikerWallet:t.info?t.info.likecoin_user.wallet:""};case"CHANGE_USER_LIKER_INFO_GLOBAL_STATE":return{DBUserLikerId:t.data.userLikerInfos.likecoin_id,DBUserLikerAvatar:t.data.userLikerInfos.avatar,DBUserLikerDisplayName:t.data.userLikerInfos.display_name,DBUserLikerWallet:t.data.userLikerInfos.wallet};default:return e}},controls:{GET_USER_LIKER_INFO:e=>Te()({path:e.path}),POST_USER_LIKER_INFO_TO_DB:e=>Te()({method:"POST",path:$r,data:e.data})},selectors:{selectUserLikerInfo:e=>e},resolvers:{*selectUserLikerInfo(){try{const e=(yield Jr.getUserLikerInfo($r)).data;return Jr.setUserLikerInfo(e)}catch(e){return Jr.setHTTPErrors(e.message)}}},actions:Jr});const{likecoHost:Vr}=window.likecoinReactAppData,Yr=function(){const{DBUserLikerId:e,DBUserLikerAvatar:n,DBUserLikerDisplayName:r,DBUserLikerWallet:i}=(0,Oe.useSelect)(e=>e(Kr).selectUserLikerInfo()),{postUserLikerInfo:o}=(0,Oe.useDispatch)(Kr),[a,s]=(0,t.useState)(!1),[l,c]=(0,t.useState)({}),u=(0,t.useCallback)(e=>{c(e)},[]),d=(0,t.useCallback)(e=>{s(!1),e.preventDefault();const t={userLikerInfos:{likecoin_id:l.likerIdValue,display_name:l.likerDisplayName,wallet:l.likerWalletAddress,avatar:l.likerAvatar}};try{o(t),s(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(e){console.error("Error occured when saving to Wordpress DB: ",e)}},[l,o]),p=(0,t.useCallback)(e=>{e.preventDefault(),s(!1)},[]);return(0,t.createElement)("div",{className:"likecoin"},a&&(0,t.createElement)(Ge,{text:(0,Ce.__)("Settings Saved","likecoin"),className:"notice-success",handleNoticeDismiss:p}),(0,t.createElement)("form",{onSubmit:d},(0,t.createElement)(Ke,{title:(0,Ce.__)("Your Liker ID","likecoin")}),(0,t.createElement)("p",null,(0,Ce.__)("This is your Liker ID, which is used to display LikeCoin button when post is not registered on ISCN yet.","likecoin")),(0,t.createElement)(zr,{likecoHost:Vr,defaultLikerId:e,defaultLikerDisplayName:r,defaultLikerWalletAddress:i,defaultLikerAvatar:n,editable:!0,onLikerIdUpdate:u}),(0,t.createElement)(it,null)))},{likecoHost:Xr}=window.likecoinReactAppData,Qr=function(){const{DBUserCanEditOption:e,DBSiteLikerId:n,DBSiteLikerAvatar:r,DBSiteLikerDisplayName:i,DBSiteLikerWallet:o}=(0,Oe.useSelect)(e=>e(Pe).selectSiteLikerInfo()),{postSiteLikerInfo:a}=(0,Oe.useDispatch)(Pe),[s,l]=(0,t.useState)(!1),[c,u]=(0,t.useState)({}),d=(0,t.useCallback)(e=>{u(e)},[]),p=(0,t.useCallback)(t=>{l(!1),t.preventDefault();const n={siteLikerInfos:{likecoin_id:c.likerIdValue,display_name:c.likerDisplayName,wallet:c.likerWalletAddress,avatar:c.likerAvatar}};try{e&&a(n),l(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(e){console.error("Error occured when saving to Wordpress DB: ",e)}},[c,e,a]),h=(0,t.useCallback)(e=>{e.preventDefault(),l(!1)},[]);return(0,t.createElement)("div",{className:"likecoin"},s&&(0,t.createElement)(Ge,{text:(0,Ce.__)("Settings Saved","likecoin"),className:"notice-success",handleNoticeDismiss:h}),(0,t.createElement)("form",{onSubmit:p},(0,t.createElement)(Ke,{title:(0,Ce.__)("Site Default Liker ID","likecoin")}),(0,t.createElement)("p",null,(0,Ce.__)("This will be the site default Liker ID if any author has not set one.","likecoin")),(0,t.createElement)(zr,{likecoHost:Xr,defaultLikerId:n,defaultLikerDisplayName:i,defaultLikerWalletAddress:o,defaultLikerAvatar:r,editable:e,onLikerIdUpdate:d}),e&&(0,t.createElement)(it,null)))},Zr=n.p+"images/w3p_banner.13b75e39.png",ei=function(){const e=(0,r.createInterpolateElement)((0,Ce.__)("Web3Press provides a creative business model, especially for open content. No paywall or advertisement anymore.\n Web3Press is based on , an application-specific blockchain that the community and infrastructure focus on the creator’s economy.","likecoin"),{LikeCoin:(0,r.createElement)(ut,{text:(0,Ce.__)("LikeCoin","likecoin"),linkAddress:"https://like.co"})}),t=(0,r.createInterpolateElement)((0,Ce.__)("Idea is the best product for your readers. Your readers buy your posts because they love your words. Web3Press helps you to productize your posts as . Let readers support you by buying your posts while reading.","likecoin"),{WNFT:(0,r.createElement)(ut,{text:(0,Ce.__)("NFTs","likecoin"),linkAddress:"https://liker.land/writing-nft/about"})}),n=(0,r.createInterpolateElement)((0,Ce.__)("You know who has bought your NFTs with . You can connect with your fans by sending NFT gifts with warm greetings is not only possible but convenient. Conditional offers can be made according to the open data on-chain.","likecoin"),{Explorer:(0,r.createElement)(ut,{text:(0,Ce.__)("on-chain data","likecoin"),linkAddress:"https://www.mintscan.io/likecoin"})}),i=(0,r.createInterpolateElement)((0,Ce.__)("“You are what you read”. Share your with pride. Collect the rare and valuable articles into your wallet.","likecoin"),{Portfolio:(0,r.createElement)(ut,{text:(0,Ce.__)("NFT portfolio","likecoin"),linkAddress:"https://liker.land/dashboard?tab=collected"})}),o=(0,r.createInterpolateElement)((0,Ce.__)("Web3Press is based on , an application-specific blockchain that the community and infrastructure focus on the creator’s economy.","likecoin"),{LikeCoin:(0,r.createElement)(ut,{text:(0,Ce.__)("LikeCoin","likecoin"),linkAddress:"https://like.co"})}),a=(0,r.createInterpolateElement)((0,Ce.__)("Register metadata () on the , store content on the decentralized file system ( and ), and backup on Internet Archive, all in one plugin.","likecoin"),{ISCN:(0,r.createElement)(ut,{text:(0,Ce.__)("ISCN","likecoin"),linkAddress:"https://iscn.io"}),LikeCoinChain:(0,r.createElement)(ut,{text:(0,Ce.__)("LikeCoin chain","likecoin"),linkAddress:"https://www.mintscan.io/likecoin"}),IPFS:(0,r.createElement)(ut,{text:(0,Ce.__)("IPFS","likecoin"),linkAddress:"https://ipfs.io/"}),Arweave:(0,r.createElement)(ut,{text:(0,Ce.__)("Arweave","likecoin"),linkAddress:"https://arweave.io/"})}),s=(0,r.createInterpolateElement)((0,Ce.__)("Web3 is a new standard of the Internet. The Internet has been evolving in the past decades and becoming increasingly decentralized. In Web1, information was 1-way-broadcast; in Web2, information was user-generated. In Web3, the concept of ownership applies to every piece of data. Echoing , the vision of WordPress, Web3Press pushes one more step forward: the freedom to OWN. Oh yes, it’s free, as in freedom.","likecoin"),{WordPress:(0,r.createElement)(ut,{text:(0,Ce.__)("Democratise Publishing","likecoin"),linkAddress:"https://wordpress.org/about/"})}),l=(0,r.createInterpolateElement)((0,Ce.__)("Follow us by entering your email below, or visit our for latest update.","likecoin"),{Blog:(0,r.createElement)(ut,{text:(0,Ce.__)("blog","likecoin"),linkAddress:"https://blog.like.co/?utm_source=wordpress&utm_medium=plugin&utm_campaign=about_page"})});return(0,r.createElement)("div",{className:"likecoin"},(0,r.createElement)("img",{src:Zr,alt:"Word3Press Banner"}),(0,r.createElement)("h2",null,(0,Ce.__)("What is Web3Press?","likecoin")),(0,r.createElement)("p",null,e),(0,r.createElement)("p",null,(0,Ce.__)("With Web3Press, you can:","likecoin")),(0,r.createElement)("h3",null,(0,Ce.__)("Sell your posts","likecoin")),(0,r.createElement)("p",null,t),(0,r.createElement)("h3",null,(0,Ce.__)("Be proud of your work","likecoin")),(0,r.createElement)("p",null,i),(0,r.createElement)("h3",null,(0,Ce.__)("Build Community","likecoin")),(0,r.createElement)("p",null,n),(0,r.createElement)("h3",null,(0,Ce.__)("Preserve Content","likecoin")),(0,r.createElement)("p",null,a),(0,r.createElement)("hr",null),(0,r.createElement)("h2",null,(0,Ce.__)("What is LikeCoin","likecoin")),(0,r.createElement)("p",null,o),(0,r.createElement)("h2",null,(0,Ce.__)("Why Web3","likecoin")),(0,r.createElement)("p",null,s),(0,r.createElement)("hr",null),(0,r.createElement)("h2",null,(0,Ce.__)("Subscribe to our Newsletter","likecoin")),(0,r.createElement)("p",null,l),(0,r.createElement)("iframe",{src:"https://newsletter.like.co/embed",width:"100%",height:"150",title:(0,Ce.__)("Subscribe to LikeCoin newsletter","likecoin"),style:{border:"1px solid #EEE",maxWidth:"420px"},frameBorder:"0",scrolling:"no"}),(0,r.createElement)("hr",null),(0,r.createElement)("h2",null,(0,Ce.__)("Sponsor us on GitHub","likecoin")),(0,r.createElement)("iframe",{className:"lcp-github-sponsor-card",src:"https://github.com/sponsors/likecoin/card",title:"Sponsor likecoin",height:"150",width:"100%",style:{maxWidth:"660px"}}))},ti=function(){const e=(0,r.createInterpolateElement)((0,Ce.__)("Please refer to for help on using this plugin","likecoin"),{Help:(0,r.createElement)(ut,{text:(0,Ce.__)("this guide","likecoin"),linkAddress:"https://docs.like.co/user-guide/wordpress"})}),t=(0,r.createInterpolateElement)((0,Ce.__)("Never heard of LikeCoin? Don’t worry, here are some for you to get started.","likecoin"),{LikeCoin:(0,r.createElement)(ut,{text:(0,Ce.__)("LikeCoin","likecoin"),linkAddress:"https://like.co"}),Link:(0,r.createElement)(ut,{text:(0,Ce.__)("here","likecoin"),linkAddress:`https://faucet.like.co/?platform=wordpress&referrer=${encodeURIComponent(document.location.origin)}`})}),n=(0,r.createInterpolateElement)((0,Ce.__)("Follow us by entering your email below, or visit our for latest update.","likecoin"),{Blog:(0,r.createElement)(ut,{text:(0,Ce.__)("blog","likecoin"),linkAddress:"https://blog.like.co/?utm_source=wordpress&utm_medium=plugin&utm_campaign=getting_started"})});return(0,r.createElement)("div",{className:"lcp-nav-tab-panel likecoin"},(0,r.createElement)(Ke,{title:(0,Ce.__)("Getting Started","likecoin")}),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h2",null,(0,Ce.__)("1. Get some LikeCoin tokens to get started","likecoin")),(0,r.createElement)("p",null,t)),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h2",null,(0,Ce.__)("2. You are now ready, let’s start publishing.","likecoin")),(0,r.createElement)("p",null,(0,Ce.__)("Here is a video to help you understand how to publish a Writing NFT","likecoin")),(0,r.createElement)("iframe",{height:"315",src:"https://www.youtube.com/embed/zHmAidvifQw",title:(0,Ce.__)("Quickstart Video","likecoin"),frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:!0,style:{width:"100%",maxWidth:"560px"}}),(0,r.createElement)("p",null,e)),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h2",null,(0,Ce.__)("3. Subscribe to our newsletter for upcoming features","likecoin")),(0,r.createElement)("p",null,n),(0,r.createElement)("iframe",{src:"https://newsletter.like.co/embed",width:"100%",height:"150",title:(0,Ce.__)("Subscribe to LikeCoin newsletter","likecoin"),style:{border:"1px solid #EEE",background:"white",maxWidth:"420px"},frameBorder:"0",scrolling:"no"})),(0,r.createElement)("hr",null),(0,r.createElement)(Ke,{title:(0,Ce.__)("Useful Tips","likecoin")}),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h3",null,(0,Ce.__)("Publish your post before you mint Writing NFT","likecoin")),(0,r.createElement)("p",null,(0,Ce.__)("You need to publish your post first, then you can find the Publish button on the editing sidebar.","likecoin"))),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h3",null,(0,Ce.__)("Publish along with licence","likecoin")),(0,r.createElement)("p",null,(0,Ce.__)("You can set your preferred licence on the editing sidebar.","likecoin"))),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h3",null,(0,Ce.__)("Encourage your readers to collect Writing NFT of your works","likecoin")),(0,r.createElement)("p",null,(0,Ce.__)("Let your readers aware they can collect Writing NFT of your works. Let them know it is meaningful to support you.","likecoin"))))},ni=window.likecoinReactAppData||{},{appSelector:ri}=ni,ii=document.querySelector(ri);ii&&(0,r.render)((0,t.createElement)(function(e){let{basename:n,children:r,future:i,window:f}=e,m=t.useRef();var E;null==m.current&&(m.current=(void 0===(E={window:f,v5Compat:!0})&&(E={}),function(e,t,n,r){void 0===r&&(r={});let{window:i=document.defaultView,v5Compat:c=!1}=r,h=i.history,f=a.Pop,m=null,E=y();function y(){return(h.state||{idx:null}).idx}function g(){f=a.Pop;let e=y(),t=null==e?null:e-E;E=e,m&&m({action:f,location:_.location,delta:t})}function b(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof e?e:p(e);return n=n.replace(/ $/,"%20"),l(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==E&&(E=0,h.replaceState(o({},h.state,{idx:E}),""));let _={get action(){return f},get location(){return e(i,h)},listen(e){if(m)throw new Error("A history only accepts one active listener");return i.addEventListener(s,g),m=e,()=>{i.removeEventListener(s,g),m=null}},createHref:e=>t(i,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){f=a.Push;let r=d(_.location,e,t);n&&n(r,e),E=y()+1;let o=u(r,E),s=_.createHref(r);try{h.pushState(o,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;i.location.assign(s)}c&&m&&m({action:f,location:_.location,delta:1})},replace:function(e,t){f=a.Replace;let r=d(_.location,e,t);n&&n(r,e),E=y();let i=u(r,E),o=_.createHref(r);h.replaceState(i,"",o),c&&m&&m({action:f,location:_.location,delta:0})},go:e=>h.go(e)};return _}(function(e,t){let{pathname:n="/",search:r="",hash:i=""}=h(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),d("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:p(t))},function(e,t){c("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},E)));let y=m.current,[g,b]=t.useState({action:y.action,location:y.location}),{v7_startTransition:_}=i||{},k=t.useCallback(e=>{_&&ge?ge(()=>b(e)):b(e)},[b,_]);return t.useLayoutEffect(()=>y.listen(k),[y,k]),t.useEffect(()=>{return null==(e=i)||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),void(t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation));var e,t},[i]),t.createElement(ue,{basename:n,children:r,location:g.location,navigationType:g.action,navigator:y,future:i})},null,(0,t.createElement)(function(){const{DBUserCanEditOption:e}=(0,Oe.useSelect)(e=>e(Pe).selectSiteLikerInfo());return(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h2",null," "),(0,t.createElement)(xe,null),(0,t.createElement)(de,null,(0,t.createElement)(ce,{path:"",element:(0,t.createElement)(Me,null)},(0,t.createElement)(ce,{index:!0,element:e?(0,t.createElement)(ot,null):(0,t.createElement)(se,{to:"/about",replace:!0})}),(0,t.createElement)(ce,{path:"advanced",element:(0,t.createElement)(vt,null)}),(0,t.createElement)(ce,{path:"about",element:(0,t.createElement)(ei,null)})),(0,t.createElement)(ce,{path:"liker-id",element:(0,t.createElement)(at,null)},(0,t.createElement)(ce,{index:!0,element:e?(0,t.createElement)(Qr,null):(0,t.createElement)(se,{to:"user",replace:!0})}),(0,t.createElement)(ce,{path:"user",element:(0,t.createElement)(Yr,null)})),(0,t.createElement)(ce,{path:"help",element:(0,t.createElement)(ti,null)})))},null)),ii)})()})(); \ No newline at end of file +(()=>{var e={556:(e,t,n)=>{e.exports=n(694)()},694:(e,t,n)=>{"use strict";var r=n(925);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=r[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{"use strict";var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>Qn,hasStandardBrowserEnv:()=>er,hasStandardBrowserWebWorkerEnv:()=>tr,navigator:()=>Zn,origin:()=>nr});const t=window.React,r=window.wp.element,i=window.ReactDOM;function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var f;function m(e,t,n){return void 0===n&&(n="/"),function(e,t,n,r){let i=P(("string"==typeof t?h(t):t).pathname||"/",n);if(null==i)return null;let o=E(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(o);let a=null;for(let e=0;null==a&&e{let a={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};a.relativePath.startsWith("/")&&(l(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let s=I([r,a.relativePath]),c=n.concat(a);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),E(e.children,t,c,s)),(null!=e.path||e.index)&&t.push({path:s,score:R(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of y(e.path))i(e,t,n);else i(e,t)}),t}function y(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=y(r.join("/")),s=[];return s.push(...a.map(e=>""===e?o:[o,e].join("/"))),i&&s.push(...a),s.map(t=>e.startsWith("/")&&""===t?"/":t)}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(f||(f={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const g=/^:[\w-]+$/,b=3,_=2,k=1,v=10,w=-2,S=e=>"*"===e;function R(e,t){let n=e.split("/"),r=n.length;return n.some(S)&&(r+=w),t&&(r+=_),n.filter(e=>!S(e)).reduce((e,t)=>e+(g.test(t)?b:""===t?k:v),r)}function O(e,t,n){void 0===n&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let e=0;e(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=s[n]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[n];return e[r]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:a,pattern:e}}function L(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return c(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function P(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function N(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function C(e,t){let n=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function A(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=h(e):(i=o({},e),l(!i.pathname||!i.pathname.includes("?"),N("?","pathname","search",i)),l(!i.pathname||!i.pathname.includes("#"),N("#","pathname","hash",i)),l(!i.search||!i.search.includes("#"),N("#","search","hash",i)));let a,s=""===e||""===i.pathname,c=s?"/":i.pathname;if(null==c)a=n;else{let e=t.length-1;if(!r&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?h(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:x(r),hash:B(i)}}(i,a),d=c&&"/"!==c&&c.endsWith("/"),p=(s||"."===c)&&n.endsWith("/");return u.pathname.endsWith("/")||!d&&!p||(u.pathname+="/"),u}const I=e=>e.join("/").replace(/\/\/+/g,"/"),D=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),x=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",B=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const U=["post","put","patch","delete"],F=(new Set(U),["get",...U]);function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0}),t.useCallback(function(t,i){void 0===i&&(i={}),r.current&&("number"==typeof t?e.navigate(t):e.navigate(t,j({fromRouteId:n},i)))},[e,n])}():function(){$()||l(!1);let e=t.useContext(W),{basename:n,future:r,navigator:i}=t.useContext(q),{matches:o}=t.useContext(z),{pathname:a}=G(),s=JSON.stringify(C(o,r.v7_relativeSplatPath)),c=t.useRef(!1);return J(()=>{c.current=!0}),t.useCallback(function(t,r){if(void 0===r&&(r={}),!c.current)return;if("number"==typeof t)return void i.go(t);let o=A(t,JSON.parse(s),a,"path"===r.relative);null==e&&"/"!==n&&(o.pathname="/"===o.pathname?n:I([n,o.pathname])),(r.replace?i.replace:i.push)(o,r.state,r)},[n,i,s,a,e])}()}const Y=t.createContext(null);function X(e,n){let{relative:r}=void 0===n?{}:n,{future:i}=t.useContext(q),{matches:o}=t.useContext(z),{pathname:a}=G(),s=JSON.stringify(C(o,i.v7_relativeSplatPath));return t.useMemo(()=>A(e,JSON.parse(s),a,"path"===r),[e,s,a,r])}function Q(e,n,r,i){$()||l(!1);let{navigator:o}=t.useContext(q),{matches:s}=t.useContext(z),c=s[s.length-1],u=c?c.params:{},d=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let p,f=G();if(n){var E;let e="string"==typeof n?h(n):n;"/"===d||(null==(E=e.pathname)?void 0:E.startsWith(d))||l(!1),p=e}else p=f;let y=p.pathname||"/",g=y;if("/"!==d){let e=d.replace(/^\//,"").split("/");g="/"+y.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=m(e,{pathname:g}),_=function(e,n,r,i){var o;if(void 0===n&&(n=[]),void 0===r&&(r=null),void 0===i&&(i=null),null==e){var a;if(!r)return null;if(r.errors)e=r.matches;else{if(!(null!=(a=i)&&a.v7_partialHydration&&0===n.length&&!r.initialized&&r.matches.length>0))return null;e=r.matches}}let s=e,c=null==(o=r)?void 0:o.errors;if(null!=c){let e=s.findIndex(e=>e.route.id&&void 0!==(null==c?void 0:c[e.route.id]));e>=0||l(!1),s=s.slice(0,Math.min(s.length,e+1))}let u=!1,d=-1;if(r&&i&&i.v7_partialHydration)for(let e=0;e=0?s.slice(0,d+1):[s[0]];break}}}return s.reduceRight((e,i,o)=>{let a,l=!1,p=null,h=null;var f;r&&(a=c&&i.route.id?c[i.route.id]:void 0,p=i.route.errorElement||ee,u&&(d<0&&0===o?(ae[f="route-fallback"]||(ae[f]=!0),l=!0,h=null):d===o&&(l=!0,h=i.route.hydrateFallbackElement||null)));let m=n.concat(s.slice(0,o+1)),E=()=>{let n;return n=a?p:l?h:i.route.Component?t.createElement(i.route.Component,null):i.route.element?i.route.element:e,t.createElement(ne,{match:i,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:n})};return r&&(i.route.ErrorBoundary||i.route.errorElement||0===o)?t.createElement(te,{location:r.location,revalidation:r.revalidation,component:p,error:a,children:E(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):E()},null)}(b&&b.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:I([d,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:I([d,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),s,r,i);return n&&_?t.createElement(H.Provider,{value:{location:j({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:a.Pop}},_):_}function Z(){let e=function(){var e;let n=t.useContext(K),r=function(){let e=t.useContext(M);return e||l(!1),e}(ie.UseRouteError),i=oe(ie.UseRouteError);return void 0!==n?n:null==(e=r.errors)?void 0:e[i]}(),n=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),r?t.createElement("pre",{style:i},r):null,null)}const ee=t.createElement(Z,null);class te extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(z.Provider,{value:this.props.routeContext},t.createElement(K.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ne(e){let{routeContext:n,match:r,children:i}=e,o=t.useContext(W);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),t.createElement(z.Provider,{value:n},i)}var re=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(re||{}),ie=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ie||{});function oe(e){let n=function(){let e=t.useContext(z);return e||l(!1),e}(),r=n.matches[n.matches.length-1];return r.route.id||l(!1),r.route.id}const ae={};function se(e){let{to:n,replace:r,state:i,relative:o}=e;$()||l(!1);let{future:a,static:s}=t.useContext(q),{matches:c}=t.useContext(z),{pathname:u}=G(),d=V(),p=A(n,C(c,a.v7_relativeSplatPath),u,"path"===o),h=JSON.stringify(p);return t.useEffect(()=>d(JSON.parse(h),{replace:r,state:i,relative:o}),[d,h,o,r,i]),null}function le(e){return function(e){let n=t.useContext(z).outlet;return n?t.createElement(Y.Provider,{value:e},n):n}(e.context)}function ce(e){l(!1)}function ue(e){let{basename:n="/",children:r=null,location:i,navigationType:o=a.Pop,navigator:s,static:c=!1,future:u}=e;$()&&l(!1);let d=n.replace(/^\/*/,"/"),p=t.useMemo(()=>({basename:d,navigator:s,static:c,future:j({v7_relativeSplatPath:!1},u)}),[d,u,s,c]);"string"==typeof i&&(i=h(i));let{pathname:f="/",search:m="",hash:E="",state:y=null,key:g="default"}=i,b=t.useMemo(()=>{let e=P(f,d);return null==e?null:{location:{pathname:e,search:m,hash:E,state:y,key:g},navigationType:o}},[d,f,m,E,y,g,o]);return null==b?null:t.createElement(q.Provider,{value:p},t.createElement(H.Provider,{children:r,value:b}))}function de(e){let{children:t,location:n}=e;return Q(pe(t),n)}function pe(e,n){void 0===n&&(n=[]);let r=[];return t.Children.forEach(e,(e,i)=>{if(!t.isValidElement(e))return;let o=[...n,i];if(e.type===t.Fragment)return void r.push.apply(r,pe(e.props.children,o));e.type!==ce&&l(!1),e.props.index&&e.props.children&&l(!1);let a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=pe(e.props.children,o)),r.push(a)}),r}function he(){return he=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[n]=e[n]);return i}t.startTransition,new Promise(()=>{}),t.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const me=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ee=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"];try{window.__reactRouterVersion="6"}catch(e){}const ye=t.createContext({isTransitioning:!1});new Map;const ge=t.startTransition;i.flushSync,t.useId;const be="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,_e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ke=t.forwardRef(function(e,n){let r,{onClick:i,relative:o,reloadDocument:a,replace:s,state:c,target:u,to:d,preventScrollReset:h,viewTransition:f}=e,m=fe(e,me),{basename:E}=t.useContext(q),y=!1;if("string"==typeof d&&_e.test(d)&&(r=d,be))try{let e=new URL(window.location.href),t=d.startsWith("//")?new URL(e.protocol+d):new URL(d),n=P(t.pathname,E);t.origin===e.origin&&null!=n?d=n+t.search+t.hash:y=!0}catch(e){}let g=function(e,n){let{relative:r}=void 0===n?{}:n;$()||l(!1);let{basename:i,navigator:o}=t.useContext(q),{hash:a,pathname:s,search:c}=X(e,{relative:r}),u=s;return"/"!==i&&(u="/"===s?i:I([i,s])),o.createHref({pathname:u,search:c,hash:a})}(d,{relative:o}),b=function(e,n){let{target:r,replace:i,state:o,preventScrollReset:a,relative:s,viewTransition:l}=void 0===n?{}:n,c=V(),u=G(),d=X(e,{relative:s});return t.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let n=void 0!==i?i:p(u)===p(d);c(e,{replace:n,state:o,preventScrollReset:a,relative:s,viewTransition:l})}},[u,c,d,i,o,r,e,a,s,l])}(d,{replace:s,state:c,target:u,preventScrollReset:h,relative:o,viewTransition:f});return t.createElement("a",he({},m,{href:r||g,onClick:y||a?i:function(e){i&&i(e),e.defaultPrevented||b(e)},ref:n,target:u}))}),ve=t.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:c,viewTransition:u,children:d}=e,p=fe(e,Ee),h=X(c,{relative:p.relative}),f=G(),m=t.useContext(M),{navigator:E,basename:y}=t.useContext(q),g=null!=m&&function(e,n){void 0===n&&(n={});let r=t.useContext(ye);null==r&&l(!1);let{basename:i}=function(){let e=t.useContext(W);return e||l(!1),e}(we.useViewTransitionState),o=X(e,{relative:n.relative});if(!r.isTransitioning)return!1;let a=P(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=P(r.nextLocation.pathname,i)||r.nextLocation.pathname;return null!=T(o.pathname,s)||null!=T(o.pathname,a)}(h)&&!0===u,b=E.encodeLocation?E.encodeLocation(h).pathname:h.pathname,_=f.pathname,k=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(_=_.toLowerCase(),k=k?k.toLowerCase():null,b=b.toLowerCase()),k&&y&&(k=P(k,y)||k);const v="/"!==b&&b.endsWith("/")?b.length-1:b.length;let w,S=_===b||!a&&_.startsWith(b)&&"/"===_.charAt(v),R=null!=k&&(k===b||!a&&k.startsWith(b)&&"/"===k.charAt(b.length)),O={isActive:S,isPending:R,isTransitioning:g},L=S?r:void 0;w="function"==typeof o?o(O):[o,S?"active":null,R?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let N="function"==typeof s?s(O):s;return t.createElement(ke,he({},p,{"aria-current":L,className:w,ref:n,style:N,to:c,viewTransition:u}),"function"==typeof d?d(O):d)});var we,Se;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(we||(we={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Se||(Se={}));const Re=window.wp.data,Oe=window.wp.apiFetch;var Te=n.n(Oe);function Le(e,t){if(Re.createReduxStore){const n=(0,Re.createReduxStore)(e,t);return(0,Re.register)(n),n}return(0,Re.registerStore)(e,t),e}const Pe="likecoin/site_liker_info",Ne="/likecoin/v1/options/liker-id",Ce={DBUserCanEditOption:!0,DBErrorMessage:"",DBSiteLikerId:"",DBSiteLikerAvatar:"",DBSiteLikerDisplayName:"",DBSiteLikerWallet:"",DBDisplayOptionSelected:"none",DBPerPostOptionEnabled:!1},Ae={getSiteLikerInfo:e=>({type:"GET_SITE_LIKER_INFO",path:e}),setSiteLikerInfo:e=>({type:"SET_SITE_LIKER_INFO",info:e}),setHTTPError(e){const t=e.response.data||e.message;return 403===e.response.status?{type:"SET_FORBIDDEN_ERROR",errorMsg:t}:{type:"SET_ERROR_MESSAGE",errorMsg:t}},*postSiteLikerInfo(e){yield{type:"POST_SITE_LIKER_INFO_TO_DB",data:e},e.siteLikerInfos&&(yield{type:"CHANGE_SITE_LIKER_INFO_GLOBAL_STATE",data:e})}};Le(Pe,{reducer:(e=Ce,t)=>{switch(t.type){case"SET_SITE_LIKER_INFO":return{...e,DBSiteLikerId:t.info.site_likecoin_user.likecoin_id,DBSiteLikerAvatar:t.info.site_likecoin_user.avatar,DBSiteLikerDisplayName:t.info.site_likecoin_user.display_name,DBSiteLikerWallet:t.info.site_likecoin_user.wallet,DBDisplayOptionSelected:t.info.button_display_option,DBPerPostOptionEnabled:t.info.button_display_author_override,DBUserCanEditOption:t.info.user_can_edit};case"CHANGE_SITE_LIKER_INFO_GLOBAL_STATE":return{...e,DBSiteLikerId:t.data.siteLikerInfos.likecoin_id,DBSiteLikerAvatar:t.data.siteLikerInfos.avatar,DBSiteLikerDisplayName:t.data.siteLikerInfos.display_name,DBSiteLikerWallet:t.data.siteLikerInfos.wallet};case"SET_FORBIDDEN_ERROR":return{DBUserCanEditOption:!1,DBErrorMessage:t.errorMsg};case"SET_ERROR_MESSAGE":return{DBErrorMessage:t.errorMsg};default:return e}},controls:{GET_SITE_LIKER_INFO:()=>Te()({path:Ne}),POST_SITE_LIKER_INFO_TO_DB:e=>Te()({method:"POST",path:Ne,data:e.data})},selectors:{selectSiteLikerInfo:e=>e},resolvers:{*selectSiteLikerInfo(){try{const e=(yield Ae.getSiteLikerInfo()).data,t=!("1"!==e.button_display_author_override&&!0!==e.button_display_author_override);return e.button_display_author_override=t,e.button_display_option||(e.button_display_option=Ce.DBDisplayOptionSelected),e.site_likecoin_user||(e.site_likecoin_user={}),Ae.setSiteLikerInfo(e)}catch(e){return Ae.setHTTPError(e)}}},actions:Ae});const Ie=window.wp.i18n,De=n.p+"images/w3p_logo.443a5708.png",xe=function(){return(0,t.createElement)("header",{className:"lcp-admin-header"},(0,t.createElement)("img",{src:De,alt:(0,Ie.__)("Web3Press logo","likecoin")}),(0,t.createElement)("a",{className:"lcp-admin-header__portfolio-button",href:"https://liker.land/dashboard",rel:"noopener noreferrer",target:"_blank"},(0,Ie.__)("Your Portfolio","likecoin")," ",(0,t.createElement)("span",{className:"dashicons dashicons-external"})))};var Be=n(556),Ue=n.n(Be);const Fe=({isActive:e})=>"nav-tab"+(e?" nav-tab-active":"");function je({children:e}){return(0,t.createElement)("nav",{className:"lcp-nav-tab-wrapper nav-tab-wrapper wp-clearfix"},e)}je.propTypes={children:Ue().node.isRequired};const We=je,Me=function(){const{DBUserCanEditOption:e}=(0,Re.useSelect)(e=>e(Pe).selectSiteLikerInfo());return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(We,null,e&&(0,t.createElement)(ve,{className:Fe,to:"",end:!0},(0,Ie.__)("General","likecoin")),e&&(0,t.createElement)(ve,{className:Fe,to:"advanced"},(0,Ie.__)("Advanced","likecoin")),(0,t.createElement)(ve,{className:Fe,to:"about"},(0,Ie.__)("About","likecoin"))),(0,t.createElement)("div",{className:"lcp-nav-tab-panel"},(0,t.createElement)(le,null)))};function qe({handleSelect:e,title:n,selectRef:r,selected:i,options:o}){return(0,t.createElement)("tr",null,(0,t.createElement)("th",{className:"optionTitle",scope:"row"},(0,t.createElement)("label",{htmlFor:`dropdown-${n.replace(/\s+/g,"-").toLowerCase()}`},n)),(0,t.createElement)("td",null,(0,t.createElement)("select",{id:`dropdown-${n.replace(/\s+/g,"-").toLowerCase()}`,ref:r,onChange:t=>{e(t.target.value)},value:i},o.map(e=>(0,t.createElement)("option",{value:e.value,key:e.label},e.label)))))}qe.propTypes={handleSelect:Ue().func.isRequired,title:Ue().string.isRequired,selectRef:Ue().oneOfType([Ue().func,Ue().shape({current:Ue().instanceOf(Element)})]),selected:Ue().string.isRequired,options:Ue().arrayOf(Ue().shape({value:Ue().string.isRequired,label:Ue().string.isRequired})).isRequired},qe.defaultProps={selectRef:null};const He=qe;function ze({title:e}){return(0,t.createElement)("h2",{className:"title"},e)}ze.propTypes={title:Ue().string.isRequired};const Ke=ze;function $e({className:e,text:n,handleNoticeDismiss:r}){return(0,t.createElement)("div",{className:`notice ${e} is-dismissable`},(0,t.createElement)("p",null,(0,t.createElement)("strong",null,n)),(0,t.createElement)("button",{type:"button",className:"notice-dismiss",id:"notice-dismiss","aria-label":"Dismiss notice",onClick:r},(0,t.createElement)("span",{className:"screen-reader-text"},"Dismiss notice")))}$e.propTypes={className:Ue().string,text:Ue().string.isRequired,handleNoticeDismiss:Ue().func.isRequired},$e.defaultProps={className:""};const Ge=$e,Je="GET_SITE_PUBLISH_OPTIONS",Ve="SET_SITE_PUBLISH_OPTIONS",Ye="POST_SITE_PUBLISH_OPTIONS_TO_DB",Xe="CHANGE_SITE_PUBLISH_OPTIONS_GLOBAL_STATE",Qe="SET_PAYMENT_POINTER",Ze="GET_PAYMENT_POINTER",et="POST_PAYMENT_POINTER",tt="CHANGE_PAYMENT_POINTER_GLOBAL_STATE",nt="SET_ERROR_MESSAGE",rt="/likecoin/v1/option/publish",it=(e,t)=>(n=t||{},r)=>{const i=e[r.type];return i?i(n,r):n},ot="likecoin/site_publish",at=rt,st=rt,lt={DBSiteInternetArchiveEnabled:!1,DBSiteInternetArchiveAccessKey:"",DBISCNBadgeStyleOption:"none"},ct={getSitePublishOptions:e=>({type:Je,path:e}),setSitePublishOptions:e=>({type:Ve,options:e}),setHTTPErrors:e=>({type:nt,errorMsg:e}),*postSitePublishOptions(e){yield{type:Ye,data:e},yield{type:Xe,data:e}}},ut={[Je]:e=>Te()({path:e.path}),[Ye]:e=>Te()({method:"POST",path:st,data:e.data})},dt={*selectSitePublishOptions(){try{const e=(yield ct.getSitePublishOptions(at)).data;return e.iscn_badge_style_option||(e.iscn_badge_style_option=lt.DBISCNBadgeStyleOption),ct.setSitePublishOptions(e)}catch(e){return ct.setHTTPErrors(e.message)}}},pt=it({[Ve]:(e,t)=>({DBSiteInternetArchiveEnabled:t.options.lc_internet_archive_enabled,DBSiteInternetArchiveAccessKey:t.options.lc_internet_archive_access_key,DBISCNBadgeStyleOption:t.options.iscn_badge_style_option}),[Xe]:(e,t)=>({...e,...JSON.parse(JSON.stringify({DBSiteInternetArchiveEnabled:t.data.siteInternetArchiveEnabled,DBSiteInternetArchiveAccessKey:t.data.siteInternetArchiveAccessKey,DBISCNBadgeStyleOption:t.data.ISCNBadgeStyleOption}))})},lt);function ht({title:e,children:n,details:r,append:i}){return(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"row",className:"optionTitle"},e),(0,t.createElement)("td",null,n,!!r&&(0,t.createElement)("span",{className:"description"},r),i))}Le(ot,{reducer:pt,controls:ut,selectors:{selectSitePublishOptions:e=>e},resolvers:dt,actions:ct}),ht.propTypes={title:Ue().string.isRequired,children:Ue().node,details:Ue().string,append:Ue().node},ht.defaultProps={children:null,details:"",append:null};const ft=ht;function mt({handleCheck:e,checked:n,title:r,details:i,append:o,disabled:a,checkRef:s}){return(0,t.createElement)(ft,{title:r,details:i,append:o},(0,t.createElement)("input",{type:"checkbox",checked:n,disabled:a,onChange:()=>{e(!n)},ref:s}))}mt.propTypes={handleCheck:Ue().func.isRequired,checked:Ue().bool.isRequired,title:Ue().string.isRequired,details:Ue().string,append:Ue().node,disabled:Ue().bool,checkRef:Ue().oneOfType([Ue().func,Ue().shape({current:Ue().instanceOf(Element)})])},mt.defaultProps={details:"",append:null,disabled:!1,checkRef:null};const Et=mt;function yt({children:e}){return(0,t.createElement)("table",{className:"form-table",role:"presentation"},(0,t.createElement)("tbody",null,e))}yt.propTypes={children:Ue().node},yt.defaultProps={children:null};const gt=yt;function bt({children:e}){return(0,t.createElement)("div",{className:"submit"},(0,t.createElement)("button",{type:"submit",className:"button button-primary"},(0,Ie.__)("Confirm","likecoin")),e)}bt.propTypes={children:Ue().node},bt.defaultProps={children:null};const _t=bt,kt=function(){const{postSiteLikerInfo:e}=(0,Re.useDispatch)(Pe),{postSitePublishOptions:n}=(0,Re.useDispatch)(ot),{DBUserCanEditOption:r,DBDisplayOptionSelected:i}=(0,Re.useSelect)(e=>e(Pe).selectSiteLikerInfo()),{DBISCNBadgeStyleOption:o}=(0,Re.useSelect)(e=>e(ot).selectSitePublishOptions()),[a,s]=(0,t.useState)(!1),[l,c]=(0,t.useState)("post"===i||"always"===i),[u,d]=(0,t.useState)("page"===i||"always"===i),p=(0,t.useRef)(),h=[{value:"light",label:(0,Ie.__)("Light Mode","likecoin")},{value:"dark",label:(0,Ie.__)("Dark Mode","likecoin")},{value:"none",label:(0,Ie.__)("Not shown","likecoin")}],[f,m]=(0,t.useState)(o);(0,t.useEffect)(()=>{m(o)},[o]),(0,t.useEffect)(()=>{c("post"===i||"always"===i),d("page"===i||"always"===i)},[i]);const E=(0,t.useCallback)(e=>{e.preventDefault(),c(!0),d(!1),m("none")},[]),y=(0,t.useCallback)(async t=>{s(!1),t.preventDefault();const r=p.current.value;let i="none";l&&u?i="always":l?i="post":u&&(i="page");const o={displayOption:i},a={ISCNBadgeStyleOption:r};try{await Promise.all([e(o),n(a)]),s(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(e){console.error(e)}},[l,u,e,n]),g=(0,t.useCallback)(e=>{e.preventDefault(),s(!1)},[]),b=(0,Ie.__)("Sorry, you are not allowed to access this page.","likecoin");return r?(0,t.createElement)("div",{className:"likecoin"},a&&(0,t.createElement)(Ge,{text:(0,Ie.__)("Settings Saved","likecoin"),className:"notice-success",handleNoticeDismiss:g}),(0,t.createElement)("form",{onSubmit:y},(0,t.createElement)(Ke,{title:(0,Ie.__)("LikeCoin widget","likecoin")}),(0,t.createElement)("p",null,(0,Ie.__)("Display LikeCoin Button/Widget when author has a Liker ID, or if post is registered on ISCN","likecoin")),(0,t.createElement)(gt,null,(0,t.createElement)(Et,{checked:l,handleCheck:c,title:(0,Ie.__)("Show in Posts","likecoin"),append:(0,Ie.__)(" *Recommended","likecoin")}),(0,t.createElement)(Et,{checked:u,handleCheck:d,title:(0,Ie.__)("Show in Pages","likecoin")})),(0,t.createElement)("hr",null),(0,t.createElement)(Ke,{title:(0,Ie.__)("ISCN Badge","likecoin")}),(0,t.createElement)("p",null,(0,Ie.__)("Display a badge for ISCN registered post","likecoin")),(0,t.createElement)(gt,null,(0,t.createElement)(He,{selected:f,handleSelect:m,title:(0,Ie.__)("Display style","likecoin"),selectRef:p,options:h})),(0,t.createElement)(_t,null," ",(0,t.createElement)("button",{type:"button",className:"button",onClick:E},(0,Ie.__)("Reset to default","likecoin"))))):(0,t.createElement)("p",null,b)},vt=function(){const{DBUserCanEditOption:e}=(0,Re.useSelect)(e=>e(Pe).selectSiteLikerInfo());return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(We,null,e&&(0,t.createElement)(ve,{className:Fe,to:"",end:!0},(0,Ie.__)("Website Liker ID","likecoin")),(0,t.createElement)(ve,{className:Fe,to:"user"},(0,Ie.__)("Your Liker ID","likecoin"))),(0,t.createElement)("div",{className:"lcp-nav-tab-panel"},(0,t.createElement)(le,null)))};function wt(e,n){const{postSiteLikerInfo:r}=(0,Re.useDispatch)(Pe),{DBPerPostOptionEnabled:i}=(0,Re.useSelect)(e=>e(Pe).selectSiteLikerInfo()),o=(0,t.useRef)(),[a,s]=(0,t.useState)(i);async function l(){const e={perPostOptionEnabled:o.current.checked};await r(e)}return(0,t.useEffect)(()=>{s(i)},[i]),(0,t.useImperativeHandle)(n,()=>({submit:l})),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Ke,{title:(0,Ie.__)("LikeCoin widget advanced settings","likecoin")}),(0,t.createElement)(gt,null,(0,t.createElement)(Et,{checked:a,handleCheck:s,title:(0,Ie.__)("Post option","likecoin"),details:(0,Ie.__)("Allow editors to customize display setting per post","likecoin"),append:(0,t.createElement)("p",null,(0,t.createElement)("button",{type:"button",onClick:function(e){e.preventDefault(),s(!1)},style:{background:"none",border:"none",color:"#0073aa",textDecoration:"underline",cursor:"pointer"}},(0,Ie.__)("Reset to default","likecoin"))),checkRef:o})))}wt.propTypes={};const St=(0,t.forwardRef)(wt);function Rt({linkAddress:e,text:n}){return(0,t.createElement)("a",{rel:"noopener noreferrer",target:"_blank",href:e},n)}Rt.propTypes={linkAddress:Ue().string.isRequired,text:Ue().string.isRequired};const Ot=Rt,Tt=function(){const e=(0,r.createInterpolateElement)((0,Ie.__)(" is a non-profit digital library offering free universal access to books, movies & music, as well as 624 billion archived web pages.","likecoin"),{InternetArchive:(0,r.createElement)(Ot,{text:(0,Ie.__)("Internet Archive (archive.org)","likecoin"),linkAddress:"https://archive.org/"})});return(0,r.createElement)("p",null,e)},Lt=(0,t.forwardRef)(function(e,n){const{DBSiteInternetArchiveEnabled:i,DBSiteInternetArchiveAccessKey:o}=(0,Re.useSelect)(e=>e(ot).selectSitePublishOptions()),[a,s]=(0,t.useState)(i),[l,c]=(0,t.useState)(o),[u,d]=(0,t.useState)(""),[p,h]=(0,t.useState)(!o);(0,t.useEffect)(()=>{s(i),c(o),h(!o)},[o,i]);const{postSitePublishOptions:f}=(0,Re.useDispatch)(ot),m=(0,t.useCallback)(()=>{let e={siteInternetArchiveEnabled:a};p&&(e={...e,siteInternetArchiveAccessKey:l,siteInternetArchiveSecret:u}),f(e)},[p,a,l,u,f]);(0,t.useImperativeHandle)(n,()=>({submit:m}));const E=(0,r.createInterpolateElement)((0,Ie.__)("An is needed for auto publishing your post to Internet Archive.","likecoin"),{Register:(0,r.createElement)(Ot,{text:(0,Ie.__)("Internet Archive S3 API Key","likecoin"),linkAddress:"https://archive.org/account/s3.php"})});return(0,r.createElement)(gt,null,(0,r.createElement)(Et,{checked:a,handleCheck:s,title:(0,Ie.__)("Auto archive","likecoin"),details:(0,Ie.__)("Auto publish post to Internet Archive","likecoin"),disabled:p&&!(l&&u)}),(0,r.createElement)(ft,{title:(0,Ie.__)("Internet Archive S3 Config","likecoin")},(0,r.createElement)("p",null,E),(0,r.createElement)(gt,null,(0,r.createElement)(ft,{title:(0,Ie.__)("S3 Access Key","likecoin")},(0,r.createElement)("input",{id:"internet_archive_access_key",type:"text",value:l,disabled:!p,onChange:e=>c(e.target.value)})),(0,r.createElement)(ft,{title:(0,Ie.__)("S3 Secret","likecoin")},p?(0,r.createElement)("input",{id:"internet_archive_secret",type:"password",value:u,onChange:e=>d(e.target.value)}):(0,r.createElement)("button",{type:"button",className:"button",onClick:h},(0,Ie.__)("Edit","likecoin"))))))}),Pt=(0,t.forwardRef)(function(e,n){const{DBSiteInternetArchiveEnabled:r}=(0,Re.useSelect)(e=>e(ot).selectSitePublishOptions()),i=(0,t.useRef)(),[o,a]=(0,t.useState)(!!r);async function s(){const e=[];o&&e.push(i.current.submit()),await Promise.all(e)}return(0,t.useEffect)(()=>{a(!!r)},[r]),(0,t.useImperativeHandle)(n,()=>({submit:s})),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("h2",null,(0,Ie.__)("Publish to Internet Archive","likecoin")),(0,t.createElement)(Tt,null),!o&&(0,t.createElement)(gt,null,(0,t.createElement)(Et,{checked:o,handleCheck:a,title:(0,Ie.__)("Show settings","likecoin")})),o&&(0,t.createElement)(Lt,{ref:i}))}),Nt="likecoin/other_settings",Ct="/likecoin/v1/option/web-monetization",At={setPaymentPointer:e=>({type:Qe,paymentPointer:e}),getPaymentPointer:()=>({type:Ze}),setHTTPErrors:e=>({type:nt,errorMsg:e}),*postPaymentPointer(e){yield{type:et,paymentPointer:e},yield{type:tt,paymentPointer:e}}},It={[Ze]:()=>Te()({path:Ct}),[et]:e=>Te()({method:"POST",path:Ct,data:{paymentPointer:e.paymentPointer}})},Dt={*selectPaymentPointer(){try{const e=(yield At.getPaymentPointer()).data.site_payment_pointer;return At.setPaymentPointer(e)}catch(e){return At.setHTTPErrors(e.message)}}},xt=it({[Qe]:(e,t)=>({DBPaymentPointer:t.paymentPointer}),[tt]:(e,t)=>({DBPaymentPointer:t.paymentPointer})},{DBPaymentPointer:""});Le(Nt,{reducer:xt,controls:It,selectors:{selectPaymentPointer:e=>e.DBPaymentPointer},resolvers:Dt,actions:At});const Bt=(0,r.createInterpolateElement)((0,Ie.__)(" is an API that allows websites to request small payments from users facilitated by the browser and the user's Web Monetization provider.","likecoin"),{WebMonetization:(0,r.createElement)(Ot,{text:(0,Ie.__)("Web Monetization","likecoin"),linkAddress:"https://webmonetization.org/"})}),Ut=(0,r.createInterpolateElement)((0,Ie.__)("You would need to register a to enable web monetization. However LikeCoin is working hard to integrate web monetization natively into our ecosystem. Follow our latest progress !","likecoin"),{PaymentPointer:(0,r.createElement)(Ot,{text:(0,Ie.__)("payment pointer","likecoin"),linkAddress:"https://webmonetization.org/docs/ilp-wallets"}),Here:(0,r.createElement)(Ot,{text:(0,Ie.__)("here","likecoin"),linkAddress:"https://community.webmonetization.org/likecoinprotocol"})}),Ft=function(){return(0,r.createElement)("div",null,(0,r.createElement)("p",null,Bt),(0,r.createElement)("p",null,Ut))},jt=(0,t.forwardRef)(function(e,n){const r=(0,Re.useSelect)(e=>e(Nt).selectPaymentPointer()),{postPaymentPointer:i}=(0,Re.useDispatch)(Nt),[o,a]=(0,t.useState)(!!r);(0,t.useEffect)(()=>{a(!!r)},[r]);const s=(0,t.useRef)();async function l(){if(o)try{i(s.current.value)}catch(e){console.error(e)}}return(0,t.useImperativeHandle)(n,()=>({submit:l})),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Ke,{title:(0,Ie.__)("Web Monetization","likecoin")}),(0,t.createElement)(Ft,null),(0,t.createElement)(gt,null,(0,t.createElement)(Et,{checked:o,handleCheck:a,title:(0,Ie.__)("Web Monetization","likecoin"),details:(0,Ie.__)("Enable","likecoin")})),o&&(0,t.createElement)(gt,null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"row"},(0,t.createElement)("label",{htmlFor:"site_payment_pointer"},(0,Ie.__)("Payment pointer","likecoin"))),(0,t.createElement)("td",null,(0,t.createElement)("input",{type:"text",placeholder:"$wallet.example.com/alice",defaultValue:r,ref:s})," ",(0,t.createElement)("a",{rel:"noopener noreferrer",target:"_blank",href:"https://webmonetization.org/docs/ilp-wallets/"},(0,Ie.__)("What is payment pointer?","likecoin"))))))}),Wt=function(){const[e,n]=(0,t.useState)(!1),r=(0,t.useRef)(),i=(0,t.useRef)(),o=(0,t.useRef)(),a=(0,t.useCallback)(async e=>{n(!1),e.preventDefault();try{await Promise.all([r.current.submit(),i.current.submit(),o.current.submit()]),n(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(e){console.error(e)}},[]),s=(0,t.useCallback)(e=>{e.preventDefault(),n(!1)},[]);return(0,t.createElement)("form",{className:"likecoin",onSubmit:a},e&&(0,t.createElement)(Ge,{text:(0,Ie.__)("Settings Saved","likecoin"),className:"notice-success",handleNoticeDismiss:s}),(0,t.createElement)(St,{ref:r}),(0,t.createElement)("hr",null),(0,t.createElement)(Pt,{ref:i}),(0,t.createElement)("hr",null),(0,t.createElement)(jt,{ref:o}),(0,t.createElement)(_t,null))};function Mt(e,t){return function(){return e.apply(t,arguments)}}const{toString:qt}=Object.prototype,{getPrototypeOf:Ht}=Object,{iterator:zt,toStringTag:Kt}=Symbol,$t=(Gt=Object.create(null),e=>{const t=qt.call(e);return Gt[t]||(Gt[t]=t.slice(8,-1).toLowerCase())});var Gt;const Jt=e=>(e=e.toLowerCase(),t=>$t(t)===e),Vt=e=>t=>typeof t===e,{isArray:Yt}=Array,Xt=Vt("undefined");function Qt(e){return null!==e&&!Xt(e)&&null!==e.constructor&&!Xt(e.constructor)&&tn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Zt=Jt("ArrayBuffer"),en=Vt("string"),tn=Vt("function"),nn=Vt("number"),rn=e=>null!==e&&"object"==typeof e,on=e=>{if("object"!==$t(e))return!1;const t=Ht(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Kt in e||zt in e)},an=Jt("Date"),sn=Jt("File"),ln=Jt("Blob"),cn=Jt("FileList"),un=Jt("URLSearchParams"),[dn,pn,hn,fn]=["ReadableStream","Request","Response","Headers"].map(Jt);function mn(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),Yt(e))for(r=0,i=e.length;r0;)if(r=n[i],t===r.toLowerCase())return r;return null}const yn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,gn=e=>!Xt(e)&&e!==yn,bn=(kn="undefined"!=typeof Uint8Array&&Ht(Uint8Array),e=>kn&&e instanceof kn);var kn;const vn=Jt("HTMLFormElement"),wn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Sn=Jt("RegExp"),Rn=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};mn(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)},On=Jt("AsyncFunction"),Tn=(Ln="function"==typeof setImmediate,Pn=tn(yn.postMessage),Ln?setImmediate:Pn?(Nn=`axios@${Math.random()}`,Cn=[],yn.addEventListener("message",({source:e,data:t})=>{e===yn&&t===Nn&&Cn.length&&Cn.shift()()},!1),e=>{Cn.push(e),yn.postMessage(Nn,"*")}):e=>setTimeout(e));var Ln,Pn,Nn,Cn;const An="undefined"!=typeof queueMicrotask?queueMicrotask.bind(yn):"undefined"!=typeof process&&process.nextTick||Tn,In={isArray:Yt,isArrayBuffer:Zt,isBuffer:Qt,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||tn(e.append)&&("formdata"===(t=$t(e))||"object"===t&&tn(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Zt(e.buffer),t},isString:en,isNumber:nn,isBoolean:e=>!0===e||!1===e,isObject:rn,isPlainObject:on,isEmptyObject:e=>{if(!rn(e)||Qt(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:dn,isRequest:pn,isResponse:hn,isHeaders:fn,isUndefined:Xt,isDate:an,isFile:sn,isBlob:ln,isRegExp:Sn,isFunction:tn,isStream:e=>rn(e)&&tn(e.pipe),isURLSearchParams:un,isTypedArray:bn,isFileList:cn,forEach:mn,merge:function e(){const{caseless:t}=gn(this)&&this||{},n={},r=(r,i)=>{const o=t&&En(n,i)||i;on(n[o])&&on(r)?n[o]=e(n[o],r):on(r)?n[o]=e({},r):Yt(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e(mn(t,(t,r)=>{n&&tn(t)?e[r]=Mt(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Ht(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:$t,kindOfTest:Jt,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Yt(e))return e;let t=e.length;if(!nn(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[zt]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:vn,hasOwnProperty:wn,hasOwnProp:wn,reduceDescriptors:Rn,freezeMethods:e=>{Rn(e,(t,n)=>{if(tn(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];tn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Yt(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:En,global:yn,isContextDefined:gn,isSpecCompliantForm:function(e){return!!(e&&tn(e.append)&&"FormData"===e[Kt]&&e[zt])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(rn(e)){if(t.indexOf(e)>=0)return;if(Qt(e))return e;if(!("toJSON"in e)){t[r]=e;const i=Yt(e)?[]:{};return mn(e,(e,t)=>{const o=n(e,r+1);!Xt(o)&&(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:On,isThenable:e=>e&&(rn(e)||tn(e))&&tn(e.then)&&tn(e.catch),setImmediate:Tn,asap:An,isIterable:e=>null!=e&&tn(e[zt])};function Dn(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}In.inherits(Dn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:In.toJSONObject(this.config),code:this.code,status:this.status}}});const xn=Dn.prototype,Bn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Bn[e]={value:e}}),Object.defineProperties(Dn,Bn),Object.defineProperty(xn,"isAxiosError",{value:!0}),Dn.from=(e,t,n,r,i,o)=>{const a=Object.create(xn);return In.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),Dn.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const Un=Dn;function Fn(e){return In.isPlainObject(e)||In.isArray(e)}function jn(e){return In.endsWith(e,"[]")?e.slice(0,-2):e}function Wn(e,t,n){return e?e.concat(t).map(function(e,t){return e=jn(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Mn=In.toFlatObject(In,{},null,function(e){return/^is[A-Z]/.test(e)}),qn=function(e,t,n){if(!In.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=In.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!In.isUndefined(t[e])})).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&In.isSpecCompliantForm(t);if(!In.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(In.isDate(e))return e.toISOString();if(In.isBoolean(e))return e.toString();if(!s&&In.isBlob(e))throw new Un("Blob is not supported. Use a Buffer instead.");return In.isArrayBuffer(e)||In.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(In.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(In.isArray(e)&&function(e){return In.isArray(e)&&!e.some(Fn)}(e)||(In.isFileList(e)||In.endsWith(n,"[]"))&&(s=In.toArray(e)))return n=jn(n),s.forEach(function(e,r){!In.isUndefined(e)&&null!==e&&t.append(!0===a?Wn([n],r,o):null===a?n:n+"[]",l(e))}),!1;return!!Fn(e)||(t.append(Wn(i,n,o),l(e)),!1)}const u=[],d=Object.assign(Mn,{defaultVisitor:c,convertValue:l,isVisitable:Fn});if(!In.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!In.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),In.forEach(n,function(n,o){!0===(!(In.isUndefined(n)||null===n)&&i.call(t,n,In.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o])}),u.pop()}}(e),t};function Hn(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function zn(e,t){this._pairs=[],e&&qn(e,this,t)}const Kn=zn.prototype;Kn.append=function(e,t){this._pairs.push([e,t])},Kn.toString=function(e){const t=e?function(t){return e.call(this,t,Hn)}:Hn;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const $n=zn;function Gn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Jn(e,t,n){if(!t)return e;const r=n&&n.encode||Gn;In.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(o=i?i(t,n):In.isURLSearchParams(t)?t.toString():new $n(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const Vn=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){In.forEach(this.handlers,function(t){null!==t&&e(t)})}},Yn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xn={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:$n,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Qn="undefined"!=typeof window&&"undefined"!=typeof document,Zn="object"==typeof navigator&&navigator||void 0,er=Qn&&(!Zn||["ReactNative","NativeScript","NS"].indexOf(Zn.product)<0),tr="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,nr=Qn&&window.location.href||"http://localhost",rr={...e,...Xn},ir=function(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&In.isArray(r)?r.length:o,s?(In.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&In.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&In.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r{t(function(e){return In.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null},or={transitional:Yn,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=In.isObject(e);if(i&&In.isHTMLForm(e)&&(e=new FormData(e)),In.isFormData(e))return r?JSON.stringify(ir(e)):e;if(In.isArrayBuffer(e)||In.isBuffer(e)||In.isStream(e)||In.isFile(e)||In.isBlob(e)||In.isReadableStream(e))return e;if(In.isArrayBufferView(e))return e.buffer;if(In.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return qn(e,new rr.classes.URLSearchParams,{visitor:function(e,t,n,r){return rr.isNode&&In.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=In.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return qn(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e){if(In.isString(e))try{return(0,JSON.parse)(e),In.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||or.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(In.isResponse(e)||In.isReadableStream(e))return e;if(e&&In.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Un.from(e,Un.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rr.classes.FormData,Blob:rr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};In.forEach(["delete","get","head","post","put","patch"],e=>{or.headers[e]={}});const ar=or,sr=In.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),lr=Symbol("internals");function cr(e){return e&&String(e).trim().toLowerCase()}function ur(e){return!1===e||null==e?e:In.isArray(e)?e.map(ur):String(e)}function dr(e,t,n,r,i){return In.isFunction(r)?r.call(this,t,n):(i&&(t=n),In.isString(t)?In.isString(r)?-1!==t.indexOf(r):In.isRegExp(r)?r.test(t):void 0:void 0)}class pr{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=cr(t);if(!i)throw new Error("header name must be a non-empty string");const o=In.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=ur(e))}const o=(e,t)=>In.forEach(e,(e,n)=>i(e,n,t));if(In.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(In.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&sr[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(In.isObject(e)&&In.isIterable(e)){let n,r,i={};for(const t of e){if(!In.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?In.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=cr(e)){const n=In.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(In.isFunction(t))return t.call(this,e,n);if(In.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=cr(e)){const n=In.findKey(this,e);return!(!n||void 0===this[n]||t&&!dr(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=cr(e)){const i=In.findKey(n,e);!i||t&&!dr(0,n[i],i,t)||(delete n[i],r=!0)}}return In.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!dr(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return In.forEach(this,(r,i)=>{const o=In.findKey(n,i);if(o)return t[o]=ur(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();a!==i&&delete t[i],t[a]=ur(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return In.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&In.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[lr]=this[lr]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=cr(e);t[r]||(function(e,t){const n=In.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return In.isArray(e)?e.forEach(r):r(e),this}}pr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),In.reduceDescriptors(pr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),In.freezeMethods(pr);const hr=pr;function fr(e,t){const n=this||ar,r=t||n,i=hr.from(r.headers);let o=r.data;return In.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function mr(e){return!(!e||!e.__CANCEL__)}function Er(e,t,n){Un.call(this,null==e?"canceled":e,Un.ERR_CANCELED,t,n),this.name="CanceledError"}In.inherits(Er,Un,{__CANCEL__:!0});const yr=Er;function gr(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Un("Request failed with status code "+n.status,[Un.ERR_BAD_REQUEST,Un.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const br=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];i||(i=l),n[o]=s,r[o]=l;let u=a,d=0;for(;u!==o;)d+=n[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),l-i{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-i;s>=o?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},o-s)))},()=>n&&a(n)]}(n=>{const o=n.loaded,a=n.lengthComputable?n.total:void 0,s=o-r,l=i(s);r=o,e({loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},_r=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},kr=e=>(...t)=>In.asap(()=>e(...t)),vr=rr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,rr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(rr.origin),rr.navigator&&/(msie|trident)/i.test(rr.navigator.userAgent)):()=>!0,wr=rr.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const a=[e+"="+encodeURIComponent(t)];In.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),In.isString(r)&&a.push("path="+r),In.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Sr(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Rr=e=>e instanceof hr?{...e}:e;function Or(e,t){t=t||{};const n={};function r(e,t,n,r){return In.isPlainObject(e)&&In.isPlainObject(t)?In.merge.call({caseless:r},e,t):In.isPlainObject(t)?In.merge({},t):In.isArray(t)?t.slice():t}function i(e,t,n,i){return In.isUndefined(t)?In.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!In.isUndefined(t))return r(void 0,t)}function a(e,t){return In.isUndefined(t)?In.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>i(Rr(e),Rr(t),0,!0)};return In.forEach(Object.keys({...e,...t}),function(r){const o=l[r]||i,a=o(e[r],t[r],r);In.isUndefined(a)&&o!==s||(n[r]=a)}),n}const Tr=e=>{const t=Or({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:l}=t;if(t.headers=s=hr.from(s),t.url=Jn(Sr(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),In.isFormData(r))if(rr.hasStandardBrowserEnv||rr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(rr.hasStandardBrowserEnv&&(i&&In.isFunction(i)&&(i=i(t)),i||!1!==i&&vr(t.url))){const e=o&&a&&wr.read(a);e&&s.set(o,e)}return t},Lr="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Tr(e);let i=r.data;const o=hr.from(r.headers).normalize();let a,s,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function E(){if(!m)return;const r=hr.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());gr(function(e){t(e),f()},function(e){n(e),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=E:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(E)},m.onabort=function(){m&&(n(new Un("Request aborted",Un.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Un("Network Error",Un.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Yn;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Un(t,i.clarifyTimeoutError?Un.ETIMEDOUT:Un.ECONNABORTED,e,m)),m=null},void 0===i&&o.setContentType(null),"setRequestHeader"in m&&In.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),In.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([l,u]=br(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([s,c]=br(p),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new yr(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===rr.protocols.indexOf(y)?n(new Un("Unsupported protocol "+y+":",Un.ERR_BAD_REQUEST,e)):m.send(i||null)})},Pr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Un?t:new yr(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,i(new Un(`timeout ${t} of ms exceeded`,Un.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:s}=r;return s.unsubscribe=()=>In.asap(a),s}},Nr=function*(e,t){let n=e.byteLength;if(!t||n{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*Nr(n,t)}(e,t);let o,a=0,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return s(),void e.close();let o=r.byteLength;if(n){let e=a+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},Ar="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Ir=Ar&&"function"==typeof ReadableStream,Dr=Ar&&("function"==typeof TextEncoder?(xr=new TextEncoder,e=>xr.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var xr;const Br=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ur=Ir&&Br(()=>{let e=!1;const t=new Request(rr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Fr=Ir&&Br(()=>In.isReadableStream(new Response("").body)),jr={stream:Fr&&(e=>e.body)};var Wr;Ar&&(Wr=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!jr[e]&&(jr[e]=In.isFunction(Wr[e])?t=>t[e]():(t,n)=>{throw new Un(`Response type '${e}' is not supported`,Un.ERR_NOT_SUPPORT,n)})}));const Mr={http:null,xhr:Lr,fetch:Ar&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:a,onDownloadProgress:s,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=Tr(e);c=c?(c+"").toLowerCase():"text";let h,f=Pr([i,o&&o.toAbortSignal()],a);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let E;try{if(l&&Ur&&"get"!==n&&"head"!==n&&0!==(E=await(async(e,t)=>{const n=In.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(In.isBlob(e))return e.size;if(In.isSpecCompliantForm(e)){const t=new Request(rr.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return In.isArrayBufferView(e)||In.isArrayBuffer(e)?e.byteLength:(In.isURLSearchParams(e)&&(e+=""),In.isString(e)?(await Dr(e)).byteLength:void 0)})(t):n})(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(In.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=_r(E,br(kr(l)));r=Cr(n.body,65536,e,t)}}In.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;h=new Request(t,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:i?d:void 0});let o=await fetch(h,p);const a=Fr&&("stream"===c||"response"===c);if(Fr&&(s||a&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=o[t]});const t=In.toFiniteNumber(o.headers.get("content-length")),[n,r]=s&&_r(t,br(kr(s),!0))||[];o=new Response(Cr(o.body,65536,n,()=>{r&&r(),m&&m()}),e)}c=c||"text";let y=await jr[In.findKey(jr,c)||"text"](o,e);return!a&&m&&m(),await new Promise((t,n)=>{gr(t,n,{data:y,headers:hr.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:h})})}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Un("Network Error",Un.ERR_NETWORK,e,h),{cause:t.cause||t});throw Un.from(t,t&&t.code,e,h)}})};In.forEach(Mr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const qr=e=>`- ${e}`,Hr=e=>In.isFunction(e)||null===e||!1===e,zr=e=>{e=In.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let n=t?e.length>1?"since :\n"+e.map(qr).join("\n"):" "+qr(e[0]):"as no adapter specified";throw new Un("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Kr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yr(null,e)}function $r(e){return Kr(e),e.headers=hr.from(e.headers),e.data=fr.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),zr(e.adapter||ar.adapter)(e).then(function(t){return Kr(e),t.data=fr.call(e,e.transformResponse,t),t.headers=hr.from(t.headers),t},function(t){return mr(t)||(Kr(e),t&&t.response&&(t.response.data=fr.call(e,e.transformResponse,t.response),t.response.headers=hr.from(t.response.headers))),Promise.reject(t)})}const Gr="1.11.0",Jr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Jr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Vr={};Jr.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Gr+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new Un(r(i," has been removed"+(t?" in "+t:"")),Un.ERR_DEPRECATED);return t&&!Vr[i]&&(Vr[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},Jr.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Yr={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Un("options must be an object",Un.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new Un("option "+o+" must be "+n,Un.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Un("Unknown option "+o,Un.ERR_BAD_OPTION)}},validators:Jr},Xr=Yr.validators;class Qr{constructor(e){this.defaults=e||{},this.interceptors={request:new Vn,response:new Vn}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Or(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Yr.assertOptions(n,{silentJSONParsing:Xr.transitional(Xr.boolean),forcedJSONParsing:Xr.transitional(Xr.boolean),clarifyTimeoutError:Xr.transitional(Xr.boolean)},!1),null!=r&&(In.isFunction(r)?t.paramsSerializer={serialize:r}:Yr.assertOptions(r,{encode:Xr.function,serialize:Xr.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Yr.assertOptions(t,{baseUrl:Xr.spelling("baseURL"),withXsrfToken:Xr.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&In.merge(i.common,i[t.method]);i&&In.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=hr.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!s){const e=[$r.bind(this),void 0];for(e.unshift(...a),e.push(...l),u=e.length,c=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new yr(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ei(function(t){e=t}),cancel:e}}}const ti=ei,ni={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ni).forEach(([e,t])=>{ni[t]=e});const ri=ni,ii=function e(t){const n=new Zr(t),r=Mt(Zr.prototype.request,n);return In.extend(r,Zr.prototype,n,{allOwnKeys:!0}),In.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Or(t,n))},r}(ar);ii.Axios=Zr,ii.CanceledError=yr,ii.CancelToken=ti,ii.isCancel=mr,ii.VERSION=Gr,ii.toFormData=qn,ii.AxiosError=Un,ii.Cancel=ii.CanceledError,ii.all=function(e){return Promise.all(e)},ii.spread=function(e){return function(t){return e.apply(null,t)}},ii.isAxiosError=function(e){return In.isObject(e)&&!0===e.isAxiosError},ii.mergeConfig=Or,ii.AxiosHeaders=hr,ii.formToJSON=e=>ir(In.isHTMLForm(e)?new FormData(e):e),ii.getAdapter=zr,ii.HttpStatusCode=ri,ii.default=ii;const oi=ii,ai=window.lodash;function si({defaultLikerId:e,defaultLikerDisplayName:n,defaultLikerWalletAddress:r,defaultLikerAvatar:i,likecoHost:o,onLikerIdUpdate:a,editable:s}){const l=(0,t.useRef)(),[c,u]=(0,t.useState)(e),[d,p]=(0,t.useState)(n),[h,f]=(0,t.useState)(r),[m,E]=(0,t.useState)(i),[y,g]=(0,t.useState)(!1),[b,_]=(0,t.useState)(!1),[k,v]=(0,t.useState)(!0),[w,S]=(0,t.useState)(!1),R=(0,t.useMemo)(()=>(0,ai.debounce)(async e=>{if(e)try{const t=await oi.get(`https://api.${o}/users/id/${e}/min`),{user:n,displayName:r,likeWallet:i,avatar:s}=t.data;u(n),p(r),f(i),E(s),g(!1),a({likerIdValue:n,likerDisplayName:r,likerWalletAddress:i,likerAvatar:s})}catch(e){g(!1),u(""),p(""),f(""),E("")}},500),[]);return(0,t.useEffect)(()=>{R(c)},[R,c]),(0,t.useEffect)(()=>{u(e),p(n),f(r),E(i),v(!!e),S(!!e),_(!e)},[e,n,r,i]),(0,t.useEffect)(()=>{S(!!c),v(!!c)},[c]),(0,t.createElement)(t.Fragment,null,s&&(!c||b)&&(0,t.createElement)("div",{className:"tablenav top"},(0,t.createElement)("div",{className:"alignleft actions"},(0,t.createElement)("input",{ref:l,id:"likecoinIdInputBox",className:"likecoinInputBox",type:"text",placeholder:(0,Ie.__)("Search your Liker ID","likecoin"),onChange:function(e){e.preventDefault(),_(!0),g(!0);const t=e.target.value;u(t)}})," ",(0,t.createElement)("a",{id:"likecoinInputLabel",className:"likecoinInputLabel",target:"_blank",rel:"noopener noreferrer",href:`https://${o}/in`},(0,Ie.__)("Sign Up / Find my Liker ID","likecoin"))),(0,t.createElement)("br",{className:"clear"})),y?c&&(0,t.createElement)("p",{className:"description"},(0,Ie.__)("Loading...","likecoin")):d&&(0,t.createElement)("table",{className:"wp-list-table widefat fixed striped table-view-list"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,Ie.__)("Liker ID","likecoin")),(0,t.createElement)("th",null,(0,Ie.__)("Wallet","likecoin")),(0,t.createElement)("th",null,(0,Ie.__)("Actions","likecoin")))),(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("td",{className:"column-username"},m&&(0,t.createElement)("img",{id:"likecoinAvatar",src:m,width:"48",height:"48",alt:"Avatar"}),(0,t.createElement)("strong",null,(0,t.createElement)("a",{id:"likecoinId",rel:"noopener noreferrer",target:"_blank",href:`https://${o}/${c}`,className:"likecoin"},d))),(0,t.createElement)("td",null,h),(0,t.createElement)("td",null,s&&(0,t.createElement)(t.Fragment,null,k&&(0,t.createElement)("button",{className:"button",type:"button",onClick:function(e){e.preventDefault(),_(!0)}},(0,Ie.__)("Change","likecoin")),w&&(0,t.createElement)(t.Fragment,null," ",(0,t.createElement)("button",{className:"button button-danger",type:"button",onClick:function(e){e.preventDefault(),u(""),p(""),f(""),E(""),a({likerIdValue:"",likerDisplayName:"",likerWalletAddress:"",likerAvatar:""})}},(0,Ie.__)("Disconnect","likecoin")))))))),(0,t.createElement)("section",null,c&&!y&&!m&&(0,t.createElement)("div",{className:"likecoin likecoinError userNotFound"},(0,t.createElement)("h4",null,(0,Ie.__)("Liker ID not found","likecoin")))))}si.propTypes={defaultLikerId:Ue().string,defaultLikerDisplayName:Ue().string,defaultLikerWalletAddress:Ue().string,defaultLikerAvatar:Ue().string,likecoHost:Ue().string.isRequired,onLikerIdUpdate:Ue().func.isRequired,editable:Ue().bool},si.defaultProps={defaultLikerId:"",defaultLikerDisplayName:"",defaultLikerWalletAddress:"",defaultLikerAvatar:"",editable:!1};const li=si,ci="likecoin/user_liker_info",ui="/likecoin/v1/options/liker-id/user",di={DBUserLikerId:"",DBUserLikerAvatar:"",DBUserLikerDisplayName:"",DBUserLikerWallet:""},pi={getUserLikerInfo:e=>({type:"GET_USER_LIKER_INFO",path:e}),setUserLikerInfo:e=>({type:"SET_USER_LIKER_INFO",info:e}),setHTTPErrors:e=>({type:"SET_ERROR_MESSAGE",errorMsg:e}),*postUserLikerInfo(e){yield{type:"POST_USER_LIKER_INFO_TO_DB",data:e},e.likecoin_user&&(yield{type:"CHANGE_USER_LIKER_INFO_GLOBAL_STATE",data:e})}};Le(ci,{reducer:(e=di,t)=>{switch(t.type){case"SET_USER_LIKER_INFO":return{DBUserLikerId:t.info?t.info.likecoin_user.likecoin_id:"",DBUserLikerAvatar:t.info?t.info.likecoin_user.avatar:"",DBUserLikerDisplayName:t.info?t.info.likecoin_user.display_name:"",DBUserLikerWallet:t.info?t.info.likecoin_user.wallet:""};case"CHANGE_USER_LIKER_INFO_GLOBAL_STATE":return{DBUserLikerId:t.data.userLikerInfos.likecoin_id,DBUserLikerAvatar:t.data.userLikerInfos.avatar,DBUserLikerDisplayName:t.data.userLikerInfos.display_name,DBUserLikerWallet:t.data.userLikerInfos.wallet};default:return e}},controls:{GET_USER_LIKER_INFO:e=>Te()({path:e.path}),POST_USER_LIKER_INFO_TO_DB:e=>Te()({method:"POST",path:ui,data:e.data})},selectors:{selectUserLikerInfo:e=>e},resolvers:{*selectUserLikerInfo(){try{const e=(yield pi.getUserLikerInfo(ui)).data;return pi.setUserLikerInfo(e)}catch(e){return pi.setHTTPErrors(e.message)}}},actions:pi});const{likecoHost:hi}=window.likecoinReactAppData,fi=function(){const{DBUserLikerId:e,DBUserLikerAvatar:n,DBUserLikerDisplayName:r,DBUserLikerWallet:i}=(0,Re.useSelect)(e=>e(ci).selectUserLikerInfo()),{postUserLikerInfo:o}=(0,Re.useDispatch)(ci),[a,s]=(0,t.useState)(!1),[l,c]=(0,t.useState)({}),u=(0,t.useCallback)(e=>{c(e)},[]),d=(0,t.useCallback)(e=>{s(!1),e.preventDefault();const t={userLikerInfos:{likecoin_id:l.likerIdValue,display_name:l.likerDisplayName,wallet:l.likerWalletAddress,avatar:l.likerAvatar}};try{o(t),s(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(e){console.error("Error occured when saving to Wordpress DB: ",e)}},[l,o]),p=(0,t.useCallback)(e=>{e.preventDefault(),s(!1)},[]);return(0,t.createElement)("div",{className:"likecoin"},a&&(0,t.createElement)(Ge,{text:(0,Ie.__)("Settings Saved","likecoin"),className:"notice-success",handleNoticeDismiss:p}),(0,t.createElement)("form",{onSubmit:d},(0,t.createElement)(Ke,{title:(0,Ie.__)("Your Liker ID","likecoin")}),(0,t.createElement)("p",null,(0,Ie.__)("This is your Liker ID, which is used to display LikeCoin button when post is not registered on ISCN yet.","likecoin")),(0,t.createElement)(li,{likecoHost:hi,defaultLikerId:e,defaultLikerDisplayName:r,defaultLikerWalletAddress:i,defaultLikerAvatar:n,editable:!0,onLikerIdUpdate:u}),(0,t.createElement)(_t,null)))},{likecoHost:mi}=window.likecoinReactAppData,Ei=function(){const{DBUserCanEditOption:e,DBSiteLikerId:n,DBSiteLikerAvatar:r,DBSiteLikerDisplayName:i,DBSiteLikerWallet:o}=(0,Re.useSelect)(e=>e(Pe).selectSiteLikerInfo()),{postSiteLikerInfo:a}=(0,Re.useDispatch)(Pe),[s,l]=(0,t.useState)(!1),[c,u]=(0,t.useState)({}),d=(0,t.useCallback)(e=>{u(e)},[]),p=(0,t.useCallback)(t=>{l(!1),t.preventDefault();const n={siteLikerInfos:{likecoin_id:c.likerIdValue,display_name:c.likerDisplayName,wallet:c.likerWalletAddress,avatar:c.likerAvatar}};try{e&&a(n),l(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(e){console.error("Error occured when saving to Wordpress DB: ",e)}},[c,e,a]),h=(0,t.useCallback)(e=>{e.preventDefault(),l(!1)},[]);return(0,t.createElement)("div",{className:"likecoin"},s&&(0,t.createElement)(Ge,{text:(0,Ie.__)("Settings Saved","likecoin"),className:"notice-success",handleNoticeDismiss:h}),(0,t.createElement)("form",{onSubmit:p},(0,t.createElement)(Ke,{title:(0,Ie.__)("Site Default Liker ID","likecoin")}),(0,t.createElement)("p",null,(0,Ie.__)("This will be the site default Liker ID if any author has not set one.","likecoin")),(0,t.createElement)(li,{likecoHost:mi,defaultLikerId:n,defaultLikerDisplayName:i,defaultLikerWalletAddress:o,defaultLikerAvatar:r,editable:e,onLikerIdUpdate:d}),e&&(0,t.createElement)(_t,null)))},yi=n.p+"images/w3p_banner.13b75e39.png",gi=function(){const e=(0,r.createInterpolateElement)((0,Ie.__)("Web3Press provides a creative business model, especially for open content. No paywall or advertisement anymore.\n Web3Press is based on , an application-specific blockchain that the community and infrastructure focus on the creator’s economy.","likecoin"),{LikeCoin:(0,r.createElement)(Ot,{text:(0,Ie.__)("LikeCoin","likecoin"),linkAddress:"https://like.co"})}),t=(0,r.createInterpolateElement)((0,Ie.__)("Idea is the best product for your readers. Your readers buy your posts because they love your words. Web3Press helps you to productize your posts as . Let readers support you by buying your posts while reading.","likecoin"),{WNFT:(0,r.createElement)(Ot,{text:(0,Ie.__)("NFTs","likecoin"),linkAddress:"https://liker.land/writing-nft/about"})}),n=(0,r.createInterpolateElement)((0,Ie.__)("You know who has bought your NFTs with . You can connect with your fans by sending NFT gifts with warm greetings is not only possible but convenient. Conditional offers can be made according to the open data on-chain.","likecoin"),{Explorer:(0,r.createElement)(Ot,{text:(0,Ie.__)("on-chain data","likecoin"),linkAddress:"https://www.mintscan.io/likecoin"})}),i=(0,r.createInterpolateElement)((0,Ie.__)("“You are what you read”. Share your with pride. Collect the rare and valuable articles into your wallet.","likecoin"),{Portfolio:(0,r.createElement)(Ot,{text:(0,Ie.__)("NFT portfolio","likecoin"),linkAddress:"https://liker.land/dashboard?tab=collected"})}),o=(0,r.createInterpolateElement)((0,Ie.__)("Web3Press is based on , an application-specific blockchain that the community and infrastructure focus on the creator’s economy.","likecoin"),{LikeCoin:(0,r.createElement)(Ot,{text:(0,Ie.__)("LikeCoin","likecoin"),linkAddress:"https://like.co"})}),a=(0,r.createInterpolateElement)((0,Ie.__)("Register metadata () on the , store content on the decentralized file system ( and ), and backup on Internet Archive, all in one plugin.","likecoin"),{ISCN:(0,r.createElement)(Ot,{text:(0,Ie.__)("ISCN","likecoin"),linkAddress:"https://iscn.io"}),LikeCoinChain:(0,r.createElement)(Ot,{text:(0,Ie.__)("LikeCoin chain","likecoin"),linkAddress:"https://www.mintscan.io/likecoin"}),IPFS:(0,r.createElement)(Ot,{text:(0,Ie.__)("IPFS","likecoin"),linkAddress:"https://ipfs.io/"}),Arweave:(0,r.createElement)(Ot,{text:(0,Ie.__)("Arweave","likecoin"),linkAddress:"https://arweave.io/"})}),s=(0,r.createInterpolateElement)((0,Ie.__)("Web3 is a new standard of the Internet. The Internet has been evolving in the past decades and becoming increasingly decentralized. In Web1, information was 1-way-broadcast; in Web2, information was user-generated. In Web3, the concept of ownership applies to every piece of data. Echoing , the vision of WordPress, Web3Press pushes one more step forward: the freedom to OWN. Oh yes, it’s free, as in freedom.","likecoin"),{WordPress:(0,r.createElement)(Ot,{text:(0,Ie.__)("Democratise Publishing","likecoin"),linkAddress:"https://wordpress.org/about/"})}),l=(0,r.createInterpolateElement)((0,Ie.__)("Follow us by entering your email below, or visit our for latest update.","likecoin"),{Blog:(0,r.createElement)(Ot,{text:(0,Ie.__)("blog","likecoin"),linkAddress:"https://blog.like.co/?utm_source=wordpress&utm_medium=plugin&utm_campaign=about_page"})});return(0,r.createElement)("div",{className:"likecoin"},(0,r.createElement)("img",{src:yi,alt:"Word3Press Banner"}),(0,r.createElement)("h2",null,(0,Ie.__)("What is Web3Press?","likecoin")),(0,r.createElement)("p",null,e),(0,r.createElement)("p",null,(0,Ie.__)("With Web3Press, you can:","likecoin")),(0,r.createElement)("h3",null,(0,Ie.__)("Sell your posts","likecoin")),(0,r.createElement)("p",null,t),(0,r.createElement)("h3",null,(0,Ie.__)("Be proud of your work","likecoin")),(0,r.createElement)("p",null,i),(0,r.createElement)("h3",null,(0,Ie.__)("Build Community","likecoin")),(0,r.createElement)("p",null,n),(0,r.createElement)("h3",null,(0,Ie.__)("Preserve Content","likecoin")),(0,r.createElement)("p",null,a),(0,r.createElement)("hr",null),(0,r.createElement)("h2",null,(0,Ie.__)("What is LikeCoin","likecoin")),(0,r.createElement)("p",null,o),(0,r.createElement)("h2",null,(0,Ie.__)("Why Web3","likecoin")),(0,r.createElement)("p",null,s),(0,r.createElement)("hr",null),(0,r.createElement)("h2",null,(0,Ie.__)("Subscribe to our Newsletter","likecoin")),(0,r.createElement)("p",null,l),(0,r.createElement)("iframe",{src:"https://newsletter.like.co/embed",width:"100%",height:"150",title:(0,Ie.__)("Subscribe to LikeCoin newsletter","likecoin"),style:{border:"1px solid #EEE",maxWidth:"420px"},frameBorder:"0",scrolling:"no"}),(0,r.createElement)("hr",null),(0,r.createElement)("h2",null,(0,Ie.__)("Sponsor us on GitHub","likecoin")),(0,r.createElement)("iframe",{className:"lcp-github-sponsor-card",src:"https://github.com/sponsors/likecoin/card",title:"Sponsor likecoin",height:"150",width:"100%",style:{maxWidth:"660px"}}))},bi=function(){const e=(0,r.createInterpolateElement)((0,Ie.__)("Please refer to for help on using this plugin","likecoin"),{Help:(0,r.createElement)(Ot,{text:(0,Ie.__)("this guide","likecoin"),linkAddress:"https://docs.like.co/user-guide/wordpress"})}),t=(0,r.createInterpolateElement)((0,Ie.__)("Never heard of LikeCoin? Don’t worry, here are some for you to get started.","likecoin"),{LikeCoin:(0,r.createElement)(Ot,{text:(0,Ie.__)("LikeCoin","likecoin"),linkAddress:"https://like.co"}),Link:(0,r.createElement)(Ot,{text:(0,Ie.__)("here","likecoin"),linkAddress:`https://faucet.like.co/?platform=wordpress&referrer=${encodeURIComponent(document.location.origin)}`})}),n=(0,r.createInterpolateElement)((0,Ie.__)("Follow us by entering your email below, or visit our for latest update.","likecoin"),{Blog:(0,r.createElement)(Ot,{text:(0,Ie.__)("blog","likecoin"),linkAddress:"https://blog.like.co/?utm_source=wordpress&utm_medium=plugin&utm_campaign=getting_started"})});return(0,r.createElement)("div",{className:"lcp-nav-tab-panel likecoin"},(0,r.createElement)(Ke,{title:(0,Ie.__)("Getting Started","likecoin")}),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h2",null,(0,Ie.__)("1. Get some LikeCoin tokens to get started","likecoin")),(0,r.createElement)("p",null,t)),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h2",null,(0,Ie.__)("2. You are now ready, let’s start publishing.","likecoin")),(0,r.createElement)("p",null,(0,Ie.__)("Here is a video to help you understand how to publish a Writing NFT","likecoin")),(0,r.createElement)("iframe",{height:"315",src:"https://www.youtube.com/embed/zHmAidvifQw",title:(0,Ie.__)("Quickstart Video","likecoin"),frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:!0,style:{width:"100%",maxWidth:"560px"}}),(0,r.createElement)("p",null,e)),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h2",null,(0,Ie.__)("3. Subscribe to our newsletter for upcoming features","likecoin")),(0,r.createElement)("p",null,n),(0,r.createElement)("iframe",{src:"https://newsletter.like.co/embed",width:"100%",height:"150",title:(0,Ie.__)("Subscribe to LikeCoin newsletter","likecoin"),style:{border:"1px solid #EEE",background:"white",maxWidth:"420px"},frameBorder:"0",scrolling:"no"})),(0,r.createElement)("hr",null),(0,r.createElement)(Ke,{title:(0,Ie.__)("Useful Tips","likecoin")}),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h3",null,(0,Ie.__)("Publish your post before you mint Writing NFT","likecoin")),(0,r.createElement)("p",null,(0,Ie.__)("You need to publish your post first, then you can find the Publish button on the editing sidebar.","likecoin"))),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h3",null,(0,Ie.__)("Publish along with licence","likecoin")),(0,r.createElement)("p",null,(0,Ie.__)("You can set your preferred licence on the editing sidebar.","likecoin"))),(0,r.createElement)("div",{className:"lcp-card"},(0,r.createElement)("h3",null,(0,Ie.__)("Encourage your readers to collect Writing NFT of your works","likecoin")),(0,r.createElement)("p",null,(0,Ie.__)("Let your readers aware they can collect Writing NFT of your works. Let them know it is meaningful to support you.","likecoin"))))},_i=window.likecoinReactAppData||{},{appSelector:ki}=_i,vi=document.querySelector(ki);vi&&(0,r.render)((0,t.createElement)(function(e){let{basename:n,children:r,future:i,window:f}=e,m=t.useRef();var E;null==m.current&&(m.current=(void 0===(E={window:f,v5Compat:!0})&&(E={}),function(e,t,n,r){void 0===r&&(r={});let{window:i=document.defaultView,v5Compat:c=!1}=r,h=i.history,f=a.Pop,m=null,E=y();function y(){return(h.state||{idx:null}).idx}function g(){f=a.Pop;let e=y(),t=null==e?null:e-E;E=e,m&&m({action:f,location:_.location,delta:t})}function b(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof e?e:p(e);return n=n.replace(/ $/,"%20"),l(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==E&&(E=0,h.replaceState(o({},h.state,{idx:E}),""));let _={get action(){return f},get location(){return e(i,h)},listen(e){if(m)throw new Error("A history only accepts one active listener");return i.addEventListener(s,g),m=e,()=>{i.removeEventListener(s,g),m=null}},createHref:e=>t(i,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){f=a.Push;let r=d(_.location,e,t);n&&n(r,e),E=y()+1;let o=u(r,E),s=_.createHref(r);try{h.pushState(o,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;i.location.assign(s)}c&&m&&m({action:f,location:_.location,delta:1})},replace:function(e,t){f=a.Replace;let r=d(_.location,e,t);n&&n(r,e),E=y();let i=u(r,E),o=_.createHref(r);h.replaceState(i,"",o),c&&m&&m({action:f,location:_.location,delta:0})},go:e=>h.go(e)};return _}(function(e,t){let{pathname:n="/",search:r="",hash:i=""}=h(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),d("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:p(t))},function(e,t){c("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},E)));let y=m.current,[g,b]=t.useState({action:y.action,location:y.location}),{v7_startTransition:_}=i||{},k=t.useCallback(e=>{_&&ge?ge(()=>b(e)):b(e)},[b,_]);return t.useLayoutEffect(()=>y.listen(k),[y,k]),t.useEffect(()=>{return null==(e=i)||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),void(t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation));var e,t},[i]),t.createElement(ue,{basename:n,children:r,location:g.location,navigationType:g.action,navigator:y,future:i})},null,(0,t.createElement)(function(){const{DBUserCanEditOption:e}=(0,Re.useSelect)(e=>e(Pe).selectSiteLikerInfo());return(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h2",null," "),(0,t.createElement)(xe,null),(0,t.createElement)(de,null,(0,t.createElement)(ce,{path:"",element:(0,t.createElement)(Me,null)},(0,t.createElement)(ce,{index:!0,element:e?(0,t.createElement)(kt,null):(0,t.createElement)(se,{to:"/about",replace:!0})}),(0,t.createElement)(ce,{path:"advanced",element:(0,t.createElement)(Wt,null)}),(0,t.createElement)(ce,{path:"about",element:(0,t.createElement)(gi,null)})),(0,t.createElement)(ce,{path:"liker-id",element:(0,t.createElement)(vt,null)},(0,t.createElement)(ce,{index:!0,element:e?(0,t.createElement)(Ei,null):(0,t.createElement)(se,{to:"user",replace:!0})}),(0,t.createElement)(ce,{path:"user",element:(0,t.createElement)(fi,null)})),(0,t.createElement)(ce,{path:"help",element:(0,t.createElement)(bi,null)})))},null)),vi)})()})(); \ No newline at end of file diff --git a/likecoin/assets/js/sidebar/index.asset.php b/likecoin/assets/js/sidebar/index.asset.php index ef51576b..7b162735 100644 --- a/likecoin/assets/js/sidebar/index.asset.php +++ b/likecoin/assets/js/sidebar/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-i18n', 'wp-plugins', 'wp-wordcount'), 'version' => '1fd3f1d416cd96f87f5a'); + array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-i18n', 'wp-plugins', 'wp-wordcount'), 'version' => 'bc80d532cd8e3c163fef'); diff --git a/likecoin/assets/js/sidebar/index.js b/likecoin/assets/js/sidebar/index.js index 2b76ccb6..839469bd 100644 --- a/likecoin/assets/js/sidebar/index.js +++ b/likecoin/assets/js/sidebar/index.js @@ -1 +1 @@ -(()=>{var e={556:(e,t,n)=>{e.exports=n(694)()},694:(e,t,n)=>{"use strict";var r=n(925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>Ae,hasStandardBrowserEnv:()=>De,hasStandardBrowserWebWorkerEnv:()=>Be,navigator:()=>ke,origin:()=>Pe});const t=window.React,r=window.wp.plugins,o=window.wp.data;var i=n(556),s=n.n(i);const a=window.wp.editPost,l=window.wp.i18n;function c({onClick:e,paddingLeft:n,color:r}){const o=(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 30 30"},(0,t.createElement)("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},(0,t.createElement)("g",{fill:r,transform:"translate(0 1)"},(0,t.createElement)("path",{d:"M13.4,9.7l0.9-9c0.1-0.9,1.3-0.9,1.4,0l0.9,9c0.2,2,1.8,3.6,3.7,3.7l9,0.9c0.9,0.1,0.9,1.3,0,1.4l-9,0.9 c-2,0.2-3.6,1.8-3.7,3.7l-0.9,9c-0.1,0.9-1.3,0.9-1.4,0l-0.9-9c-0.2-2-1.8-3.6-3.7-3.7l-9-0.9c-0.9-0.1-0.9-1.3,0-1.4l9-0.9 C11.7,13.2,13.2,11.7,13.4,9.7z"}))));return e?(0,t.createElement)("button",{onClick:e,type:"button",style:{paddingLeft:n||0,background:"none",border:"none",padding:0,cursor:"pointer"}},o):(0,t.createElement)("div",{style:n?{paddingLeft:n}:{}},o)}c.propTypes={onClick:s().func,paddingLeft:s().string,color:s().string.isRequired},c.defaultProps={onClick:null,paddingLeft:null};const u=c;function d({title:e}){return(0,t.createElement)("div",{className:"SideBarStatusRowTitle"},(0,t.createElement)("p",{style:{marginBottom:"0px"}}," ",e," "))}d.propTypes={title:s().string.isRequired};const p=d;function f({title:e,status:n,link:r}){return(0,t.createElement)("div",{className:"sidebarStatusTitleOuterDiv"},(0,t.createElement)(p,{title:e}),n&&(0,t.createElement)("div",{className:"SideBarStatusRowDetails"}," ",r&&(0,t.createElement)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"longLink"},n)," ",!r&&n))}f.propTypes={title:s().string.isRequired,status:s().oneOfType([s().string,s().node]),link:s().string},f.defaultProps={status:null,link:null};const m=f;function h({isCurrentPostPublished:e,ISCNId:n}){return(0,t.createElement)(m,{title:(0,l.__)("State","likecoin"),status:(0,t.createElement)("div",{className:"flexBoxRow"},!e&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"greyDot"})," ",(0,t.createElement)("div",{className:"postStatusDiv"},`${(0,l.__)("Not Ready","likecoin")}`)),e&&!n&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"redDot"})," ",(0,t.createElement)("div",{className:"postStatusDiv"},`${(0,l.__)("Ready","likecoin")}`)),e&&n&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"greenDot"})," ",(0,t.createElement)("div",{className:"postStatusDiv"},`${(0,l.__)("Published","likecoin")}`)))})}h.propTypes={isCurrentPostPublished:s().bool.isRequired,ISCNId:s().string},h.defaultProps={ISCNId:null};const g=h;function E({ISCNId:e,NFTClassId:n,handleNFTAction:r}){const[i,s]=(0,t.useState)(!0),c=(0,o.useSelect)(e=>e("core/editor").isCurrentPostPublished());return(0,t.useEffect)(()=>s(!!e),[e]),(0,t.createElement)(a.PluginDocumentSettingPanel,{name:"depub-panel",title:(0,l.__)("Web3Press","likecoin"),className:"depub-panel",icon:(0,t.createElement)(u,{color:"#9B9B9B",paddingLeft:"10px"})},(0,t.createElement)("div",{className:"postStatusInfoPanelOuterDiv"},(0,t.createElement)("div",{className:"flexBoxRow"},(0,t.createElement)("div",{className:"divOuterHolderStatusInfoPanel"},(0,t.createElement)(g,{isCurrentPostPublished:c,ISCNId:e}),(0,t.createElement)("div",{className:"postStatusInfoRowOuterDiv"},!c&&(0,t.createElement)("button",{type:"button",className:"blueBackgroundWhiteTextBtn",style:{minWidth:"0",width:"100%"},onClick:e=>{e.preventDefault(),document.getElementsByClassName("editor-post-publish-button__button")[0].click()}},(0,l.__)("Publish your post first","likecoin")),c&&!e&&(0,t.createElement)("div",{style:{display:"flex",flexDirection:"row",width:"100%"}},(0,t.createElement)("button",{type:"button",className:"whiteBackgroundBlueTextSmallBtn",onClick:e=>{e.preventDefault(),document.querySelector('[aria-label="Web3Press"]').click()}},(0,l.__)("Details","likecoin"))),i&&(0,t.createElement)("button",{type:"button",className:"blueBackgroundWhiteTextSmallBtn",onClick:r},n?(0,l.__)("View NFT","likecoin"):(0,l.__)("Mint NFT","likecoin")))))))}E.propTypes={ISCNId:s().string,NFTClassId:s().string,handleNFTAction:s().func.isRequired},E.defaultProps={ISCNId:null,NFTClassId:null};const b=E,y=window.wp.components,w=window.wp.wordcount;function S(e,t){return function(){return e.apply(t,arguments)}}const{toString:T}=Object.prototype,{getPrototypeOf:N}=Object,{iterator:v,toStringTag:_}=Symbol,C=(O=Object.create(null),e=>{const t=T.call(e);return O[t]||(O[t]=t.slice(8,-1).toLowerCase())});var O;const R=e=>(e=e.toLowerCase(),t=>C(t)===e),I=e=>t=>typeof t===e,{isArray:A}=Array,k=I("undefined");function D(e){return null!==e&&!k(e)&&null!==e.constructor&&!k(e.constructor)&&F(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const B=R("ArrayBuffer"),P=I("string"),F=I("function"),L=I("number"),x=e=>null!==e&&"object"==typeof e,U=e=>{if("object"!==C(e))return!1;const t=N(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||_ in e||v in e)},j=R("Date"),M=R("File"),q=R("Blob"),H=R("FileList"),W=R("URLSearchParams"),[V,z,$,G]=["ReadableStream","Request","Response","Headers"].map(R);function J(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),A(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Z=e=>!k(e)&&e!==X,Y=(Q="undefined"!=typeof Uint8Array&&N(Uint8Array),e=>Q&&e instanceof Q);var Q;const ee=R("HTMLFormElement"),te=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ne=R("RegExp"),re=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};J(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)},oe=R("AsyncFunction"),ie=(se="function"==typeof setImmediate,ae=F(X.postMessage),se?setImmediate:ae?(le=`axios@${Math.random()}`,ce=[],X.addEventListener("message",({source:e,data:t})=>{e===X&&t===le&&ce.length&&ce.shift()()},!1),e=>{ce.push(e),X.postMessage(le,"*")}):e=>setTimeout(e));var se,ae,le,ce;const ue="undefined"!=typeof queueMicrotask?queueMicrotask.bind(X):"undefined"!=typeof process&&process.nextTick||ie,de={isArray:A,isArrayBuffer:B,isBuffer:D,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||F(e.append)&&("formdata"===(t=C(e))||"object"===t&&F(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&B(e.buffer),t},isString:P,isNumber:L,isBoolean:e=>!0===e||!1===e,isObject:x,isPlainObject:U,isEmptyObject:e=>{if(!x(e)||D(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:V,isRequest:z,isResponse:$,isHeaders:G,isUndefined:k,isDate:j,isFile:M,isBlob:q,isRegExp:ne,isFunction:F,isStream:e=>x(e)&&F(e.pipe),isURLSearchParams:W,isTypedArray:Y,isFileList:H,forEach:J,merge:function e(){const{caseless:t}=Z(this)&&this||{},n={},r=(r,o)=>{const i=t&&K(n,o)||o;U(n[i])&&U(r)?n[i]=e(n[i],r):U(r)?n[i]=e({},r):A(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e(J(t,(t,r)=>{n&&F(t)?e[r]=S(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&N(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:C,kindOfTest:R,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(A(e))return e;let t=e.length;if(!L(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[v]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ee,hasOwnProperty:te,hasOwnProp:te,reduceDescriptors:re,freezeMethods:e=>{re(e,(t,n)=>{if(F(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];F(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return A(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:K,global:X,isContextDefined:Z,isSpecCompliantForm:function(e){return!!(e&&F(e.append)&&"FormData"===e[_]&&e[v])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(x(e)){if(t.indexOf(e)>=0)return;if(D(e))return e;if(!("toJSON"in e)){t[r]=e;const o=A(e)?[]:{};return J(e,(e,t)=>{const i=n(e,r+1);!k(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:oe,isThenable:e=>e&&(x(e)||F(e))&&F(e.then)&&F(e.catch),setImmediate:ie,asap:ue,isIterable:e=>null!=e&&F(e[v])};function pe(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}de.inherits(pe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:de.toJSONObject(this.config),code:this.code,status:this.status}}});const fe=pe.prototype,me={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{me[e]={value:e}}),Object.defineProperties(pe,me),Object.defineProperty(fe,"isAxiosError",{value:!0}),pe.from=(e,t,n,r,o,i)=>{const s=Object.create(fe);return de.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),pe.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const he=pe;function ge(e){return de.isPlainObject(e)||de.isArray(e)}function Ee(e){return de.endsWith(e,"[]")?e.slice(0,-2):e}function be(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ee(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ye=de.toFlatObject(de,{},null,function(e){return/^is[A-Z]/.test(e)}),we=function(e,t,n){if(!de.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=de.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!de.isUndefined(t[e])})).metaTokens,o=n.visitor||c,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&de.isSpecCompliantForm(t);if(!de.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(de.isDate(e))return e.toISOString();if(de.isBoolean(e))return e.toString();if(!a&&de.isBlob(e))throw new he("Blob is not supported. Use a Buffer instead.");return de.isArrayBuffer(e)||de.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(de.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(de.isArray(e)&&function(e){return de.isArray(e)&&!e.some(ge)}(e)||(de.isFileList(e)||de.endsWith(n,"[]"))&&(a=de.toArray(e)))return n=Ee(n),a.forEach(function(e,r){!de.isUndefined(e)&&null!==e&&t.append(!0===s?be([n],r,i):null===s?n:n+"[]",l(e))}),!1;return!!ge(e)||(t.append(be(o,n,i),l(e)),!1)}const u=[],d=Object.assign(ye,{defaultVisitor:c,convertValue:l,isVisitable:ge});if(!de.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!de.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),de.forEach(n,function(n,i){!0===(!(de.isUndefined(n)||null===n)&&o.call(t,n,de.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),u.pop()}}(e),t};function Se(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Te(e,t){this._pairs=[],e&&we(e,this,t)}const Ne=Te.prototype;Ne.append=function(e,t){this._pairs.push([e,t])},Ne.toString=function(e){const t=e?function(t){return e.call(this,t,Se)}:Se;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ve=Te;function _e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ce(e,t,n){if(!t)return e;const r=n&&n.encode||_e;de.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):de.isURLSearchParams(t)?t.toString():new ve(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Oe=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){de.forEach(this.handlers,function(t){null!==t&&e(t)})}},Re={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ve,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ae="undefined"!=typeof window&&"undefined"!=typeof document,ke="object"==typeof navigator&&navigator||void 0,De=Ae&&(!ke||["ReactNative","NativeScript","NS"].indexOf(ke.product)<0),Be="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Pe=Ae&&window.location.href||"http://localhost",Fe={...e,...Ie},Le=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&de.isArray(r)?r.length:i,a?(de.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&de.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&de.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r{t(function(e){return de.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null},xe={transitional:Re,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=de.isObject(e);if(o&&de.isHTMLForm(e)&&(e=new FormData(e)),de.isFormData(e))return r?JSON.stringify(Le(e)):e;if(de.isArrayBuffer(e)||de.isBuffer(e)||de.isStream(e)||de.isFile(e)||de.isBlob(e)||de.isReadableStream(e))return e;if(de.isArrayBufferView(e))return e.buffer;if(de.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return we(e,new Fe.classes.URLSearchParams,{visitor:function(e,t,n,r){return Fe.isNode&&de.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=de.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return we(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e){if(de.isString(e))try{return(0,JSON.parse)(e),de.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||xe.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(de.isResponse(e)||de.isReadableStream(e))return e;if(e&&de.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw he.from(e,he.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Fe.classes.FormData,Blob:Fe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(["delete","get","head","post","put","patch"],e=>{xe.headers[e]={}});const Ue=xe,je=de.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Me=Symbol("internals");function qe(e){return e&&String(e).trim().toLowerCase()}function He(e){return!1===e||null==e?e:de.isArray(e)?e.map(He):String(e)}function We(e,t,n,r,o){return de.isFunction(r)?r.call(this,t,n):(o&&(t=n),de.isString(t)?de.isString(r)?-1!==t.indexOf(r):de.isRegExp(r)?r.test(t):void 0:void 0)}class Ve{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=qe(t);if(!o)throw new Error("header name must be a non-empty string");const i=de.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=He(e))}const i=(e,t)=>de.forEach(e,(e,n)=>o(e,n,t));if(de.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(de.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&je[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(de.isObject(e)&&de.isIterable(e)){let n,r,o={};for(const t of e){if(!de.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?de.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=qe(e)){const n=de.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(de.isFunction(t))return t.call(this,e,n);if(de.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=qe(e)){const n=de.findKey(this,e);return!(!n||void 0===this[n]||t&&!We(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=qe(e)){const o=de.findKey(n,e);!o||t&&!We(0,n[o],o,t)||(delete n[o],r=!0)}}return de.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!We(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return de.forEach(this,(r,o)=>{const i=de.findKey(n,o);if(i)return t[i]=He(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();s!==o&&delete t[o],t[s]=He(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return de.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&de.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Me]=this[Me]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=qe(e);t[r]||(function(e,t){const n=de.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return de.isArray(e)?e.forEach(r):r(e),this}}Ve.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),de.reduceDescriptors(Ve.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),de.freezeMethods(Ve);const ze=Ve;function $e(e,t){const n=this||Ue,r=t||n,o=ze.from(r.headers);let i=r.data;return de.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ge(e){return!(!e||!e.__CANCEL__)}function Je(e,t,n){he.call(this,null==e?"canceled":e,he.ERR_CANCELED,t,n),this.name="CanceledError"}de.inherits(Je,he,{__CANCEL__:!0});const Ke=Je;function Xe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new he("Request failed with status code "+n.status,[he.ERR_BAD_REQUEST,he.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Ze=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=r[s];o||(o=l),n[i]=a,r[i]=l;let u=s,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),l-o{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n)]}(n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,l=o(a);r=i,e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&i<=s?(s-i)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},Ye=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Qe=e=>(...t)=>de.asap(()=>e(...t)),et=Fe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Fe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Fe.origin),Fe.navigator&&/(msie|trident)/i.test(Fe.navigator.userAgent)):()=>!0,tt=Fe.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];de.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),de.isString(r)&&s.push("path="+r),de.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function nt(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const rt=e=>e instanceof ze?{...e}:e;function ot(e,t){t=t||{};const n={};function r(e,t,n,r){return de.isPlainObject(e)&&de.isPlainObject(t)?de.merge.call({caseless:r},e,t):de.isPlainObject(t)?de.merge({},t):de.isArray(t)?t.slice():t}function o(e,t,n,o){return de.isUndefined(t)?de.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!de.isUndefined(t))return r(void 0,t)}function s(e,t){return de.isUndefined(t)?de.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(rt(e),rt(t),0,!0)};return de.forEach(Object.keys({...e,...t}),function(r){const i=l[r]||o,s=i(e[r],t[r],r);de.isUndefined(s)&&i!==a||(n[r]=s)}),n}const it=e=>{const t=ot({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:l}=t;if(t.headers=a=ze.from(a),t.url=Ce(nt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),de.isFormData(r))if(Fe.hasStandardBrowserEnv||Fe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(Fe.hasStandardBrowserEnv&&(o&&de.isFunction(o)&&(o=o(t)),o||!1!==o&&et(t.url))){const e=i&&s&&tt.read(s);e&&a.set(i,e)}return t},st="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=it(e);let o=r.data;const i=ze.from(r.headers).normalize();let s,a,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=r;function m(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function g(){if(!h)return;const r=ze.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Xe(function(e){t(e),m()},function(e){n(e),m()},{data:d&&"text"!==d&&"json"!==d?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(g)},h.onabort=function(){h&&(n(new he("Request aborted",he.ECONNABORTED,e,h)),h=null)},h.onerror=function(){n(new he("Network Error",he.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Re;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new he(t,o.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,h)),h=null},void 0===o&&i.setContentType(null),"setRequestHeader"in h&&de.forEach(i.toJSON(),function(e,t){h.setRequestHeader(t,e)}),de.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),d&&"json"!==d&&(h.responseType=r.responseType),f&&([l,u]=Ze(f,!0),h.addEventListener("progress",l)),p&&h.upload&&([a,c]=Ze(p),h.upload.addEventListener("progress",a),h.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=t=>{h&&(n(!t||t.type?new Ke(null,e,h):t),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const E=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);E&&-1===Fe.protocols.indexOf(E)?n(new he("Unsupported protocol "+E+":",he.ERR_BAD_REQUEST,e)):h.send(o||null)})},at=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof he?t:new Ke(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new he(`timeout ${t} of ms exceeded`,he.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>de.asap(s),a}},lt=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*lt(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},ut="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,dt=ut&&"function"==typeof ReadableStream,pt=ut&&("function"==typeof TextEncoder?(ft=new TextEncoder,e=>ft.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var ft;const mt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ht=dt&&mt(()=>{let e=!1;const t=new Request(Fe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),gt=dt&&mt(()=>de.isReadableStream(new Response("").body)),Et={stream:gt&&(e=>e.body)};var bt;ut&&(bt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Et[e]&&(Et[e]=de.isFunction(bt[e])?t=>t[e]():(t,n)=>{throw new he(`Response type '${e}' is not supported`,he.ERR_NOT_SUPPORT,n)})}));const yt={http:null,xhr:st,fetch:ut&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=it(e);c=c?(c+"").toLowerCase():"text";let f,m=at([o,i&&i.toAbortSignal()],s);const h=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let g;try{if(l&&ht&&"get"!==n&&"head"!==n&&0!==(g=await(async(e,t)=>{const n=de.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(de.isBlob(e))return e.size;if(de.isSpecCompliantForm(e)){const t=new Request(Fe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return de.isArrayBufferView(e)||de.isArrayBuffer(e)?e.byteLength:(de.isURLSearchParams(e)&&(e+=""),de.isString(e)?(await pt(e)).byteLength:void 0)})(t):n})(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(de.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Ye(g,Ze(Qe(l)));r=ct(n.body,65536,e,t)}}de.isString(d)||(d=d?"include":"omit");const o="credentials"in Request.prototype;f=new Request(t,{...p,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?d:void 0});let i=await fetch(f,p);const s=gt&&("stream"===c||"response"===c);if(gt&&(a||s&&h)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=i[t]});const t=de.toFiniteNumber(i.headers.get("content-length")),[n,r]=a&&Ye(t,Ze(Qe(a),!0))||[];i=new Response(ct(i.body,65536,n,()=>{r&&r(),h&&h()}),e)}c=c||"text";let E=await Et[de.findKey(Et,c)||"text"](i,e);return!s&&h&&h(),await new Promise((t,n)=>{Xe(t,n,{data:E,headers:ze.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})})}catch(t){if(h&&h(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new he("Network Error",he.ERR_NETWORK,e,f),{cause:t.cause||t});throw he.from(t,t&&t.code,e,f)}})};de.forEach(yt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const wt=e=>`- ${e}`,St=e=>de.isFunction(e)||null===e||!1===e,Tt=e=>{e=de.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let n=t?e.length>1?"since :\n"+e.map(wt).join("\n"):" "+wt(e[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ke(null,e)}function vt(e){return Nt(e),e.headers=ze.from(e.headers),e.data=$e.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Tt(e.adapter||Ue.adapter)(e).then(function(t){return Nt(e),t.data=$e.call(e,e.transformResponse,t),t.headers=ze.from(t.headers),t},function(t){return Ge(t)||(Nt(e),t&&t.response&&(t.response.data=$e.call(e,e.transformResponse,t.response),t.response.headers=ze.from(t.response.headers))),Promise.reject(t)})}const _t="1.11.0",Ct={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ct[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ot={};Ct.transitional=function(e,t,n){function r(e,t){return"[Axios v"+_t+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new he(r(o," has been removed"+(t?" in "+t:"")),he.ERR_DEPRECATED);return t&&!Ot[o]&&(Ot[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Ct.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Rt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new he("option "+i+" must be "+n,he.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new he("Unknown option "+i,he.ERR_BAD_OPTION)}},validators:Ct},It=Rt.validators;class At{constructor(e){this.defaults=e||{},this.interceptors={request:new Oe,response:new Oe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ot(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Rt.assertOptions(n,{silentJSONParsing:It.transitional(It.boolean),forcedJSONParsing:It.transitional(It.boolean),clarifyTimeoutError:It.transitional(It.boolean)},!1),null!=r&&(de.isFunction(r)?t.paramsSerializer={serialize:r}:Rt.assertOptions(r,{encode:It.function,serialize:It.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Rt.assertOptions(t,{baseUrl:It.spelling("baseURL"),withXsrfToken:It.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&de.merge(o.common,o[t.method]);o&&de.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=ze.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[vt.bind(this),void 0];for(e.unshift(...s),e.push(...l),u=e.length,c=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Ke(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Dt(function(t){e=t}),cancel:e}}}const Bt=Dt,Pt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pt).forEach(([e,t])=>{Pt[t]=e});const Ft=Pt,Lt=function e(t){const n=new kt(t),r=S(kt.prototype.request,n);return de.extend(r,kt.prototype,n,{allOwnKeys:!0}),de.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ot(t,n))},r}(Ue);Lt.Axios=kt,Lt.CanceledError=Ke,Lt.CancelToken=Bt,Lt.isCancel=Ge,Lt.VERSION=_t,Lt.toFormData=we,Lt.AxiosError=he,Lt.Cancel=Lt.CanceledError,Lt.all=function(e){return Promise.all(e)},Lt.spread=function(e){return function(t){return e.apply(null,t)}},Lt.isAxiosError=function(e){return de.isObject(e)&&!0===e.isAxiosError},Lt.mergeConfig=ot,Lt.AxiosHeaders=ze,Lt.formToJSON=e=>Le(de.isHTMLForm(e)?new FormData(e):e),Lt.getAdapter=Tt,Lt.HttpStatusCode=Ft,Lt.default=Lt;const xt=Lt,Ut=window.wp.apiFetch;var jt=n.n(Ut);function Mt(e,t){if(o.createReduxStore){const n=(0,o.createReduxStore)(e,t);return(0,o.register)(n),n}return(0,o.registerStore)(e,t),e}const{postId:qt,likecoHost:Ht}=window.likecoinApiSettings,Wt="likecoin/iscn_info_store",Vt=`/likecoin/v1/posts/${qt}/iscn/arweave`,zt=`/likecoin/v1/posts/${qt}/iscn/metadata`,$t=`/likecoin/v1/posts/${qt}/iscn/metadata`,Gt=`https://api.${Ht}/likernft/mint?iscn_id=`,Jt={DBArticleTitle:"",DBAuthorDescription:"",DBDescription:"",DBAuthor:"",DBArticleURL:"",DBArticleTags:[],DBISCNId:"",DBArweaveId:"",DBLicense:"",DBISCNVersion:0,DBISCNTimestamp:0,DBNFTClassId:""},Kt={getISCNInfo:()=>({type:"GET_ISCN_INFO"}),setISCNInfo:e=>({type:"SET_ISCN_INFO",data:e}),getNFTInfo:e=>({type:"GET_NFT_INFO",iscnId:e}),setNFTInfo:e=>({type:"SET_NFT_INFO",data:e}),setHTTPErrors:e=>({type:"SET_ERROR_MESSAGE",errorMsg:e}),*postArweaveInfoData(e){const t=yield{type:"POST_ARWEAVE_INFO_DATA",data:e};if(!t)throw new Error("NO_ARWEAVE_INFO_RETURNED");yield{type:"UPDATE_ARWEAVE_UPLOAD_AND_IPFS_GLOBAL_STATE",data:{arweaveId:t.data.arweave_id}}},*postISCNInfoData(e){const t=yield{type:"POST_ISCN_INFO_DATA",data:e};if(!t)throw new Error("NO_ISCN_INFO_RETURNED");const{iscn_id:n,iscnVersion:r,iscnTimestamp:o}=t;yield{type:"UPDATE_ISCN_ID_GLOBAL_STATE",data:{iscnId:n,iscnTimestamp:o,iscnVersion:r}}}};Mt(Wt,{reducer:(e=Jt,t)=>{switch(t.type){case"SET_ISCN_INFO":return{...e,DBISCNId:t.data.iscnId,DBISCNVersion:t.data.iscnVersion,DBISCNTimestamp:t.data.iscnTimestamp,DBLicense:t.data.license,DBNFTClassId:t.data.nftClassId,DBArticleTitle:t.data.title,DBAuthorDescription:t.data.authorDescription,DBDescription:t.data.description,DBAuthor:t.data.author,DBArticleURL:t.data.url,DBArticleTags:t.data.tags,DBArweaveId:t.data.arweaveId};case"SET_NFT_INFO":return{...e,DBNFTClassId:t.data.classId};case"UPDATE_ARWEAVE_UPLOAD_AND_IPFS_GLOBAL_STATE":{const{arweaveId:n}=t.data;return{...e,DBArweaveId:n}}case"UPDATE_ISCN_ID_GLOBAL_STATE":return{...e,DBISCNId:t.data.iscnId,DBISCNVersion:t.data.iscnVersion,DBISCNTimestamp:1e3*t.data.iscnTimestamp};default:return e}},controls:{GET_ISCN_INFO:()=>jt()({path:zt}),GET_NFT_INFO:e=>xt.get(`${Gt}${encodeURIComponent(e.iscnId)}`),POST_ARWEAVE_INFO_DATA:e=>jt()({method:"POST",path:Vt,data:{arweaveIPFSHash:e.data.ipfsHash,arweaveId:e.data.arweaveId}}),POST_ISCN_INFO_DATA:e=>jt()({method:"POST",path:$t,data:{iscnHash:e.data.iscnHash,iscnId:e.data.iscnId,iscnVersion:e.data.iscnVersion,iscnTimestamp:e.data.timestamp,iscnData:{license:e.data.license}}})},selectors:{selectISCNInfo:e=>e,selectNFTInfo:e=>e,getLicense:e=>e.DBLicense},resolvers:{*selectISCNInfo(){try{const e=yield Kt.getISCNInfo(),{iscnId:t,iscnVersion:n,iscnTimestamp:r,iscnData:o={},title:i,authorDescription:s,description:a,author:l,url:c,tags:u,arweaveId:d,arweaveIPFSHash:p}=e;return Kt.setISCNInfo({...o,iscnId:t,iscnVersion:n,iscnTimestamp:1e3*r,title:i,authorDescription:s,description:a,author:l,url:c,tags:u,arweaveId:d,arweaveIPFSHash:p})}catch(e){return Kt.setHTTPErrors(e.message)}},*selectNFTInfo(e){if(!e)return{};try{const t=yield Kt.getNFTInfo(e),{classId:n,currentPrice:r}=t.data;return Kt.setNFTInfo({classId:n,currentPrice:r})}catch(e){return console.error(e),{}}}},actions:Kt});const Xt=function(){return(0,t.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 4C7.94772 4 7.5 4.44772 7.5 5C7.5 5.55228 7.94772 6 8.5 6H9V14H8.5C7.94772 14 7.5 14.4477 7.5 15C7.5 15.5523 7.94772 16 8.5 16H11.5C12.0523 16 12.5 15.5523 12.5 15C12.5 14.4477 12.0523 14 11.5 14H11V6H11.5C12.0523 6 12.5 5.55228 12.5 5C12.5 4.44772 12.0523 4 11.5 4H8.5ZM15.2929 13.7071C14.9024 13.3166 14.9024 12.6834 15.2929 12.2929L17.5858 10L15.2929 7.70711C14.9024 7.31658 14.9024 6.68342 15.2929 6.29289C15.6834 5.90237 16.3166 5.90237 16.7071 6.29289L19.7071 9.29289C20.0976 9.68342 20.0976 10.3166 19.7071 10.7071L16.7071 13.7071C16.3166 14.0976 15.6834 14.0976 15.2929 13.7071ZM4.70711 6.29289C5.09763 6.68342 5.09763 7.31658 4.70711 7.70711L2.41421 10L4.70711 12.2929C5.09763 12.6834 5.09763 13.3166 4.70711 13.7071C4.31658 14.0976 3.68342 14.0976 3.29289 13.7071L0.292893 10.7071C-0.0976311 10.3166 -0.097631 9.68342 0.292893 9.29289L3.29289 6.29289C3.68342 5.90237 4.31658 5.90237 4.70711 6.29289Z",fill:"#4A4A4A"}))};function Zt({onClick:e}){return(0,t.createElement)("button",{onClick:e,type:"button","aria-label":"Close",style:{cursor:"pointer",background:"none",border:"none",padding:0}},(0,t.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.8384 3.74744C15.2289 3.35691 15.8621 3.35691 16.2526 3.74744C16.6431 4.13796 16.6431 4.77113 16.2526 5.16165L11.4143 10L16.2526 14.8383C16.6431 15.2289 16.6431 15.862 16.2526 16.2526C15.8621 16.6431 15.2289 16.6431 14.8384 16.2526L10 11.4142L5.1617 16.2526C4.77117 16.6431 4.13801 16.6431 3.74748 16.2526C3.35696 15.862 3.35696 15.2289 3.74748 14.8383L8.58583 10L3.74748 5.16165C3.35696 4.77113 3.35696 4.13796 3.74748 3.74744C4.13801 3.35691 4.77117 3.35691 5.1617 3.74744L10 8.58578L14.8384 3.74744Z",fill:"#9B9B9B"})))}Zt.propTypes={onClick:s().func.isRequired};const Yt=Zt;function Qt({title:e}){return(0,t.createElement)("div",null,(0,t.createElement)("p",{className:"sidebarPopUpRowTitle"}," ",e," "))}Qt.propTypes={title:s().string.isRequired};const en=Qt;function tn({details:e}){return(0,t.createElement)("div",null,(0,t.createElement)("p",null,e))}tn.propTypes={details:s().oneOfType([s().string,s().number])},tn.defaultProps={details:""};const nn=tn;function rn({tag:e}){return(0,t.createElement)("div",{className:"TagOuterDiv"},(0,t.createElement)("p",null," ",e," "))}rn.propTypes={tag:s().string.isRequired};const on=rn,sn=[{name:(0,l.__)("(Not set)","likecoin"),value:""},{name:"CC0",value:"http://creativecommons.org/publicdomain/zero/1.0/"},{name:"CC-BY",value:"https://creativecommons.org/licenses/by/4.0/"},{name:"CC-BY-SA",value:"https://creativecommons.org/licenses/by-sa/4.0/"}];function an({onSelect:e,disabled:n,defaultLicense:r}){return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(p,{title:(0,l.__)("License:","likecoin")}),(0,t.createElement)("select",{name:"license",onChange:t=>{e(t.target.value)},disabled:!!n||null},sn.map(e=>(0,t.createElement)("option",{key:e.value,selected:e.value===r||null,value:e.value},e.name))))}an.propTypes={onSelect:s().func,disabled:s().bool,defaultLicense:s().string},an.defaultProps={onSelect:()=>{},disabled:!1,defaultLicense:""};const ln=an;function cn({onClick:e,paddingLeft:n,color:r}){const o=(0,t.createElement)("svg",{width:"22",height:"22",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.4,9.7l0.9-9c0.1-0.9,1.3-0.9,1.4,0l0.9,9c0.2,2,1.8,3.6,3.7,3.7l9,0.9c0.9,0.1,0.9,1.3,0,1.4l-9,0.9 c-2,0.2-3.6,1.8-3.7,3.7l-0.9,9c-0.1,0.9-1.3,0.9-1.4,0l-0.9-9c-0.2-2-1.8-3.6-3.7-3.7l-9-0.9c-0.9-0.1-0.9-1.3,0-1.4l9-0.9 C11.7,13.2,13.2,11.7,13.4,9.7z",fill:r}));return e?(0,t.createElement)("button",{onClick:e,type:"button",style:{paddingLeft:n||0,background:"none",border:"none",padding:0,cursor:"pointer"}},o):(0,t.createElement)("div",{style:n?{paddingLeft:n}:{}},o)}cn.propTypes={onClick:s().func,paddingLeft:s().string,color:s().string.isRequired},cn.defaultProps={onClick:null,paddingLeft:null};const un=cn,{postId:dn}=window.likecoinApiSettings,pn="likecoin/button_info_store",fn=`/likecoin/v1/posts/${dn}/button/settings`,mn=`/likecoin/v1/posts/${dn}/button/settings`,hn={isWidgetEnabled:!1,isOptionDisabled:!0,isLikerIdMissing:!1},gn={getButtonSettings:()=>({type:"GET_BUTTON_SETTINGS"}),setButtonSettings:e=>({type:"SET_BUTTON_SETTINGS",data:e}),*fetchButtonSettings(){const e=yield{type:"GET_BUTTON_SETTINGS"};if(!e)throw new Error("FETCH_BUTTON_SETTINGS_ERROR");return e},*postButtonSettings(e){if(!(yield{type:"POST_BUTTON_SETTINGS",data:e}))throw new Error("FAIL_TO_POST_BUTTON_SETTINGS")}};Mt(pn,{reducer:(e=hn,t)=>{if("SET_BUTTON_SETTINGS"===t.type){const{isWidgetEnabled:n,isOptionDisabled:r,isLikerIdMissing:o}=t.data;return{...e,isWidgetEnabled:n,isOptionDisabled:r,isLikerIdMissing:o}}return e},controls:{GET_BUTTON_SETTINGS:()=>jt()({path:fn}),POST_BUTTON_SETTINGS:e=>jt()({method:"POST",path:mn,data:{is_widget_enabled:e.data.isEnabled?"bottom":"none"}})},selectors:{getButtonSettings:e=>e},resolvers:{*getButtonSettings(){const e=yield gn.getButtonSettings(),{is_widget_enabled:t,is_disabled:n,show_no_id_error:r}=e;return gn.setButtonSettings({isWidgetEnabled:t,isOptionDisabled:n,isLikerIdMissing:r})}},actions:gn});const{likecoHost:En,likerlandHost:bn}=window.likecoinApiSettings;function yn({handleNFTAction:e,ISCNId:n,arweaveId:r,ISCNVersion:i,ISCNTimestamp:s,NFTClassId:c,title:d,description:f,author:h,tags:E,url:b}){const S=(0,o.useSelect)(e=>e("core/editor").getEditedPostAttribute("content")),{postISCNInfoData:T,postArweaveInfoData:N}=(0,o.useDispatch)(Wt),v=(0,o.useSelect)(e=>e(Wt).getLicense()),{isWidgetEnabled:_,isOptionDisabled:C}=(0,o.useSelect)(e=>e(pn).getButtonSettings()),{setButtonSettings:O,postButtonSettings:R}=(0,o.useDispatch)(pn),I=(0,w.count)(S,"words",{}),[A,k]=(0,t.useState)(!1),[D,B]=(0,t.useState)(!0),[P,F]=(0,t.useState)(!0),[L,x]=(0,t.useState)("#3973B9"),U=(0,o.useSelect)(e=>e("core/edit-post").isPluginSidebarOpened()),j=(0,o.useSelect)(e=>e("core/editor").isCurrentPostPublished());(0,t.useEffect)(()=>F(!!c),[c]),(0,t.useEffect)(()=>{const e=i?`${i} (${new Date(s).toGMTString()})`:"-";B(e)},[i,s]);const M=(0,t.useCallback)(()=>{const e=!_;R({isEnabled:e}),O({isWidgetEnabled:e})},[_,R,O]),q=(0,t.useCallback)(e=>{e.preventDefault(),k(e=>!e)},[]);return(0,t.useEffect)(()=>{x(U?"white":"#3973B9")},[U,x]),(0,t.createElement)(a.PluginSidebar,{name:"likecoin-sidebar",title:(0,l.__)("Web3Press","likecoin"),icon:(0,t.createElement)(un,{color:L})},(0,t.createElement)("div",{className:"divOuterHolder"},(0,t.createElement)("div",{className:"dePubMainSidebarDiv"},(0,t.createElement)("p",{className:"dePubStatusRed"},(0,l.__)("Decentralized Publishing","likecoin"))),(0,t.createElement)("div",{className:"likeCoinIconOuterDiv"},(0,t.createElement)(u,{color:"#9B9B9B"}))),P&&(0,t.createElement)("div",{className:"divOuterHolder"},(0,t.createElement)("div",{className:"divInnerHolder"},(0,t.createElement)("button",{type:"button",className:"blueBackgroundWhiteTextBtn",onClick:e},c?(0,l.__)("View NFT","likecoin"):(0,l.__)("Mint NFT","likecoin")))),(0,t.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,t.createElement)(m,{title:(0,l.__)("Publishing Status","likecoin"),status:""}),(0,t.createElement)(g,{isCurrentPostPublished:j,ISCNId:n}),(0,t.createElement)(m,{title:(0,l.__)("ISCN ID","likecoin"),status:n||"-",link:n?`https://app.${En}/view/${encodeURIComponent(n)}`:""}),n&&(0,t.createElement)(m,{title:(0,l.__)("NFT","likecoin"),status:c||(0,l.__)("Mint Now","likecoin"),link:c?`https://${bn}/nft/class/${encodeURIComponent(c)}`:""}),(0,t.createElement)(m,{title:(0,l.__)("Storage","likecoin"),status:r||"-",link:r?`https://arweave.net/${r}`:""}),(0,t.createElement)(m,{title:(0,l.__)("Version","likecoin"),status:D})),!C&&(0,t.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,t.createElement)(p,{title:(0,l.__)("Widget","likecoin")}),(0,t.createElement)(y.CheckboxControl,{label:(0,l.__)("Enable in-post widget","likecoin"),help:(0,l.__)("Embed widget in this post (Overrides site setting)","likecoin"),checked:!!_,onChange:M})),(0,t.createElement)("div",{className:"divOuterHolderMainSidebar"},j&&(0,t.createElement)(ln,{defaultLicense:v,disabled:!0})),(0,t.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,t.createElement)("div",{className:"sidebarStatusTitleOuterDivPointer",onClick:q,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||q(e)}},(0,t.createElement)(p,{title:(0,l.__)("Metadata","likecoin")}),(0,t.createElement)("div",{className:"marginLeftAuto"},(0,t.createElement)(Xt,null))),A&&(0,t.createElement)("div",{className:"popUpWrapper"},(0,t.createElement)("div",{className:"popUpMainTitleDiv"},(0,t.createElement)(en,{title:(0,l.__)("Metadata","likecoin")}),(0,t.createElement)("div",{className:"popUpCrossIconWrapper"},(0,t.createElement)(Yt,{onClick:q}))),(0,t.createElement)("div",{className:"popUpMainContentWrapper"},(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(en,{title:(0,l.__)("Title","likecoin")}),(0,t.createElement)(nn,{details:d})),(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(en,{title:(0,l.__)("Description","likecoin")}),(0,t.createElement)(nn,{details:f})),(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(en,{title:(0,l.__)("Author","likecoin")}),(0,t.createElement)(nn,{details:h})),(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(en,{title:(0,l.__)("Tag","likecoin")}),(0,t.createElement)("div",{className:"flexBoxRow"},E&&E.length>0&&E.map(e=>(0,t.createElement)(on,{key:e,tag:e})))),(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(en,{title:(0,l.__)("Url","likecoin")}),(0,t.createElement)(nn,{details:b})),(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(p,{title:(0,l.__)("Word count","likecoin")}),(0,t.createElement)(nn,{details:I}))))),(0,t.createElement)(y.Panel,null,(0,t.createElement)(y.PanelBody,{title:(0,l.__)("Advanced","likecoin"),initialOpen:!1},(0,t.createElement)(y.PanelRow,null,(0,t.createElement)(y.TextControl,{label:(0,l.__)("Override ISCN ID","likecoin"),value:n,onChange:e=>T({iscnId:e})})),(0,t.createElement)(y.PanelRow,null,(0,t.createElement)(y.TextControl,{label:(0,l.__)("Override Arweave ID","likecoin"),value:r,onChange:e=>{N({arweaveId:e})}})))))}yn.propTypes={handleNFTAction:s().func.isRequired,ISCNId:s().string,arweaveId:s().string,ISCNVersion:s().number,ISCNTimestamp:s().string,NFTClassId:s().string,title:s().string,description:s().string,author:s().string,tags:s().arrayOf(s().string),url:s().string},yn.defaultProps={ISCNId:null,arweaveId:null,ISCNVersion:null,ISCNTimestamp:null,NFTClassId:null,title:"",description:"",author:"",tags:[],url:""};const wn=yn,{likerlandHost:Sn}=window.likecoinApiSettings,Tn=function(){const{DBArticleTitle:e,DBAuthorDescription:n,DBDescription:r,DBAuthor:i,DBArticleURL:s,DBArticleTags:a,DBISCNId:l,DBArweaveId:c,DBISCNVersion:u,DBISCNTimestamp:d}=(0,o.useSelect)(e=>e(Wt).selectISCNInfo()),{DBNFTClassId:p}=(0,o.useSelect)(e=>e(Wt).selectNFTInfo(l)),[f,m]=(0,t.useState)(e),[h,g]=(0,t.useState)(n),[E,y]=(0,t.useState)(r),[w,S]=(0,t.useState)(i),[T,N]=(0,t.useState)(s),[v,_]=(0,t.useState)(a),[C,O]=(0,t.useState)(l),[R,I]=(0,t.useState)(p),[A,k]=(0,t.useState)(c),[D,B]=(0,t.useState)(u),[P,F]=(0,t.useState)(d);(0,t.useEffect)(()=>{if(m(e),n){const{length:e}=n.split(" ");if(e>200){const t=n.split(" ").slice(0,197).join(" ").concat("...").concat(n.split(" ")[e-1]);g(t)}else g(n)}r&&y(r),S(i),N(s),_(a),O(l),I(p),B(u),F(d),k(c)},[e,n,r,i,s,a,l,u,d,p,c]);const L=(0,t.useCallback)(e=>{if(e.preventDefault(),!C)return;if(!R)return;const t=`https://${Sn}/nft/class/${encodeURIComponent(R)}`;window.open(t,"_blank")},[C,R]);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(wn,{handleNFTAction:L,ISCNId:C,arweaveId:A,ISCNVersion:D,ISCNTimestamp:P,NFTClassId:R,title:f,authorDescription:h,description:E,author:w,tags:v,url:T}),(0,t.createElement)(b,{handleNFTAction:L,ISCNId:C,arweaveId:A,ISCNVersion:D,ISCNTimestamp:P,NFTClassId:R}))};(0,r.registerPlugin)("likecoin-sidebar",{render:function(){return(0,t.createElement)(Tn,null)}})})()})(); \ No newline at end of file +(()=>{var e={556:(e,t,n)=>{e.exports=n(694)()},694:(e,t,n)=>{"use strict";var r=n(925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>Ae,hasStandardBrowserEnv:()=>De,hasStandardBrowserWebWorkerEnv:()=>Be,navigator:()=>ke,origin:()=>Pe});const t=window.React,r=window.wp.plugins,o=window.wp.data;var i=n(556),s=n.n(i);const a=window.wp.editPost,l=window.wp.i18n;function c({onClick:e,paddingLeft:n,color:r}){const o=(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 30 30"},(0,t.createElement)("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},(0,t.createElement)("g",{fill:r,transform:"translate(0 1)"},(0,t.createElement)("path",{d:"M13.4,9.7l0.9-9c0.1-0.9,1.3-0.9,1.4,0l0.9,9c0.2,2,1.8,3.6,3.7,3.7l9,0.9c0.9,0.1,0.9,1.3,0,1.4l-9,0.9 c-2,0.2-3.6,1.8-3.7,3.7l-0.9,9c-0.1,0.9-1.3,0.9-1.4,0l-0.9-9c-0.2-2-1.8-3.6-3.7-3.7l-9-0.9c-0.9-0.1-0.9-1.3,0-1.4l9-0.9 C11.7,13.2,13.2,11.7,13.4,9.7z"}))));return e?(0,t.createElement)("button",{onClick:e,type:"button",style:{paddingLeft:n||0,background:"none",border:"none",padding:0,cursor:"pointer"}},o):(0,t.createElement)("div",{style:n?{paddingLeft:n}:{}},o)}c.propTypes={onClick:s().func,paddingLeft:s().string,color:s().string.isRequired},c.defaultProps={onClick:null,paddingLeft:null};const u=c;function d({title:e}){return(0,t.createElement)("div",{className:"SideBarStatusRowTitle"},(0,t.createElement)("p",{style:{marginBottom:"0px"}}," ",e," "))}d.propTypes={title:s().string.isRequired};const p=d;function f({title:e,status:n,link:r}){return(0,t.createElement)("div",{className:"sidebarStatusTitleOuterDiv"},(0,t.createElement)(p,{title:e}),n&&(0,t.createElement)("div",{className:"SideBarStatusRowDetails"}," ",r&&(0,t.createElement)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"longLink"},n)," ",!r&&n))}f.propTypes={title:s().string.isRequired,status:s().oneOfType([s().string,s().node]),link:s().string},f.defaultProps={status:null,link:null};const m=f;function h({isCurrentPostPublished:e,ISCNId:n}){return(0,t.createElement)(m,{title:(0,l.__)("State","likecoin"),status:(0,t.createElement)("div",{className:"flexBoxRow"},!e&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"greyDot"})," ",(0,t.createElement)("div",{className:"postStatusDiv"},`${(0,l.__)("Not Ready","likecoin")}`)),e&&!n&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"redDot"})," ",(0,t.createElement)("div",{className:"postStatusDiv"},`${(0,l.__)("Ready","likecoin")}`)),e&&n&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"greenDot"})," ",(0,t.createElement)("div",{className:"postStatusDiv"},`${(0,l.__)("Published","likecoin")}`)))})}h.propTypes={isCurrentPostPublished:s().bool.isRequired,ISCNId:s().string},h.defaultProps={ISCNId:null};const g=h;function b({ISCNId:e,NFTClassId:n,handleNFTAction:r}){const[i,s]=(0,t.useState)(!0),c=(0,o.useSelect)(e=>e("core/editor").isCurrentPostPublished());return(0,t.useEffect)(()=>s(!!e),[e]),(0,t.createElement)(a.PluginDocumentSettingPanel,{name:"depub-panel",title:(0,l.__)("Web3Press","likecoin"),className:"depub-panel",icon:(0,t.createElement)(u,{color:"#9B9B9B",paddingLeft:"10px"})},(0,t.createElement)("div",{className:"postStatusInfoPanelOuterDiv"},(0,t.createElement)("div",{className:"flexBoxRow"},(0,t.createElement)("div",{className:"divOuterHolderStatusInfoPanel"},(0,t.createElement)(g,{isCurrentPostPublished:c,ISCNId:e}),(0,t.createElement)("div",{className:"postStatusInfoRowOuterDiv"},!c&&(0,t.createElement)("button",{type:"button",className:"blueBackgroundWhiteTextBtn",style:{minWidth:"0",width:"100%"},onClick:e=>{e.preventDefault(),document.getElementsByClassName("editor-post-publish-button__button")[0].click()}},(0,l.__)("Publish your post first","likecoin")),c&&!e&&(0,t.createElement)("div",{style:{display:"flex",flexDirection:"row",width:"100%"}},(0,t.createElement)("button",{type:"button",className:"whiteBackgroundBlueTextSmallBtn",onClick:e=>{e.preventDefault(),document.querySelector('[aria-label="Web3Press"]').click()}},(0,l.__)("Details","likecoin"))),i&&(0,t.createElement)("button",{type:"button",className:"blueBackgroundWhiteTextSmallBtn",onClick:r},n?(0,l.__)("View NFT","likecoin"):(0,l.__)("Mint NFT","likecoin")))))))}b.propTypes={ISCNId:s().string,NFTClassId:s().string,handleNFTAction:s().func.isRequired},b.defaultProps={ISCNId:null,NFTClassId:null};const E=b,y=window.wp.components,w=window.wp.wordcount;function S(e,t){return function(){return e.apply(t,arguments)}}const{toString:T}=Object.prototype,{getPrototypeOf:N}=Object,{iterator:v,toStringTag:C}=Symbol,_=(O=Object.create(null),e=>{const t=T.call(e);return O[t]||(O[t]=t.slice(8,-1).toLowerCase())});var O;const R=e=>(e=e.toLowerCase(),t=>_(t)===e),I=e=>t=>typeof t===e,{isArray:A}=Array,k=I("undefined");function D(e){return null!==e&&!k(e)&&null!==e.constructor&&!k(e.constructor)&&F(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const B=R("ArrayBuffer"),P=I("string"),F=I("function"),L=I("number"),x=e=>null!==e&&"object"==typeof e,U=e=>{if("object"!==_(e))return!1;const t=N(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||C in e||v in e)},j=R("Date"),M=R("File"),q=R("Blob"),H=R("FileList"),W=R("URLSearchParams"),[V,z,$,G]=["ReadableStream","Request","Response","Headers"].map(R);function J(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),A(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Z=e=>!k(e)&&e!==X,Y=(Q="undefined"!=typeof Uint8Array&&N(Uint8Array),e=>Q&&e instanceof Q);var Q;const ee=R("HTMLFormElement"),te=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ne=R("RegExp"),re=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};J(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)},oe=R("AsyncFunction"),ie=(se="function"==typeof setImmediate,ae=F(X.postMessage),se?setImmediate:ae?(le=`axios@${Math.random()}`,ce=[],X.addEventListener("message",({source:e,data:t})=>{e===X&&t===le&&ce.length&&ce.shift()()},!1),e=>{ce.push(e),X.postMessage(le,"*")}):e=>setTimeout(e));var se,ae,le,ce;const ue="undefined"!=typeof queueMicrotask?queueMicrotask.bind(X):"undefined"!=typeof process&&process.nextTick||ie,de={isArray:A,isArrayBuffer:B,isBuffer:D,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||F(e.append)&&("formdata"===(t=_(e))||"object"===t&&F(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&B(e.buffer),t},isString:P,isNumber:L,isBoolean:e=>!0===e||!1===e,isObject:x,isPlainObject:U,isEmptyObject:e=>{if(!x(e)||D(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:V,isRequest:z,isResponse:$,isHeaders:G,isUndefined:k,isDate:j,isFile:M,isBlob:q,isRegExp:ne,isFunction:F,isStream:e=>x(e)&&F(e.pipe),isURLSearchParams:W,isTypedArray:Y,isFileList:H,forEach:J,merge:function e(){const{caseless:t}=Z(this)&&this||{},n={},r=(r,o)=>{const i=t&&K(n,o)||o;U(n[i])&&U(r)?n[i]=e(n[i],r):U(r)?n[i]=e({},r):A(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e(J(t,(t,r)=>{n&&F(t)?e[r]=S(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&N(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:_,kindOfTest:R,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(A(e))return e;let t=e.length;if(!L(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[v]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ee,hasOwnProperty:te,hasOwnProp:te,reduceDescriptors:re,freezeMethods:e=>{re(e,(t,n)=>{if(F(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];F(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return A(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:K,global:X,isContextDefined:Z,isSpecCompliantForm:function(e){return!!(e&&F(e.append)&&"FormData"===e[C]&&e[v])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(x(e)){if(t.indexOf(e)>=0)return;if(D(e))return e;if(!("toJSON"in e)){t[r]=e;const o=A(e)?[]:{};return J(e,(e,t)=>{const i=n(e,r+1);!k(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:oe,isThenable:e=>e&&(x(e)||F(e))&&F(e.then)&&F(e.catch),setImmediate:ie,asap:ue,isIterable:e=>null!=e&&F(e[v])};function pe(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}de.inherits(pe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:de.toJSONObject(this.config),code:this.code,status:this.status}}});const fe=pe.prototype,me={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{me[e]={value:e}}),Object.defineProperties(pe,me),Object.defineProperty(fe,"isAxiosError",{value:!0}),pe.from=(e,t,n,r,o,i)=>{const s=Object.create(fe);return de.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),pe.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const he=pe;function ge(e){return de.isPlainObject(e)||de.isArray(e)}function be(e){return de.endsWith(e,"[]")?e.slice(0,-2):e}function Ee(e,t,n){return e?e.concat(t).map(function(e,t){return e=be(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ye=de.toFlatObject(de,{},null,function(e){return/^is[A-Z]/.test(e)}),we=function(e,t,n){if(!de.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=de.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!de.isUndefined(t[e])})).metaTokens,o=n.visitor||c,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&de.isSpecCompliantForm(t);if(!de.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(de.isDate(e))return e.toISOString();if(de.isBoolean(e))return e.toString();if(!a&&de.isBlob(e))throw new he("Blob is not supported. Use a Buffer instead.");return de.isArrayBuffer(e)||de.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(de.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(de.isArray(e)&&function(e){return de.isArray(e)&&!e.some(ge)}(e)||(de.isFileList(e)||de.endsWith(n,"[]"))&&(a=de.toArray(e)))return n=be(n),a.forEach(function(e,r){!de.isUndefined(e)&&null!==e&&t.append(!0===s?Ee([n],r,i):null===s?n:n+"[]",l(e))}),!1;return!!ge(e)||(t.append(Ee(o,n,i),l(e)),!1)}const u=[],d=Object.assign(ye,{defaultVisitor:c,convertValue:l,isVisitable:ge});if(!de.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!de.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),de.forEach(n,function(n,i){!0===(!(de.isUndefined(n)||null===n)&&o.call(t,n,de.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),u.pop()}}(e),t};function Se(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Te(e,t){this._pairs=[],e&&we(e,this,t)}const Ne=Te.prototype;Ne.append=function(e,t){this._pairs.push([e,t])},Ne.toString=function(e){const t=e?function(t){return e.call(this,t,Se)}:Se;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ve=Te;function Ce(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _e(e,t,n){if(!t)return e;const r=n&&n.encode||Ce;de.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):de.isURLSearchParams(t)?t.toString():new ve(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Oe=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){de.forEach(this.handlers,function(t){null!==t&&e(t)})}},Re={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ve,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ae="undefined"!=typeof window&&"undefined"!=typeof document,ke="object"==typeof navigator&&navigator||void 0,De=Ae&&(!ke||["ReactNative","NativeScript","NS"].indexOf(ke.product)<0),Be="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Pe=Ae&&window.location.href||"http://localhost",Fe={...e,...Ie},Le=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&de.isArray(r)?r.length:i,a?(de.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&de.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&de.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r{t(function(e){return de.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null},xe={transitional:Re,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=de.isObject(e);if(o&&de.isHTMLForm(e)&&(e=new FormData(e)),de.isFormData(e))return r?JSON.stringify(Le(e)):e;if(de.isArrayBuffer(e)||de.isBuffer(e)||de.isStream(e)||de.isFile(e)||de.isBlob(e)||de.isReadableStream(e))return e;if(de.isArrayBufferView(e))return e.buffer;if(de.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return we(e,new Fe.classes.URLSearchParams,{visitor:function(e,t,n,r){return Fe.isNode&&de.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=de.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return we(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e){if(de.isString(e))try{return(0,JSON.parse)(e),de.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||xe.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(de.isResponse(e)||de.isReadableStream(e))return e;if(e&&de.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw he.from(e,he.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Fe.classes.FormData,Blob:Fe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(["delete","get","head","post","put","patch"],e=>{xe.headers[e]={}});const Ue=xe,je=de.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Me=Symbol("internals");function qe(e){return e&&String(e).trim().toLowerCase()}function He(e){return!1===e||null==e?e:de.isArray(e)?e.map(He):String(e)}function We(e,t,n,r,o){return de.isFunction(r)?r.call(this,t,n):(o&&(t=n),de.isString(t)?de.isString(r)?-1!==t.indexOf(r):de.isRegExp(r)?r.test(t):void 0:void 0)}class Ve{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=qe(t);if(!o)throw new Error("header name must be a non-empty string");const i=de.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=He(e))}const i=(e,t)=>de.forEach(e,(e,n)=>o(e,n,t));if(de.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(de.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&je[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(de.isObject(e)&&de.isIterable(e)){let n,r,o={};for(const t of e){if(!de.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?de.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=qe(e)){const n=de.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(de.isFunction(t))return t.call(this,e,n);if(de.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=qe(e)){const n=de.findKey(this,e);return!(!n||void 0===this[n]||t&&!We(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=qe(e)){const o=de.findKey(n,e);!o||t&&!We(0,n[o],o,t)||(delete n[o],r=!0)}}return de.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!We(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return de.forEach(this,(r,o)=>{const i=de.findKey(n,o);if(i)return t[i]=He(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();s!==o&&delete t[o],t[s]=He(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return de.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&de.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Me]=this[Me]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=qe(e);t[r]||(function(e,t){const n=de.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return de.isArray(e)?e.forEach(r):r(e),this}}Ve.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),de.reduceDescriptors(Ve.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),de.freezeMethods(Ve);const ze=Ve;function $e(e,t){const n=this||Ue,r=t||n,o=ze.from(r.headers);let i=r.data;return de.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ge(e){return!(!e||!e.__CANCEL__)}function Je(e,t,n){he.call(this,null==e?"canceled":e,he.ERR_CANCELED,t,n),this.name="CanceledError"}de.inherits(Je,he,{__CANCEL__:!0});const Ke=Je;function Xe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new he("Request failed with status code "+n.status,[he.ERR_BAD_REQUEST,he.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Ze=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=r[s];o||(o=l),n[i]=a,r[i]=l;let u=s,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),l-o{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n)]}(n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,l=o(a);r=i,e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&i<=s?(s-i)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},Ye=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Qe=e=>(...t)=>de.asap(()=>e(...t)),et=Fe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Fe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Fe.origin),Fe.navigator&&/(msie|trident)/i.test(Fe.navigator.userAgent)):()=>!0,tt=Fe.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];de.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),de.isString(r)&&s.push("path="+r),de.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function nt(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const rt=e=>e instanceof ze?{...e}:e;function ot(e,t){t=t||{};const n={};function r(e,t,n,r){return de.isPlainObject(e)&&de.isPlainObject(t)?de.merge.call({caseless:r},e,t):de.isPlainObject(t)?de.merge({},t):de.isArray(t)?t.slice():t}function o(e,t,n,o){return de.isUndefined(t)?de.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!de.isUndefined(t))return r(void 0,t)}function s(e,t){return de.isUndefined(t)?de.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(rt(e),rt(t),0,!0)};return de.forEach(Object.keys({...e,...t}),function(r){const i=l[r]||o,s=i(e[r],t[r],r);de.isUndefined(s)&&i!==a||(n[r]=s)}),n}const it=e=>{const t=ot({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:l}=t;if(t.headers=a=ze.from(a),t.url=_e(nt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),de.isFormData(r))if(Fe.hasStandardBrowserEnv||Fe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(Fe.hasStandardBrowserEnv&&(o&&de.isFunction(o)&&(o=o(t)),o||!1!==o&&et(t.url))){const e=i&&s&&tt.read(s);e&&a.set(i,e)}return t},st="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=it(e);let o=r.data;const i=ze.from(r.headers).normalize();let s,a,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=r;function m(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function g(){if(!h)return;const r=ze.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Xe(function(e){t(e),m()},function(e){n(e),m()},{data:d&&"text"!==d&&"json"!==d?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(g)},h.onabort=function(){h&&(n(new he("Request aborted",he.ECONNABORTED,e,h)),h=null)},h.onerror=function(){n(new he("Network Error",he.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Re;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new he(t,o.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,h)),h=null},void 0===o&&i.setContentType(null),"setRequestHeader"in h&&de.forEach(i.toJSON(),function(e,t){h.setRequestHeader(t,e)}),de.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),d&&"json"!==d&&(h.responseType=r.responseType),f&&([l,u]=Ze(f,!0),h.addEventListener("progress",l)),p&&h.upload&&([a,c]=Ze(p),h.upload.addEventListener("progress",a),h.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=t=>{h&&(n(!t||t.type?new Ke(null,e,h):t),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===Fe.protocols.indexOf(b)?n(new he("Unsupported protocol "+b+":",he.ERR_BAD_REQUEST,e)):h.send(o||null)})},at=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof he?t:new Ke(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new he(`timeout ${t} of ms exceeded`,he.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>de.asap(s),a}},lt=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*lt(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},ut="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,dt=ut&&"function"==typeof ReadableStream,pt=ut&&("function"==typeof TextEncoder?(ft=new TextEncoder,e=>ft.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var ft;const mt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ht=dt&&mt(()=>{let e=!1;const t=new Request(Fe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),gt=dt&&mt(()=>de.isReadableStream(new Response("").body)),bt={stream:gt&&(e=>e.body)};var Et;ut&&(Et=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!bt[e]&&(bt[e]=de.isFunction(Et[e])?t=>t[e]():(t,n)=>{throw new he(`Response type '${e}' is not supported`,he.ERR_NOT_SUPPORT,n)})}));const yt={http:null,xhr:st,fetch:ut&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=it(e);c=c?(c+"").toLowerCase():"text";let f,m=at([o,i&&i.toAbortSignal()],s);const h=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let g;try{if(l&&ht&&"get"!==n&&"head"!==n&&0!==(g=await(async(e,t)=>{const n=de.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(de.isBlob(e))return e.size;if(de.isSpecCompliantForm(e)){const t=new Request(Fe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return de.isArrayBufferView(e)||de.isArrayBuffer(e)?e.byteLength:(de.isURLSearchParams(e)&&(e+=""),de.isString(e)?(await pt(e)).byteLength:void 0)})(t):n})(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(de.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Ye(g,Ze(Qe(l)));r=ct(n.body,65536,e,t)}}de.isString(d)||(d=d?"include":"omit");const o="credentials"in Request.prototype;f=new Request(t,{...p,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?d:void 0});let i=await fetch(f,p);const s=gt&&("stream"===c||"response"===c);if(gt&&(a||s&&h)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=i[t]});const t=de.toFiniteNumber(i.headers.get("content-length")),[n,r]=a&&Ye(t,Ze(Qe(a),!0))||[];i=new Response(ct(i.body,65536,n,()=>{r&&r(),h&&h()}),e)}c=c||"text";let b=await bt[de.findKey(bt,c)||"text"](i,e);return!s&&h&&h(),await new Promise((t,n)=>{Xe(t,n,{data:b,headers:ze.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})})}catch(t){if(h&&h(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new he("Network Error",he.ERR_NETWORK,e,f),{cause:t.cause||t});throw he.from(t,t&&t.code,e,f)}})};de.forEach(yt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const wt=e=>`- ${e}`,St=e=>de.isFunction(e)||null===e||!1===e,Tt=e=>{e=de.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let n=t?e.length>1?"since :\n"+e.map(wt).join("\n"):" "+wt(e[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ke(null,e)}function vt(e){return Nt(e),e.headers=ze.from(e.headers),e.data=$e.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Tt(e.adapter||Ue.adapter)(e).then(function(t){return Nt(e),t.data=$e.call(e,e.transformResponse,t),t.headers=ze.from(t.headers),t},function(t){return Ge(t)||(Nt(e),t&&t.response&&(t.response.data=$e.call(e,e.transformResponse,t.response),t.response.headers=ze.from(t.response.headers))),Promise.reject(t)})}const Ct="1.11.0",_t={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_t[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ot={};_t.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Ct+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new he(r(o," has been removed"+(t?" in "+t:"")),he.ERR_DEPRECATED);return t&&!Ot[o]&&(Ot[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},_t.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Rt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new he("option "+i+" must be "+n,he.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new he("Unknown option "+i,he.ERR_BAD_OPTION)}},validators:_t},It=Rt.validators;class At{constructor(e){this.defaults=e||{},this.interceptors={request:new Oe,response:new Oe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ot(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Rt.assertOptions(n,{silentJSONParsing:It.transitional(It.boolean),forcedJSONParsing:It.transitional(It.boolean),clarifyTimeoutError:It.transitional(It.boolean)},!1),null!=r&&(de.isFunction(r)?t.paramsSerializer={serialize:r}:Rt.assertOptions(r,{encode:It.function,serialize:It.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Rt.assertOptions(t,{baseUrl:It.spelling("baseURL"),withXsrfToken:It.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&de.merge(o.common,o[t.method]);o&&de.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=ze.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[vt.bind(this),void 0];for(e.unshift(...s),e.push(...l),u=e.length,c=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Ke(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Dt(function(t){e=t}),cancel:e}}}const Bt=Dt,Pt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pt).forEach(([e,t])=>{Pt[t]=e});const Ft=Pt,Lt=function e(t){const n=new kt(t),r=S(kt.prototype.request,n);return de.extend(r,kt.prototype,n,{allOwnKeys:!0}),de.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ot(t,n))},r}(Ue);Lt.Axios=kt,Lt.CanceledError=Ke,Lt.CancelToken=Bt,Lt.isCancel=Ge,Lt.VERSION=Ct,Lt.toFormData=we,Lt.AxiosError=he,Lt.Cancel=Lt.CanceledError,Lt.all=function(e){return Promise.all(e)},Lt.spread=function(e){return function(t){return e.apply(null,t)}},Lt.isAxiosError=function(e){return de.isObject(e)&&!0===e.isAxiosError},Lt.mergeConfig=ot,Lt.AxiosHeaders=ze,Lt.formToJSON=e=>Le(de.isHTMLForm(e)?new FormData(e):e),Lt.getAdapter=Tt,Lt.HttpStatusCode=Ft,Lt.default=Lt;const xt=Lt,Ut=window.wp.apiFetch;var jt=n.n(Ut);function Mt(e,t){if(o.createReduxStore){const n=(0,o.createReduxStore)(e,t);return(0,o.register)(n),n}return(0,o.registerStore)(e,t),e}const qt="GET_BUTTON_SETTINGS",Ht="SET_BUTTON_SETTINGS",Wt="POST_BUTTON_SETTINGS",Vt=e=>`/likecoin/v1/posts/${e}/button/settings`,zt=e=>`/likecoin/v1/posts/${e}/iscn/metadata`,{postId:$t,likecoHost:Gt}=window.likecoinApiSettings,Jt="likecoin/iscn_info_store",Kt=(e=>`/likecoin/v1/posts/${e}/iscn/arweave`)($t),Xt=zt($t),Zt=zt($t),Yt=((e,t)=>`https://api.${e}/likernft/mint?iscn_id=${encodeURIComponent(t)}`)(Gt,""),Qt={DBArticleTitle:"",DBAuthorDescription:"",DBDescription:"",DBAuthor:"",DBArticleURL:"",DBArticleTags:[],DBISCNId:"",DBArweaveId:"",DBLicense:"",DBISCNVersion:0,DBISCNTimestamp:0,DBNFTClassId:""},en={getISCNInfo:()=>({type:"GET_ISCN_INFO"}),setISCNInfo:e=>({type:"SET_ISCN_INFO",data:e}),getNFTInfo:e=>({type:"GET_NFT_INFO",iscnId:e}),setNFTInfo:e=>({type:"SET_NFT_INFO",data:e}),setHTTPErrors:e=>({type:"SET_ERROR_MESSAGE",errorMsg:e}),*postArweaveInfoData(e){const t=yield{type:"POST_ARWEAVE_INFO_DATA",data:e};if(!t)throw new Error("NO_ARWEAVE_INFO_RETURNED");yield{type:"UPDATE_ARWEAVE_UPLOAD_AND_IPFS_GLOBAL_STATE",data:{arweaveId:t.data.arweave_id}}},*postISCNInfoData(e){const t=yield{type:"POST_ISCN_INFO_DATA",data:e};if(!t)throw new Error("NO_ISCN_INFO_RETURNED");const{iscn_id:n,iscnVersion:r,iscnTimestamp:o}=t;yield{type:"UPDATE_ISCN_ID_GLOBAL_STATE",data:{iscnId:n,iscnTimestamp:o,iscnVersion:r}}}};Mt(Jt,{reducer:(e=Qt,t)=>{switch(t.type){case"SET_ISCN_INFO":return{...e,DBISCNId:t.data.iscnId,DBISCNVersion:t.data.iscnVersion,DBISCNTimestamp:t.data.iscnTimestamp,DBLicense:t.data.license,DBNFTClassId:t.data.nftClassId,DBArticleTitle:t.data.title,DBAuthorDescription:t.data.authorDescription,DBDescription:t.data.description,DBAuthor:t.data.author,DBArticleURL:t.data.url,DBArticleTags:t.data.tags,DBArweaveId:t.data.arweaveId};case"SET_NFT_INFO":return{...e,DBNFTClassId:t.data.classId};case"UPDATE_ARWEAVE_UPLOAD_AND_IPFS_GLOBAL_STATE":{const{arweaveId:n}=t.data;return{...e,DBArweaveId:n}}case"UPDATE_ISCN_ID_GLOBAL_STATE":return{...e,DBISCNId:t.data.iscnId,DBISCNVersion:t.data.iscnVersion,DBISCNTimestamp:1e3*t.data.iscnTimestamp};default:return e}},controls:{GET_ISCN_INFO:()=>jt()({path:Xt}),GET_NFT_INFO:e=>xt.get(`${Yt}${encodeURIComponent(e.iscnId)}`),POST_ARWEAVE_INFO_DATA:e=>jt()({method:"POST",path:Kt,data:{arweaveIPFSHash:e.data.ipfsHash,arweaveId:e.data.arweaveId}}),POST_ISCN_INFO_DATA:e=>jt()({method:"POST",path:Zt,data:{iscnHash:e.data.iscnHash,iscnId:e.data.iscnId,iscnVersion:e.data.iscnVersion,iscnTimestamp:e.data.timestamp,iscnData:{license:e.data.license}}})},selectors:{selectISCNInfo:e=>e,selectNFTInfo:e=>e,getLicense:e=>e.DBLicense},resolvers:{*selectISCNInfo(){try{const e=yield en.getISCNInfo(),{iscnId:t,iscnVersion:n,iscnTimestamp:r,iscnData:o={},title:i,authorDescription:s,description:a,author:l,url:c,tags:u,arweaveId:d,arweaveIPFSHash:p}=e;return en.setISCNInfo({...o,iscnId:t,iscnVersion:n,iscnTimestamp:1e3*r,title:i,authorDescription:s,description:a,author:l,url:c,tags:u,arweaveId:d,arweaveIPFSHash:p})}catch(e){return en.setHTTPErrors(e.message)}},*selectNFTInfo(e){if(!e)return{};try{const t=yield en.getNFTInfo(e),{classId:n,currentPrice:r}=t.data;return en.setNFTInfo({classId:n,currentPrice:r})}catch(e){return console.error(e),{}}}},actions:en});const tn=function(){return(0,t.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 4C7.94772 4 7.5 4.44772 7.5 5C7.5 5.55228 7.94772 6 8.5 6H9V14H8.5C7.94772 14 7.5 14.4477 7.5 15C7.5 15.5523 7.94772 16 8.5 16H11.5C12.0523 16 12.5 15.5523 12.5 15C12.5 14.4477 12.0523 14 11.5 14H11V6H11.5C12.0523 6 12.5 5.55228 12.5 5C12.5 4.44772 12.0523 4 11.5 4H8.5ZM15.2929 13.7071C14.9024 13.3166 14.9024 12.6834 15.2929 12.2929L17.5858 10L15.2929 7.70711C14.9024 7.31658 14.9024 6.68342 15.2929 6.29289C15.6834 5.90237 16.3166 5.90237 16.7071 6.29289L19.7071 9.29289C20.0976 9.68342 20.0976 10.3166 19.7071 10.7071L16.7071 13.7071C16.3166 14.0976 15.6834 14.0976 15.2929 13.7071ZM4.70711 6.29289C5.09763 6.68342 5.09763 7.31658 4.70711 7.70711L2.41421 10L4.70711 12.2929C5.09763 12.6834 5.09763 13.3166 4.70711 13.7071C4.31658 14.0976 3.68342 14.0976 3.29289 13.7071L0.292893 10.7071C-0.0976311 10.3166 -0.097631 9.68342 0.292893 9.29289L3.29289 6.29289C3.68342 5.90237 4.31658 5.90237 4.70711 6.29289Z",fill:"#4A4A4A"}))};function nn({onClick:e}){return(0,t.createElement)("button",{onClick:e,type:"button","aria-label":"Close",style:{cursor:"pointer",background:"none",border:"none",padding:0}},(0,t.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.8384 3.74744C15.2289 3.35691 15.8621 3.35691 16.2526 3.74744C16.6431 4.13796 16.6431 4.77113 16.2526 5.16165L11.4143 10L16.2526 14.8383C16.6431 15.2289 16.6431 15.862 16.2526 16.2526C15.8621 16.6431 15.2289 16.6431 14.8384 16.2526L10 11.4142L5.1617 16.2526C4.77117 16.6431 4.13801 16.6431 3.74748 16.2526C3.35696 15.862 3.35696 15.2289 3.74748 14.8383L8.58583 10L3.74748 5.16165C3.35696 4.77113 3.35696 4.13796 3.74748 3.74744C4.13801 3.35691 4.77117 3.35691 5.1617 3.74744L10 8.58578L14.8384 3.74744Z",fill:"#9B9B9B"})))}nn.propTypes={onClick:s().func.isRequired};const rn=nn;function on({title:e}){return(0,t.createElement)("div",null,(0,t.createElement)("p",{className:"sidebarPopUpRowTitle"}," ",e," "))}on.propTypes={title:s().string.isRequired};const sn=on;function an({details:e}){return(0,t.createElement)("div",null,(0,t.createElement)("p",null,e))}an.propTypes={details:s().oneOfType([s().string,s().number])},an.defaultProps={details:""};const ln=an;function cn({tag:e}){return(0,t.createElement)("div",{className:"TagOuterDiv"},(0,t.createElement)("p",null," ",e," "))}cn.propTypes={tag:s().string.isRequired};const un=cn,dn=[{name:(0,l.__)("(Not set)","likecoin"),value:""},{name:"CC0",value:"http://creativecommons.org/publicdomain/zero/1.0/"},{name:"CC-BY",value:"https://creativecommons.org/licenses/by/4.0/"},{name:"CC-BY-SA",value:"https://creativecommons.org/licenses/by-sa/4.0/"}];function pn({onSelect:e,disabled:n,defaultLicense:r}){return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(p,{title:(0,l.__)("License:","likecoin")}),(0,t.createElement)("select",{name:"license",onChange:t=>{e(t.target.value)},disabled:n,value:r},dn.map(e=>(0,t.createElement)("option",{key:e.value,value:e.value},e.name))))}pn.propTypes={onSelect:s().func,disabled:s().bool,defaultLicense:s().string},pn.defaultProps={onSelect:()=>{},disabled:!1,defaultLicense:""};const fn=pn;function mn({onClick:e,paddingLeft:n,color:r}){const o=(0,t.createElement)("svg",{width:"22",height:"22",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.4,9.7l0.9-9c0.1-0.9,1.3-0.9,1.4,0l0.9,9c0.2,2,1.8,3.6,3.7,3.7l9,0.9c0.9,0.1,0.9,1.3,0,1.4l-9,0.9 c-2,0.2-3.6,1.8-3.7,3.7l-0.9,9c-0.1,0.9-1.3,0.9-1.4,0l-0.9-9c-0.2-2-1.8-3.6-3.7-3.7l-9-0.9c-0.9-0.1-0.9-1.3,0-1.4l9-0.9 C11.7,13.2,13.2,11.7,13.4,9.7z",fill:r}));return e?(0,t.createElement)("button",{onClick:e,type:"button",style:{paddingLeft:n||0,background:"none",border:"none",padding:0,cursor:"pointer"}},o):(0,t.createElement)("div",{style:n?{paddingLeft:n}:{}},o)}mn.propTypes={onClick:s().func,paddingLeft:s().string,color:s().string.isRequired},mn.defaultProps={onClick:null,paddingLeft:null};const hn=mn,{postId:gn}=window.likecoinApiSettings,bn="likecoin/button_info_store",En=Vt(gn),yn=Vt(gn),wn={getButtonSettings:()=>({type:qt}),setButtonSettings:e=>({type:Ht,data:e}),*fetchButtonSettings(){const e=yield{type:qt};if(!e)throw new Error("FETCH_BUTTON_SETTINGS_ERROR");return e},*postButtonSettings(e){if(!(yield{type:Wt,data:e}))throw new Error("FAIL_TO_POST_BUTTON_SETTINGS")}},Sn={[qt]:()=>jt()({path:En}),[Wt]:e=>jt()({method:"POST",path:yn,data:{is_widget_enabled:e.data.isEnabled?"bottom":"none"}})},Tn={*getButtonSettings(){const e=yield wn.getButtonSettings(),{is_widget_enabled:t,is_disabled:n,show_no_id_error:r}=e;return wn.setButtonSettings({isWidgetEnabled:t,isOptionDisabled:n,isLikerIdMissing:r})}},Nn=(vn={[Ht]:(e,t)=>{const{isWidgetEnabled:n,isOptionDisabled:r,isLikerIdMissing:o}=t.data;return{...e,isWidgetEnabled:n,isOptionDisabled:r,isLikerIdMissing:o}}},Cn={isWidgetEnabled:!1,isOptionDisabled:!0,isLikerIdMissing:!1},(e=Cn||{},t)=>{const n=vn[t.type];return n?n(e,t):e});var vn,Cn;Mt(bn,{reducer:Nn,controls:Sn,selectors:{getButtonSettings:e=>e},resolvers:Tn,actions:wn});const{likecoHost:On,likerlandHost:Rn}=window.likecoinApiSettings;function In({handleNFTAction:e,ISCNId:n,arweaveId:r,ISCNVersion:i,ISCNTimestamp:s,NFTClassId:c,title:d,description:f,author:h,tags:b,url:E}){const S=(0,o.useSelect)(e=>e("core/editor").getEditedPostAttribute("content")),{postISCNInfoData:T,postArweaveInfoData:N}=(0,o.useDispatch)(Jt),v=(0,o.useSelect)(e=>e(Jt).getLicense()),{isWidgetEnabled:C,isOptionDisabled:_}=(0,o.useSelect)(e=>e(bn).getButtonSettings()),{setButtonSettings:O,postButtonSettings:R}=(0,o.useDispatch)(bn),I=(0,w.count)(S,"words",{}),[A,k]=(0,t.useState)(!1),[D,B]=(0,t.useState)(!0),[P,F]=(0,t.useState)(!0),[L,x]=(0,t.useState)("#3973B9"),U=(0,o.useSelect)(e=>e("core/edit-post").isPluginSidebarOpened()),j=(0,o.useSelect)(e=>e("core/editor").isCurrentPostPublished());(0,t.useEffect)(()=>F(!!c),[c]),(0,t.useEffect)(()=>{const e=i?`${i} (${new Date(s).toGMTString()})`:"-";B(e)},[i,s]);const M=(0,t.useCallback)(()=>{const e=!C;R({isEnabled:e}),O({isWidgetEnabled:e})},[C,R,O]),q=(0,t.useCallback)(e=>{e.preventDefault(),k(e=>!e)},[]);return(0,t.useEffect)(()=>{x(U?"white":"#3973B9")},[U,x]),(0,t.createElement)(a.PluginSidebar,{name:"likecoin-sidebar",title:(0,l.__)("Web3Press","likecoin"),icon:(0,t.createElement)(hn,{color:L})},(0,t.createElement)("div",{className:"divOuterHolder"},(0,t.createElement)("div",{className:"dePubMainSidebarDiv"},(0,t.createElement)("p",{className:"dePubStatusRed"},(0,l.__)("Decentralized Publishing","likecoin"))),(0,t.createElement)("div",{className:"likeCoinIconOuterDiv"},(0,t.createElement)(u,{color:"#9B9B9B"}))),P&&(0,t.createElement)("div",{className:"divOuterHolder"},(0,t.createElement)("div",{className:"divInnerHolder"},(0,t.createElement)("button",{type:"button",className:"blueBackgroundWhiteTextBtn",onClick:e},c?(0,l.__)("View NFT","likecoin"):(0,l.__)("Mint NFT","likecoin")))),(0,t.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,t.createElement)(m,{title:(0,l.__)("Publishing Status","likecoin"),status:""}),(0,t.createElement)(g,{isCurrentPostPublished:j,ISCNId:n}),(0,t.createElement)(m,{title:(0,l.__)("ISCN ID","likecoin"),status:n||"-",link:n?`https://app.${On}/view/${encodeURIComponent(n)}`:""}),n&&(0,t.createElement)(m,{title:(0,l.__)("NFT","likecoin"),status:c||(0,l.__)("Mint Now","likecoin"),link:c?`https://${Rn}/nft/class/${encodeURIComponent(c)}`:""}),(0,t.createElement)(m,{title:(0,l.__)("Storage","likecoin"),status:r||"-",link:r?`https://arweave.net/${r}`:""}),(0,t.createElement)(m,{title:(0,l.__)("Version","likecoin"),status:D})),!_&&(0,t.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,t.createElement)(p,{title:(0,l.__)("Widget","likecoin")}),(0,t.createElement)(y.CheckboxControl,{label:(0,l.__)("Enable in-post widget","likecoin"),help:(0,l.__)("Embed widget in this post (Overrides site setting)","likecoin"),checked:!!C,onChange:M})),(0,t.createElement)("div",{className:"divOuterHolderMainSidebar"},j&&(0,t.createElement)(fn,{defaultLicense:v,disabled:!0})),(0,t.createElement)("div",{className:"divOuterHolderMainSidebar"},(0,t.createElement)("div",{className:"sidebarStatusTitleOuterDivPointer",onClick:q,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||q(e)}},(0,t.createElement)(p,{title:(0,l.__)("Metadata","likecoin")}),(0,t.createElement)("div",{className:"marginLeftAuto"},(0,t.createElement)(tn,null))),A&&(0,t.createElement)("div",{className:"popUpWrapper"},(0,t.createElement)("div",{className:"popUpMainTitleDiv"},(0,t.createElement)(sn,{title:(0,l.__)("Metadata","likecoin")}),(0,t.createElement)("div",{className:"popUpCrossIconWrapper"},(0,t.createElement)(rn,{onClick:q}))),(0,t.createElement)("div",{className:"popUpMainContentWrapper"},(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(sn,{title:(0,l.__)("Title","likecoin")}),(0,t.createElement)(ln,{details:d})),(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(sn,{title:(0,l.__)("Description","likecoin")}),(0,t.createElement)(ln,{details:f})),(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(sn,{title:(0,l.__)("Author","likecoin")}),(0,t.createElement)(ln,{details:h})),(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(sn,{title:(0,l.__)("Tag","likecoin")}),(0,t.createElement)("div",{className:"flexBoxRow"},b&&b.length>0&&b.map(e=>(0,t.createElement)(un,{key:e,tag:e})))),(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(sn,{title:(0,l.__)("Url","likecoin")}),(0,t.createElement)(ln,{details:E})),(0,t.createElement)("div",{className:"popUpMainContentRow"},(0,t.createElement)(p,{title:(0,l.__)("Word count","likecoin")}),(0,t.createElement)(ln,{details:I}))))),(0,t.createElement)(y.Panel,null,(0,t.createElement)(y.PanelBody,{title:(0,l.__)("Advanced","likecoin"),initialOpen:!1},(0,t.createElement)(y.PanelRow,null,(0,t.createElement)(y.TextControl,{label:(0,l.__)("Override ISCN ID","likecoin"),value:n,onChange:e=>T({iscnId:e})})),(0,t.createElement)(y.PanelRow,null,(0,t.createElement)(y.TextControl,{label:(0,l.__)("Override Arweave ID","likecoin"),value:r,onChange:e=>{N({arweaveId:e})}})))))}In.propTypes={handleNFTAction:s().func.isRequired,ISCNId:s().string,arweaveId:s().string,ISCNVersion:s().number,ISCNTimestamp:s().string,NFTClassId:s().string,title:s().string,description:s().string,author:s().string,tags:s().arrayOf(s().string),url:s().string},In.defaultProps={ISCNId:null,arweaveId:null,ISCNVersion:null,ISCNTimestamp:null,NFTClassId:null,title:"",description:"",author:"",tags:[],url:""};const An=In,{likerlandHost:kn}=window.likecoinApiSettings,Dn=function(){const{DBArticleTitle:e,DBAuthorDescription:n,DBDescription:r,DBAuthor:i,DBArticleURL:s,DBArticleTags:a,DBISCNId:l,DBArweaveId:c,DBISCNVersion:u,DBISCNTimestamp:d}=(0,o.useSelect)(e=>e(Jt).selectISCNInfo()),{DBNFTClassId:p}=(0,o.useSelect)(e=>e(Jt).selectNFTInfo(l)),[f,m]=(0,t.useState)(e),[h,g]=(0,t.useState)(n),[b,y]=(0,t.useState)(r),[w,S]=(0,t.useState)(i),[T,N]=(0,t.useState)(s),[v,C]=(0,t.useState)(a),[_,O]=(0,t.useState)(l),[R,I]=(0,t.useState)(p),[A,k]=(0,t.useState)(c),[D,B]=(0,t.useState)(u),[P,F]=(0,t.useState)(d);(0,t.useEffect)(()=>{if(m(e),n){const{length:e}=n.split(" ");if(e>200){const t=n.split(" ").slice(0,197).join(" ").concat("...").concat(n.split(" ")[e-1]);g(t)}else g(n)}r&&y(r),S(i),N(s),C(a),O(l),I(p),B(u),F(d),k(c)},[e,n,r,i,s,a,l,u,d,p,c]);const L=(0,t.useCallback)(e=>{if(e.preventDefault(),!_)return;if(!R)return;const t=`https://${kn}/nft/class/${encodeURIComponent(R)}`;window.open(t,"_blank")},[_,R]);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(An,{handleNFTAction:L,ISCNId:_,arweaveId:A,ISCNVersion:D,ISCNTimestamp:P,NFTClassId:R,title:f,authorDescription:h,description:b,author:w,tags:v,url:T}),(0,t.createElement)(E,{handleNFTAction:L,ISCNId:_,arweaveId:A,ISCNVersion:D,ISCNTimestamp:P,NFTClassId:R}))};(0,r.registerPlugin)("likecoin-sidebar",{render:function(){return(0,t.createElement)(Dn,null)}})})()})(); \ No newline at end of file diff --git a/likecoin/js/admin-settings/src/store/constants.js b/likecoin/js/admin-settings/src/store/constants.js new file mode 100644 index 00000000..e34ac1f1 --- /dev/null +++ b/likecoin/js/admin-settings/src/store/constants.js @@ -0,0 +1,31 @@ +export const ACTION_TYPES = { + SITE_PUBLISH: { + GET_OPTIONS: 'GET_SITE_PUBLISH_OPTIONS', + SET_OPTIONS: 'SET_SITE_PUBLISH_OPTIONS', + POST_OPTIONS_TO_DB: 'POST_SITE_PUBLISH_OPTIONS_TO_DB', + CHANGE_GLOBAL_STATE: 'CHANGE_SITE_PUBLISH_OPTIONS_GLOBAL_STATE', + }, + + OTHER_SETTINGS: { + SET_PAYMENT_POINTER: 'SET_PAYMENT_POINTER', + GET_PAYMENT_POINTER: 'GET_PAYMENT_POINTER', + POST_PAYMENT_POINTER: 'POST_PAYMENT_POINTER', + CHANGE_PAYMENT_POINTER_GLOBAL_STATE: 'CHANGE_PAYMENT_POINTER_GLOBAL_STATE', + }, + + COMMON: { + SET_ERROR_MESSAGE: 'SET_ERROR_MESSAGE', + }, +}; + +export const API_ENDPOINTS = { + SITE_PUBLISH: '/likecoin/v1/option/publish', + WEB_MONETIZATION: '/likecoin/v1/option/web-monetization', +}; + +export const STORE_NAMES = { + SITE_PUBLISH: 'likecoin/site_publish', + OTHER_SETTINGS: 'likecoin/other_settings', + SITE_LIKER_INFO: 'likecoin/site_liker_info', + USER_LIKER_INFO: 'likecoin/user_liker_info', +}; diff --git a/likecoin/js/admin-settings/src/store/helpers.js b/likecoin/js/admin-settings/src/store/helpers.js new file mode 100644 index 00000000..f204e514 --- /dev/null +++ b/likecoin/js/admin-settings/src/store/helpers.js @@ -0,0 +1,30 @@ +// eslint-disable-next-line arrow-body-style +export const createReducer = (actionHandlers, initialState) => { + // eslint-disable-next-line default-param-last + return (state = initialState || {}, action) => { + const handler = actionHandlers[action.type]; + return handler ? handler(state, action) : state; + }; +}; +export const createAsyncActions = (domain, actionTypes) => ({ + [`get${domain}`]: (path) => ({ type: actionTypes.GET, path }), + [`set${domain}`]: (data) => ({ type: actionTypes.SET, data }), + * [`post${domain}`](data) { + yield { type: actionTypes.POST_TO_DB, data }; + yield { type: actionTypes.CHANGE_GLOBAL_STATE, data }; + }, +}); + +export const createErrorAction = (errorMsg) => ({ + type: 'SET_ERROR_MESSAGE', + errorMsg, +}); + +export const createApiControl = (endpoint) => ({ + GET: (action) => window.wp.apiFetch({ path: action.path || endpoint }), + POST: (action) => window.wp.apiFetch({ + method: 'POST', + path: endpoint, + data: action.data, + }), +}); diff --git a/likecoin/js/admin-settings/src/store/index.js b/likecoin/js/admin-settings/src/store/index.js new file mode 100644 index 00000000..ecc589ae --- /dev/null +++ b/likecoin/js/admin-settings/src/store/index.js @@ -0,0 +1,3 @@ +export { createAndRegisterReduxStore } from './util'; +export * from './constants'; +export * from './helpers'; diff --git a/likecoin/js/admin-settings/src/store/other-setting-store.js b/likecoin/js/admin-settings/src/store/other-setting-store.js index 9ec68dab..4097cd4a 100644 --- a/likecoin/js/admin-settings/src/store/other-setting-store.js +++ b/likecoin/js/admin-settings/src/store/other-setting-store.js @@ -1,34 +1,36 @@ import apiFetch from '@wordpress/api-fetch'; -import { createAndRegisterReduxStore } from './util'; +import { + createAndRegisterReduxStore, ACTION_TYPES, API_ENDPOINTS, STORE_NAMES, createReducer, +} from './index'; // eslint-disable-next-line import/prefer-default-export -export const OTHER_SETTING_STORE_NAME = 'likecoin/other_settings'; +export const OTHER_SETTING_STORE_NAME = STORE_NAMES.OTHER_SETTINGS; -const webMonetizationEndpoint = '/likecoin/v1/option/web-monetization'; +const webMonetizationEndpoint = API_ENDPOINTS.WEB_MONETIZATION; const INITIAL_STATE = { DBPaymentPointer: '', }; const actions = { setPaymentPointer(paymentPointer) { return { - type: 'SET_PAYMENT_POINTER', + type: ACTION_TYPES.OTHER_SETTINGS.SET_PAYMENT_POINTER, paymentPointer, }; }, getPaymentPointer() { return { - type: 'GET_PAYMENT_POINTER', + type: ACTION_TYPES.OTHER_SETTINGS.GET_PAYMENT_POINTER, }; }, setHTTPErrors(errorMsg) { return { - type: 'SET_ERROR_MESSAGE', + type: ACTION_TYPES.COMMON.SET_ERROR_MESSAGE, errorMsg, }; }, * postPaymentPointer(paymentPointer) { - yield { type: 'POST_PAYMENT_POINTER', paymentPointer }; // change DB - yield { type: 'CHANGE_PAYMENT_POINTER_GLOBAL_STATE', paymentPointer }; // change global state + yield { type: ACTION_TYPES.OTHER_SETTINGS.POST_PAYMENT_POINTER, paymentPointer }; + yield { type: ACTION_TYPES.OTHER_SETTINGS.CHANGE_PAYMENT_POINTER_GLOBAL_STATE, paymentPointer }; }, }; @@ -37,10 +39,10 @@ const selectors = { }; const controls = { - GET_PAYMENT_POINTER() { + [ACTION_TYPES.OTHER_SETTINGS.GET_PAYMENT_POINTER]() { return apiFetch({ path: webMonetizationEndpoint }); }, - POST_PAYMENT_POINTER(action) { + [ACTION_TYPES.OTHER_SETTINGS.POST_PAYMENT_POINTER](action) { return apiFetch({ method: 'POST', path: webMonetizationEndpoint, @@ -60,24 +62,14 @@ const resolvers = { } }, }; -// eslint-disable-next-line default-param-last -const reducer = (state = INITIAL_STATE, action) => { - switch (action.type) { - case 'SET_PAYMENT_POINTER': { - return { - DBPaymentPointer: action.paymentPointer, - }; - } - case 'CHANGE_PAYMENT_POINTER_GLOBAL_STATE': { - return { - DBPaymentPointer: action.paymentPointer, - }; - } - default: { - return state; - } - } -}; +const reducer = createReducer({ + [ACTION_TYPES.OTHER_SETTINGS.SET_PAYMENT_POINTER]: (state, action) => ({ + DBPaymentPointer: action.paymentPointer, + }), + [ACTION_TYPES.OTHER_SETTINGS.CHANGE_PAYMENT_POINTER_GLOBAL_STATE]: (state, action) => ({ + DBPaymentPointer: action.paymentPointer, + }), +}, INITIAL_STATE); const storeConfig = { reducer, controls, diff --git a/likecoin/js/admin-settings/src/store/site-publish-store.js b/likecoin/js/admin-settings/src/store/site-publish-store.js index 6a56a1b5..4373455c 100644 --- a/likecoin/js/admin-settings/src/store/site-publish-store.js +++ b/likecoin/js/admin-settings/src/store/site-publish-store.js @@ -1,11 +1,13 @@ import apiFetch from '@wordpress/api-fetch'; -import { createAndRegisterReduxStore } from './util'; +import { + createAndRegisterReduxStore, ACTION_TYPES, API_ENDPOINTS, STORE_NAMES, createReducer, +} from './index'; // eslint-disable-next-line import/prefer-default-export -export const SITE_PUBLISH_STORE_NAME = 'likecoin/site_publish'; +export const SITE_PUBLISH_STORE_NAME = STORE_NAMES.SITE_PUBLISH; -const getPublishOptionEndpoint = '/likecoin/v1/option/publish'; -const postPublishOptionsEndpoint = '/likecoin/v1/option/publish'; +const getPublishOptionEndpoint = API_ENDPOINTS.SITE_PUBLISH; +const postPublishOptionsEndpoint = API_ENDPOINTS.SITE_PUBLISH; const INITIAL_STATE = { DBSiteInternetArchiveEnabled: false, @@ -16,25 +18,25 @@ const INITIAL_STATE = { const actions = { getSitePublishOptions(path) { return { - type: 'GET_SITE_PUBLISH_OPTIONS', + type: ACTION_TYPES.SITE_PUBLISH.GET_OPTIONS, path, }; }, setSitePublishOptions(options) { return { - type: 'SET_SITE_PUBLISH_OPTIONS', + type: ACTION_TYPES.SITE_PUBLISH.SET_OPTIONS, options, }; }, setHTTPErrors(errorMsg) { return { - type: 'SET_ERROR_MESSAGE', + type: ACTION_TYPES.COMMON.SET_ERROR_MESSAGE, errorMsg, }; }, * postSitePublishOptions(options) { - yield { type: 'POST_SITE_PUBLISH_OPTIONS_TO_DB', data: options }; - yield { type: 'CHANGE_SITE_PUBLISH_OPTIONS_GLOBAL_STATE', data: options }; + yield { type: ACTION_TYPES.SITE_PUBLISH.POST_OPTIONS_TO_DB, data: options }; + yield { type: ACTION_TYPES.SITE_PUBLISH.CHANGE_GLOBAL_STATE, data: options }; }, }; @@ -43,10 +45,10 @@ const selectors = { }; const controls = { - GET_SITE_PUBLISH_OPTIONS(action) { + [ACTION_TYPES.SITE_PUBLISH.GET_OPTIONS](action) { return apiFetch({ path: action.path }); }, - POST_SITE_PUBLISH_OPTIONS_TO_DB(action) { + [ACTION_TYPES.SITE_PUBLISH.POST_OPTIONS_TO_DB](action) { return apiFetch({ method: 'POST', path: postPublishOptionsEndpoint, @@ -70,33 +72,25 @@ const resolvers = { }, }; -// eslint-disable-next-line default-param-last -const reducer = (state = INITIAL_STATE, action) => { - switch (action.type) { - case 'SET_SITE_PUBLISH_OPTIONS': { - return { - DBSiteInternetArchiveEnabled: action.options.lc_internet_archive_enabled, - DBSiteInternetArchiveAccessKey: action.options.lc_internet_archive_access_key, - DBISCNBadgeStyleOption: action.options.iscn_badge_style_option, - }; - } - case 'CHANGE_SITE_PUBLISH_OPTIONS_GLOBAL_STATE': { - // HACK: remove all undefined data to prevent unneeded overwrite - const updateObject = JSON.parse(JSON.stringify({ - DBSiteInternetArchiveEnabled: action.data.siteInternetArchiveEnabled, - DBSiteInternetArchiveAccessKey: action.data.siteInternetArchiveAccessKey, - DBISCNBadgeStyleOption: action.data.ISCNBadgeStyleOption, - })); - return { - ...state, - ...updateObject, - }; - } - default: { - return state; - } - } -}; +const reducer = createReducer({ + [ACTION_TYPES.SITE_PUBLISH.SET_OPTIONS]: (state, action) => ({ + DBSiteInternetArchiveEnabled: action.options.lc_internet_archive_enabled, + DBSiteInternetArchiveAccessKey: action.options.lc_internet_archive_access_key, + DBISCNBadgeStyleOption: action.options.iscn_badge_style_option, + }), + [ACTION_TYPES.SITE_PUBLISH.CHANGE_GLOBAL_STATE]: (state, action) => { + // HACK: remove all undefined data to prevent unneeded overwrite + const updateObject = JSON.parse(JSON.stringify({ + DBSiteInternetArchiveEnabled: action.data.siteInternetArchiveEnabled, + DBSiteInternetArchiveAccessKey: action.data.siteInternetArchiveAccessKey, + DBISCNBadgeStyleOption: action.data.ISCNBadgeStyleOption, + })); + return { + ...state, + ...updateObject, + }; + }, +}, INITIAL_STATE); const storeConfig = { reducer, diff --git a/likecoin/js/sidebar/src/components/LicensePicker.jsx b/likecoin/js/sidebar/src/components/LicensePicker.jsx index 3a1eb5b0..cfda5f3c 100644 --- a/likecoin/js/sidebar/src/components/LicensePicker.jsx +++ b/likecoin/js/sidebar/src/components/LicensePicker.jsx @@ -28,13 +28,9 @@ function LicensePicker({ onSelect, disabled, defaultLicense }) { return ( <> - {OPTIONS.map((o) => ( - ))} diff --git a/likecoin/js/sidebar/src/store/button-info-store.js b/likecoin/js/sidebar/src/store/button-info-store.js index 9b55bf1e..f469c0e5 100644 --- a/likecoin/js/sidebar/src/store/button-info-store.js +++ b/likecoin/js/sidebar/src/store/button-info-store.js @@ -1,15 +1,17 @@ import apiFetch from '@wordpress/api-fetch'; -import { createAndRegisterReduxStore } from './util'; +import { + createAndRegisterReduxStore, ACTION_TYPES, API_ENDPOINTS, STORE_NAMES, createReducer, +} from './index'; const { postId, } = window.likecoinApiSettings; // eslint-disable-next-line import/prefer-default-export -export const BUTTON_INFO_STORE_NAME = 'likecoin/button_info_store'; +export const BUTTON_INFO_STORE_NAME = STORE_NAMES.BUTTON_INFO; -const getButtonSettingsEndpoint = `/likecoin/v1/posts/${postId}/button/settings`; -const postButtonSettingsEndpoint = `/likecoin/v1/posts/${postId}/button/settings`; +const getButtonSettingsEndpoint = API_ENDPOINTS.BUTTON_SETTINGS(postId); +const postButtonSettingsEndpoint = API_ENDPOINTS.BUTTON_SETTINGS(postId); const INITIAL_STATE = { isWidgetEnabled: false, @@ -19,24 +21,24 @@ const INITIAL_STATE = { const actions = { getButtonSettings() { return { - type: 'GET_BUTTON_SETTINGS', + type: ACTION_TYPES.BUTTON_INFO.GET_SETTINGS, }; }, setButtonSettings(data) { return { - type: 'SET_BUTTON_SETTINGS', + type: ACTION_TYPES.BUTTON_INFO.SET_SETTINGS, data, }; }, * fetchButtonSettings() { - const res = yield { type: 'GET_BUTTON_SETTINGS' }; + const res = yield { type: ACTION_TYPES.BUTTON_INFO.GET_SETTINGS }; if (!res) { throw new Error('FETCH_BUTTON_SETTINGS_ERROR'); } return res; }, * postButtonSettings(data) { - const res = yield { type: 'POST_BUTTON_SETTINGS', data }; + const res = yield { type: ACTION_TYPES.BUTTON_INFO.POST_SETTINGS, data }; if (!res) { throw new Error('FAIL_TO_POST_BUTTON_SETTINGS'); } @@ -48,12 +50,12 @@ const selectors = { }; const controls = { - GET_BUTTON_SETTINGS() { + [ACTION_TYPES.BUTTON_INFO.GET_SETTINGS]() { return apiFetch({ path: getButtonSettingsEndpoint, }); }, - POST_BUTTON_SETTINGS(action) { + [ACTION_TYPES.BUTTON_INFO.POST_SETTINGS](action) { return apiFetch({ method: 'POST', path: postButtonSettingsEndpoint, @@ -79,27 +81,21 @@ const resolvers = { }); }, }; -// eslint-disable-next-line default-param-last -const reducer = (state = INITIAL_STATE, action) => { - switch (action.type) { - case 'SET_BUTTON_SETTINGS': { - const { - isWidgetEnabled, - isOptionDisabled, - isLikerIdMissing, - } = action.data; - return { - ...state, - isWidgetEnabled, - isOptionDisabled, - isLikerIdMissing, - }; - } - default: { - return state; - } - } -}; +const reducer = createReducer({ + [ACTION_TYPES.BUTTON_INFO.SET_SETTINGS]: (state, action) => { + const { + isWidgetEnabled, + isOptionDisabled, + isLikerIdMissing, + } = action.data; + return { + ...state, + isWidgetEnabled, + isOptionDisabled, + isLikerIdMissing, + }; + }, +}, INITIAL_STATE); const storeConfig = { reducer, diff --git a/likecoin/js/sidebar/src/store/constants.js b/likecoin/js/sidebar/src/store/constants.js new file mode 100644 index 00000000..067a2975 --- /dev/null +++ b/likecoin/js/sidebar/src/store/constants.js @@ -0,0 +1,34 @@ +export const ACTION_TYPES = { + BUTTON_INFO: { + GET_SETTINGS: 'GET_BUTTON_SETTINGS', + SET_SETTINGS: 'SET_BUTTON_SETTINGS', + POST_SETTINGS: 'POST_BUTTON_SETTINGS', + }, + + ISCN_INFO: { + GET_INFO: 'GET_ISCN_INFO', + SET_INFO: 'SET_ISCN_INFO', + GET_NFT_INFO: 'GET_NFT_INFO', + SET_NFT_INFO: 'SET_NFT_INFO', + POST_ARWEAVE_DATA: 'POST_ARWEAVE_INFO_DATA', + POST_ISCN_DATA: 'POST_ISCN_INFO_DATA', + UPDATE_ARWEAVE_STATE: 'UPDATE_ARWEAVE_UPLOAD_AND_IPFS_GLOBAL_STATE', + UPDATE_ISCN_STATE: 'UPDATE_ISCN_ID_GLOBAL_STATE', + }, + + COMMON: { + SET_ERROR_MESSAGE: 'SET_ERROR_MESSAGE', + }, +}; + +export const API_ENDPOINTS = { + BUTTON_SETTINGS: (postId) => `/likecoin/v1/posts/${postId}/button/settings`, + ISCN_METADATA: (postId) => `/likecoin/v1/posts/${postId}/iscn/metadata`, + ARWEAVE_INFO: (postId) => `/likecoin/v1/posts/${postId}/iscn/arweave`, + NFT_MINT_INFO: (likecoHost, iscnId) => `https://api.${likecoHost}/likernft/mint?iscn_id=${encodeURIComponent(iscnId)}`, +}; + +export const STORE_NAMES = { + BUTTON_INFO: 'likecoin/button_info_store', + ISCN_INFO: 'likecoin/iscn_info_store', +}; diff --git a/likecoin/js/sidebar/src/store/helpers.js b/likecoin/js/sidebar/src/store/helpers.js new file mode 100644 index 00000000..dd8979ee --- /dev/null +++ b/likecoin/js/sidebar/src/store/helpers.js @@ -0,0 +1,33 @@ +// eslint-disable-next-line arrow-body-style +export const createReducer = (actionHandlers, initialState) => { + // eslint-disable-next-line default-param-last + return (state = initialState || {}, action) => { + const handler = actionHandlers[action.type]; + return handler ? handler(state, action) : state; + }; +}; +export const createAsyncActions = (actionTypes) => ({ + get: (path) => ({ type: actionTypes.GET, path }), + set: (data) => ({ type: actionTypes.SET, data }), + * post(data) { + const res = yield { type: actionTypes.POST, data }; + if (!res) { + throw new Error('API_REQUEST_FAILED'); + } + return res; + }, +}); + +export const createErrorAction = (errorMsg) => ({ + type: 'SET_ERROR_MESSAGE', + errorMsg, +}); + +export const createApiControl = (endpoint) => ({ + GET: () => window.wp.apiFetch({ path: endpoint }), + POST: (action) => window.wp.apiFetch({ + method: 'POST', + path: endpoint, + data: action.data, + }), +}); diff --git a/likecoin/js/sidebar/src/store/index.js b/likecoin/js/sidebar/src/store/index.js new file mode 100644 index 00000000..ecc589ae --- /dev/null +++ b/likecoin/js/sidebar/src/store/index.js @@ -0,0 +1,3 @@ +export { createAndRegisterReduxStore } from './util'; +export * from './constants'; +export * from './helpers'; diff --git a/likecoin/js/sidebar/src/store/iscn-info-store.js b/likecoin/js/sidebar/src/store/iscn-info-store.js index bd625605..acfefd87 100644 --- a/likecoin/js/sidebar/src/store/iscn-info-store.js +++ b/likecoin/js/sidebar/src/store/iscn-info-store.js @@ -1,18 +1,20 @@ import axios from 'axios'; import apiFetch from '@wordpress/api-fetch'; -import { createAndRegisterReduxStore } from './util'; +import { + createAndRegisterReduxStore, API_ENDPOINTS, STORE_NAMES, +} from './index'; const { postId, likecoHost, } = window.likecoinApiSettings; // eslint-disable-next-line import/prefer-default-export -export const ISCN_INFO_STORE_NAME = 'likecoin/iscn_info_store'; +export const ISCN_INFO_STORE_NAME = STORE_NAMES.ISCN_INFO; -const saveArweaveInfoEndpoint = `/likecoin/v1/posts/${postId}/iscn/arweave`; -const getISCNInfoEndpoint = `/likecoin/v1/posts/${postId}/iscn/metadata`; -const saveISCNInfoEndPoint = `/likecoin/v1/posts/${postId}/iscn/metadata`; -const getNFTMintInfoEndpoint = `https://api.${likecoHost}/likernft/mint?iscn_id=`; +const saveArweaveInfoEndpoint = API_ENDPOINTS.ARWEAVE_INFO(postId); +const getISCNInfoEndpoint = API_ENDPOINTS.ISCN_METADATA(postId); +const saveISCNInfoEndPoint = API_ENDPOINTS.ISCN_METADATA(postId); +const getNFTMintInfoEndpoint = API_ENDPOINTS.NFT_MINT_INFO(likecoHost, ''); const INITIAL_STATE = { DBArticleTitle: '', diff --git a/likecoin/likecoin.php b/likecoin/likecoin.php index 4ae8d0a2..fa8186e5 100644 --- a/likecoin/likecoin.php +++ b/likecoin/likecoin.php @@ -7,11 +7,11 @@ * @package LikeCoin * @author LikeCoin * @license GPLv3 - * @link https://github.com/likecoin/likecoin-wordpress + * @link https://github.com/likecoin/nftpress * @copyright 2018 LikerLand * Plugin Name: Web3Press by LikeCoin - * Plugin URI: https://github.com/likecoin/likecoin-wordpress + * Plugin URI: https://github.com/likecoin/nftpress * Description: Publishes your posts to the blockchain. Sell your posts, share your work, build community, preserve content. * Version: 3.3.0 * Author: LikeCoin diff --git a/likecoin/readme.txt b/likecoin/readme.txt index e8bcdeca..deb9a25c 100644 --- a/likecoin/readme.txt +++ b/likecoin/readme.txt @@ -38,7 +38,7 @@ Register content metadata (ISCN) on LikeCoin chain, storing the content file on == Contribution == -LikeCoin is an open-source project. You are welcome to contribute to the plugin on [Github](https://github.com/likecoin/likecoin-wordpress) if you are a developer. +LikeCoin is an open-source project. You are welcome to contribute to the plugin on [Github](https://github.com/likecoin/nftpress) if you are a developer. == Installation == diff --git a/package-lock.json b/package-lock.json index 55d7f14e..5c66ecef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "likecoin-wordpress", + "name": "nftpress, "version": "3.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "likecoin-wordpress", + "name": "nftpress", "version": "3.3.0", "dependencies": { "@wordpress/api-fetch": "^6.1.3", diff --git a/package.json b/package.json index 5187622e..74fcedfc 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "likecoin-wordpress", + "name": "nftpress", "version": "3.3.0", "description": "", "engines": {