1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8338],{38338:function(e,r,t){t.d(r,{Z:function(){return h}});var n=t(34051),o=t.n(n),a=t(85893),s=t(67294),i=t(25386),l=t(65965),c=t(14008),u=t(65789),d=t(8460);function f(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function m(e,r,t,n,o,a,s){try{var i=e[a](s),l=i.value}catch(c){return void t(c)}i.done?r(l):Promise.resolve(l).then(n,o)}function p(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],s=!0,i=!1;try{for(t=t.call(e);!(s=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);s=!0);}catch(l){i=!0,o=l}finally{try{s||null==t.return||t.return()}finally{if(i)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"===typeof e)return f(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return f(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 h(e){var r=e.next,t=void 0!==r&&r,n=e.showRegister,f=void 0===n||n,h=e.showForgot,x=void 0===h||h,g=e.registerLink,v=void 0===g?"/sign-up":g,y=(0,s.useRef)(null),b=(0,s.useRef)(null),w="";sessionStorage.getItem("email")&&(w=sessionStorage.getItem("email"));var j=p((0,l.Z)(i.x4),2),N=j[0],k=N.loading,S=N.failed,O=N.completed,P=N.error,A=j[1],C=k||O,E=function(){var e,r=(e=o().mark((function e(r){var n,a,s,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.preventDefault(),n=y.current,a=b.current,s=n?n.value:"",i=a?a.value:"",s){e.next=8;break}return alert("Email is required"),e.abrupt("return",!1);case 8:if(i){e.next=11;break}return alert("Password is required"),e.abrupt("return",!1);case 11:if(!s.toLowerCase().endsWith("@kindle.com")){e.next=14;break}return alert("Use your personal email address. NOT your send-to-kindle email."),e.abrupt("return",!1);case 14:return sessionStorage.setItem("email",s),e.next=17,A(s,i,t);case 17:case"end":return e.stop()}}),e)})),function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function s(e){m(a,n,o,s,i,"next",e)}function i(e){m(a,n,o,s,i,"throw",e)}s(void 0)}))});return function(e){return r.apply(this,arguments)}}(),I=function(){t&&t.startsWith("/app")?window.location=t:window.location="premium"===t?"/app/pricing":"extension-onboarding"===t?"/extension/onboarding?stage=after-auth":"extension"===t?"/extension/success":"/app"},M="extension"===t,Z="extension-onboarding"===t;return(0,a.jsxs)("div",{className:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[(0,a.jsxs)("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[(0,a.jsx)("h2",{className:"mt-6 text-center text-3xl tracking-tight font-bold",children:"Sign in to your account"}),f&&(0,a.jsxs)("p",{className:"mt-2 text-center text-sm",children:["Or"," ",(0,a.jsx)("a",{href:v,className:"font-medium text-rose-600 hover:text-rose-500",children:"register for an account"})]})]}),(0,a.jsx)("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:(0,a.jsxs)("div",{className:"bg-white py-8 px-4 shadow-md md:shadow-xl sm:rounded-lg sm:px-8",children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsxs)("div",{className:"mb-6 grid grid-cols-3 gap-3",children:[(0,a.jsx)("div",{children:(0,a.jsx)(c.Z,{onSuccess:I})}),(0,a.jsx)("div",{children:(0,a.jsx)(u.Z,{forExtension:M,forExtensionOnboarding:Z})}),(0,a.jsx)("div",{children:(0,a.jsx)(d.Z,{onSuccess:I})})]})}),(0,a.jsxs)("div",{className:"relative mb-6",children:[(0,a.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,a.jsx)("div",{className:"w-full border-t border-gray-300"})}),(0,a.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,a.jsx)("span",{className:"px-2 bg-white text-gray-600",children:"OR"})})]}),(0,a.jsxs)("form",{className:"space-y-6",autoComplete:"off",action:"/api/sign-in",method:"POST",onSubmit:E,children:[S&&(0,a.jsx)("div",{className:"rounded-md bg-red-50 p-4",children:(0,a.jsx)("h3",{className:"text-sm font-medium text-red-500",children:P.message})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700",children:"Your personal email address (NOT @kindle.com)"}),(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)("input",{id:"email",name:"email",type:"email",ref:y,defaultValue:w,disabled:k,required:!0,className:"text-gray-800 appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700",children:"Password"}),(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)("input",{id:"password",name:"password",type:"password",ref:b,disabled:k,autoComplete:"current-password",min:8,minLength:8,required:!0,className:"text-gray-800 appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"})})]}),x&&(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsx)("div",{className:"text-sm",children:(0,a.jsx)("a",{href:"/forgot",className:"font-medium text-rose-600 hover:text-rose-500",children:"Forgot your password?"})})}),(0,a.jsx)("div",{children:C?(0,a.jsx)("button",{className:"w-full flex justify-center py-2 px-4 border border-transparent roun
1ded-md shadow-sm text-sm font-medium text-white bg-rose-600 hover:bg-rose-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:(0,a.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,a.jsx)("circle",{className:"opacity-25",cx:12,cy:12,r:10,stroke:"currentColor",strokeWidth:4}),(0,a.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,a.jsx)("button",{type:"submit",className:"w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-rose-600 hover:bg-rose-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:"Sign in"})})]})]})})]})}},8460:function(e,r,t){t.d(r,{Z:function(){return c}});var n=t(34051),o=t.n(n),a=t(85893),s=t(91259),i=t(87648);function l(e,r,t,n,o,a,s){try{var i=e[a](s),l=i.value}catch(c){return void t(c)}i.done?r(l):Promise.resolve(l).then(n,o)}function c(e){var r=e.onSuccess,t=function(){var e,t=(e=o().mark((function e(t){var n,a,l,c,u,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),n=(0,s.v0)(),e.prev=2,(a=new s.O4("apple.com")).addScope("email"),a.addScope("name"),e.next=8,(0,s.rh)(n,a);case 8:return l=e.sent,e.next=11,l.user.getIdToken();case 11:return c=e.sent,e.next=14,(0,i.B$)(c);case 14:r&&r(),e.next=25;break;case 17:e.prev=17,e.t0=e.catch(2),console.log(e.t0),u=e.t0.code,d=e.t0.message,console.log("errorCode",u),console.log("errorMessage",d),"auth/popup-blocked"===u?alert("Popup blocked. Please try again."):"auth/popup-closed-by-user"!==u&&alert("Error: ".concat(d));case 25:case"end":return e.stop()}}),e,null,[[2,17]])})),function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function s(e){l(a,n,o,s,i,"next",e)}function i(e){l(a,n,o,s,i,"throw",e)}s(void 0)}))});return function(e){return t.apply(this,arguments)}}();return(0,a.jsxs)("a",{href:"#",onClick:t,className:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-900 hover:bg-gray-50",children:[(0,a.jsx)("svg",{className:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",children:(0,a.jsx)("path",{d:"M25.565,9.785c-0.123,0.077-3.051,1.702-3.051,5.305c0.138,4.109,3.695,5.55,3.756,5.55 c-0.061,0.077-0.537,1.963-1.947,3.94C23.204,26.283,21.962,28,20.076,28c-1.794,0-2.438-1.135-4.508-1.135 c-2.223,0-2.852,1.135-4.554,1.135c-1.886,0-3.22-1.809-4.4-3.496c-1.533-2.208-2.836-5.673-2.882-9 c-0.031-1.763,0.307-3.496,1.165-4.968c1.211-2.055,3.373-3.45,5.734-3.496c1.809-0.061,3.419,1.242,4.523,1.242 c1.058,0,3.036-1.242,5.274-1.242C21.394,7.041,23.97,7.332,25.565,9.785z M15.001,6.688c-0.322-1.61,0.567-3.22,1.395-4.247 c1.058-1.242,2.729-2.085,4.17-2.085c0.092,1.61-0.491,3.189-1.533,4.339C18.098,5.937,16.488,6.872,15.001,6.688z"})}),(0,a.jsx)("span",{className:"ml-2 font-bold",children:"Apple"})]})}},14008:function(e,r,t){t.d(r,{Z:function(){return c}});var n=t(34051),o=t.n(n),a=t(85893),s=t(91259),i=t(87648);function l(e,r,t,n,o,a,s){try{var i=e[a](s),l=i.value}catch(c){return void t(c)}i.done?r(l):Promise.resolve(l).then(n,o)}function c(e){var r=e.onSuccess,t=function(){var e,t=(e=o().mark((function e(t){var n,a,l,c,u,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),n=(0,s.v0)(),e.prev=2,a=new s.hJ,e.next=6,(0,s.rh)(n,a);case 6:return l=e.sent,e.next=9,l.user.getIdToken();case 9:return c=e.sent,e.next=12,(0,i.B$)(c);case 12:r&&r(),e.next=23;break;case 15:e.prev=15,e.t0=e.catch(2),console.log(e.t0),u=e.t0.code,d=e.t0.message,console.log("errorCode",u),console.log("errorMessage",d),"auth/popup-blocked"===u?alert("Popup blocked. Please try again."):"auth/popup-closed-by-user"!==u&&alert("Error: ".concat(d));case 23:case"end":return e.stop()}}),e,null,[[2,15]])})),function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function s(e){l(a,n,o,s,i,"next",e)}function i(e){l(a,n,o,s,i,"throw",e)}s(void 0)}))});return function(e){return t.apply(this,arguments)}}();return(0,a.jsxs)("a",{href:"#",onClick:t,className:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-900 hover:bg-gray-50",children:[(0,a.jsx)("img",{className:"w-5 h-5",src:"/images/icon-google.png"}),(0,a.jsx)("span",{className:"ml-2 font-bold",children:"Google"})]})}},65789:function(e,r,t){t.d(r,{Z:function(){return a}});var n=t(85893),o=t(25386);function a(e){var r=e.forExtension,t=e.forExtensionOnboarding,a=(0,o.YM)();return t?a+="?redirect=/extension-onboarding":r&&(a+="?redirect=/extension"),(0,n.jsxs)("a",{href:a,className:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-twitter-blue hover:bg-gray-50",children:[(0,n.jsx)("svg",{className:"w-5 h-5","aria-hidden":"true",fill:"
1currentColor",viewBox:"0 0 20 20",children:(0,n.jsx)("path",{d:"M6.29 18.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0020 3.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.073 4.073 0 01.8 7.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 010 16.407a11.616 11.616 0 006.29 1.84"})}),(0,n.jsx)("span",{className:"ml-2",children:"Twitter"})]})}},65965:function(e,r,t){var n=t(34051),o=t.n(n),a=t(67294);function s(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function i(e,r,t,n,o,a,s){try{var i=e[a](s),l=i.value}catch(c){return void t(c)}i.done?r(l):Promise.resolve(l).then(n,o)}function l(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function s(e){i(a,n,o,s,l,"next",e)}function l(e){i(a,n,o,s,l,"throw",e)}s(void 0)}))}}function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function u(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],s=!0,i=!1;try{for(t=t.call(e);!(s=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);s=!0);}catch(l){i=!0,o=l}finally{try{s||null==t.return||t.return()}finally{if(i)throw o}}return a}}(e,r)||function(e,r){if(!e)return;if("string"===typeof e)return s(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(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.")}()}var d={result:null,error:null,loading:!1,completed:!1,failed:!1};function f(e,r){switch(r.type){case"started":return function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){c(e,r,t[r])}))}return e}({},d,{loading:!0});case"completed":return{result:r.payload,loading:!1,failed:!1,completed:!0};case"failed":return{error:r.payload,loading:!1,failed:!0,completed:!1};case"updated":var t;return"function"===typeof r.payload&&(t=r.payload(e.result)),{result:t,loading:!1,failed:!1,completed:!0};default:throw new Error}}r.Z=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.autorun,n=void 0!==t&&t,s=r.args,i=void 0===s?[]:s,c=r.onSuccess,m=r.onError,p=u(a.useReducer(f,d),2),h=p[0],x=p[1],g=function(){var r=l(o().mark((function r(){var t,n,a,s,l=arguments;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:for(t=l.length,n=new Array(t),a=0;a<t;a++)n[a]=l[a];return x({type:"started"}),r.prev=2,r.next=5,e.apply(null,null!==n&&void 0!==n?n:i);case 5:s=r.sent,c&&c(s),x({type:"completed",payload:s}),r.next=14;break;case 10:r.prev=10,r.t0=r.catch(2),m&&m(r.t0),x({type:"failed",payload:r.t0});case 14:case"end":return r.stop()}}),r,null,[[2,10]])})));return function(){return r.apply(this,arguments)}}(),v=function(e){x({type:"updated",payload:e})};return a.useEffect((function(){n&&g()}),[e]),[h,g,v]}}}]);
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.