1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5973],{2522:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/settings/newsletter",function(){return n(13518)}])},13518:function(e,r,n){"use strict";n.r(r),n.d(r,{default:function(){return C}});var t=n(85893),s=n(67294),a=(n(11163),n(24240)),l=n(64552),i=n(9938),d=n(75321),o=n(34051),c=n.n(o),u=n(94184),m=n.n(u),x=n(75012),f=n(40486),h=n(20640),p=n.n(h),g=n(65965),y=n(25386),b=n(27713);function v(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function j(e,r,n,t,s,a,l){try{var i=e[a](l),d=i.value}catch(o){return void n(o)}i.done?r(d):Promise.resolve(d).then(t,s)}function w(e){return function(){var r=this,n=arguments;return new Promise((function(t,s){var a=e.apply(r,n);function l(e){j(a,t,s,l,i,"next",e)}function i(e){j(a,t,s,l,i,"throw",e)}l(void 0)}))}}function N(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var t,s,a=[],l=!0,i=!1;try{for(n=n.call(e);!(l=(t=n.next()).done)&&(a.push(t.value),!r||a.length!==r);l=!0);}catch(d){i=!0,s=d}finally{try{l||null==n.return||n.return()}finally{if(i)throw s}}return a}}(e,r)||function(e,r){if(!e)return;if("string"===typeof e)return v(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.filter(Boolean).join(" ")}var E=[{label:"Send directly to Kindle",value:"instant"},{label:"Add to Daily Read",value:"daily"},{label:"Add to Weekly Read",value:"weekly"}];function S(e){return _.apply(this,arguments)}function _(){return(_=w(c().mark((function e(r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,y.u7)("newsletterDefaultDeliveryType",r);case 2:return e.abrupt("return",r);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(){var e=(0,b.PR)(),r=null===e||void 0===e?void 0:e.uniqueKToolUsername,n="".concat(r,"@inbox.ktool.io"),a=(0,s.useState)(!1),l=a[0],i=a[1],d=(0,s.useState)(),o=d[0],c=d[1],u=function(e){switch(e){case"daily":return"added to your Daily Read";case"weekly":return"added to your Weekly Read";default:return"sent directly to your Kindle"}}(o),h=N((0,g.Z)(y.JM,{autorun:!0,onSuccess:function(e){c(e.newsletterDefaultDeliveryType)}}),1)[0],v=N((0,g.Z)(S,{autorun:!1}),2),j=v[0],w=v[1],_=j.failed,A=j.loading,C=j.error,T=j.completed;return(0,t.jsx)("section",{children:(0,t.jsx)("form",{action:"#",method:"POST",disabled:A,onSubmit:function(e){e.preventDefault(),w(o)},children:(0,t.jsxs)("div",{className:"shadow sm:overflow-hidden sm:rounded-md shadow dark:shadow-gray-700 dark:ring-1 dark:ring-gray-700 sm:overflow-hidden sm:rounded-md",children:[(0,t.jsxs)("div",{className:"bg-white dark:bg-gray-800 py-6 px-4 sm:p-6",children:[(0,t.jsx)("div",{children:(0,t.jsx)("h2",{className:"text-xl font-medium leading-6",children:"Newsletter"})}),(0,t.jsx)("div",{className:"mt-2 flex flex-col lg:flex-row",children:(0,t.jsxs)("div",{className:"w-full space-y-6",children:[_&&(0,t.jsx)("div",{className:"sm:max-w-md rounded-md bg-red-50 border-red-800 border p-4 mt-2",children:(0,t.jsx)("div",{className:"ml-3",children:(0,t.jsx)("p",{className:"text-sm font-medium text-red-800",children:C.message})})}),T&&!_&&(0,t.jsx)("div",{className:"sm:max-w-md rounded-md bg-green-50 border-green-800 border p-4 mt-4",children:(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)(x.Z,{className:"h-5 w-5 text-green-400","aria-hidden":"true"})}),(0,t.jsx)("div",{className:"ml-3",children:(0,t.jsx)("p",{className:"text-sm font-medium text-green-800",children:"Successfully saved"})})]})}),(0,t.jsxs)("div",{className:"mt-4 sm:max-w-md ",children:[(0,t.jsx)("label",{htmlFor:"uniqueAddress",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Your personal inbox mail"}),(0,t.jsxs)("div",{className:"flex rounded shadow-sm mt-1",children:[(0,t.jsx)("input",{type:"text",name:"personalEmail",id:"personalEmail",value:n,readOnly:!0,required:!0,className:m()("shadow-sm focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-900 text-gray-500 dark:text-gray-100 block w-full sm:text-sm mr-0 rounded-none rounded-l-md",{"border-gray-300 dark:border-gray-700":!_},{"border-red-300":_}),placeholder:"Enter everything before the @ symbol"}),(0,t.jsx)("button",{type:"button",onClick:function(){p()(n),i(!0)},className:"-ml-px relative inline-flex items-center space-x-2 px-4 py-2 border border-gray-400 dark:border-gray-700 shadow-sm text-sm font-medium rounded-r-md focus:outline-none ring-0",children:l?"Copied":"Copy"})]})]}),(0,t.jsxs)("div",{className:"mt-4 relative -space-y-px rounded-md",children:[(0,t.jsxs)("label",{htmlFor:"deliveryType",className:"mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300",children:["When an email sent to"," ",(0,t.jsx)("span",{className:"font-semibold",children:n}),", perform the following action:"]}),(0,t.jsxs)(f.E,{className:"sm:max-w-md",id:"deliveryType",value:o,onChange:c,children:[(0,t.jsxs)(f.E.Label,{className:"sr-only",children:[" ","Target"," "]}),E.map((function(e,r){return(0,t.jsx)(f.E.Option,{value:e.value,className:function(e){var n=e.checked;return k(0===r?"rounded-tl-md rounded-tr-md":"",r===E.length-1?"rounded-bl-md rounded-br-md":"",n?"bg-rose-50 border-rose-200 z-10":"border-gray-200","relative border p-4 flex flex-col cursor-pointer md:pl-4 md:pr-6 focus:outline-none")},children:function(r){var n=r.active,s=r.checked;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("span",{className:"flex items-center text-sm",children:[(0,t.jsx)("span",{className:k(s?"bg-rose-500 border-transparent":"bg-white border-gray-300",n?"ring-2 ring-offset-2 ring-gray-900":"","h-4 w-4 roun
1ded-full border flex items-center justify-center"),"aria-hidden":"true",children:(0,t.jsx)("span",{className:"rounded-full bg-white w-1.5 h-1.5"})}),(0,t.jsx)(f.E.Label,{as:"span",className:"ml-3 font-medium text-gray-900",children:e.label})]})})}},e.value)}))]})]}),h.completed&&(0,t.jsxs)("div",{className:"mt-4 text-sm",children:["\ud83d\udc49 Emails sent to ",n," will be"," ",(0,t.jsx)("span",{className:"font-semibold",children:u})]})]})})]}),(0,t.jsx)("div",{className:"bg-gray-50 dark:bg-gray-900 px-4 py-3 text-left sm:px-6",children:A?(0,t.jsx)("button",{className:"inline-flex justify-center rounded-md border border-transparent bg-rose-600 disabled:bg-gray-800 py-2 px-6 text-sm font-medium text-white shadow-sm hover:bg-rose-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",children:(0,t.jsxs)("svg",{className:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:12,cy:12,r:10,stroke:"currentColor",strokeWidth:4}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):(0,t.jsx)("button",{type:"submit",className:"inline-flex justify-center rounded-md border border-transparent bg-rose-600 disabled:bg-gray-800 py-2 px-6 text-sm font-medium text-white shadow-sm hover:bg-rose-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",children:"Save"})})]})})})}function C(){return(0,t.jsxs)(a.Z,{children:[(0,t.jsx)(l.Z,{}),(0,t.jsxs)("main",{className:"grow min-h-screen",children:[(0,t.jsx)("div",{className:"relative max-w-6xl mx-auto h-0 pointer-events-none -z-1","aria-hidden":"true",children:(0,t.jsx)(i.Z,{})}),(0,t.jsx)("section",{children:(0,t.jsx)("div",{className:"max-w-6xl mx-auto",children:(0,t.jsx)("div",{className:"py-10 md:py-12 border-t border-gray-200 dark:border-gray-800",children:(0,t.jsx)("div",{className:"h-full",children:(0,t.jsx)("main",{className:"mx-auto max-w-6xl pb-10 lg:py-12 lg:px-8",children:(0,t.jsxs)("div",{className:"lg:grid lg:grid-cols-12 lg:gap-x-5",children:[(0,t.jsx)("aside",{className:"py-6 px-2 sm:px-6 lg:col-span-3 lg:py-0 lg:px-0",children:(0,t.jsx)(d.Z,{navItem:"newsletter"})}),(0,t.jsx)("div",{className:"space-y-6 sm:px-6 lg:col-span-9 lg:px-0",children:(0,t.jsx)(A,{})})]})})})})})})]})]})}}},function(e){e.O(0,[4510,1833,2737,4494,9734,2499,5062,5278,453,5386,8338,4263,8372,9774,2888,179],(function(){return r=2522,e(e.s=r);var r}));var r=e.O();_N_E=r}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.