@coding-blocks/web-components
Advanced tools
Comparing version 1.12.1 to 1.12.2
@@ -1,1 +0,1 @@ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).cbMobileVerification=n()}(this,(function(){"use strict";function t(){}function n(t){return t()}function o(){return Object.create(null)}function e(t){t.forEach(n)}function i(t){return"function"==typeof t}function c(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function l(t,n){t.appendChild(n)}function r(t,n,o){t.insertBefore(n,o||null)}function s(t){t.parentNode.removeChild(t)}function a(t){return document.createElement(t)}function d(t){return document.createTextNode(t)}function u(){return d(" ")}function p(t,n,o,e){return t.addEventListener(n,o,e),()=>t.removeEventListener(n,o,e)}function f(t,n,o){null==o?t.removeAttribute(n):t.getAttribute(n)!==o&&t.setAttribute(n,o)}function m(t){return""===t?null:+t}function h(t,n){t.value=null==n?"":n}function b(t){const n={};for(const o of t)n[o.name]=o.value;return n}let g;function y(t){g=t}function v(t){(function(){if(!g)throw new Error("Function called outside component initialization");return g})().$$.on_mount.push(t)}const w=[],k=[],$=[],x=[],_=Promise.resolve();let T=!1;function j(t){$.push(t)}const E=new Set;let M=0;function O(){const t=g;do{for(;M<w.length;){const t=w[M];M++,y(t),C(t.$$)}for(y(null),w.length=0,M=0;k.length;)k.pop()();for(let t=0;t<$.length;t+=1){const n=$[t];E.has(n)||(E.add(n),n())}$.length=0}while(w.length);for(;x.length;)x.pop()();T=!1,E.clear(),y(t)}function C(t){if(null!==t.fragment){t.update(),e(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(j)}}const L=new Set;const S="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function z(t,n){-1===t.$$.dirty[0]&&(w.push(t),T||(T=!0,_.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function A(c,l,r,a,d,u,p,f=[-1]){const m=g;y(c);const h=c.$$={fragment:null,ctx:null,props:u,update:t,not_equal:d,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l.context||(m?m.$$.context:[])),callbacks:o(),dirty:f,skip_bound:!1,root:l.target||m.$$.root};p&&p(h.root);let b=!1;if(h.ctx=r?r(c,l.props||{},(t,n,...o)=>{const e=o.length?o[0]:n;return h.ctx&&d(h.ctx[t],h.ctx[t]=e)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](e),b&&z(c,t)),n}):[],h.update(),b=!0,e(h.before_update),h.fragment=!!a&&a(h.ctx),l.target){if(l.hydrate){const t=function(t){return Array.from(t.childNodes)}(l.target);h.fragment&&h.fragment.l(t),t.forEach(s)}else h.fragment&&h.fragment.c();l.intro&&((v=c.$$.fragment)&&v.i&&(L.delete(v),v.i(w))),function(t,o,c,l){const{fragment:r,on_mount:s,on_destroy:a,after_update:d}=t.$$;r&&r.m(o,c),l||j(()=>{const o=s.map(n).filter(i);a?a.push(...o):e(o),t.$$.on_mount=[]}),d.forEach(j)}(c,l.target,l.anchor,l.customElement),O()}var v,w;y(m)}let N;"function"==typeof HTMLElement&&(N=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,n,o){this[t]=o}disconnectedCallback(){e(this.$$.on_disconnect)}$destroy(){!function(t,n){const o=t.$$;null!==o.fragment&&(e(o.on_destroy),o.fragment&&o.fragment.d(n),o.on_destroy=o.fragment=null,o.ctx=[])}(this,1),this.$destroy=t}$on(t,n){const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const{document:P}=S;function B(t){let n,o;return{c(){n=a("div"),o=d(t[3]),f(n,"class","red")},m(t,e){r(t,n,e),l(n,o)},p(t,n){8&n&&function(t,n){n=""+n,t.wholeText!==n&&(t.data=n)}(o,t[3])},d(t){t&&s(n)}}}function D(t){let n,o,i,c,l,d;function b(t,n){return t[5]?J:F}let g=b(t),y=g(t);return{c(){n=a("input"),o=u(),i=a("button"),y.c(),f(n,"type","number"),f(n,"placeholder","Enter 10 digit Mobile Number"),f(n,"class","w-100 mb-4"),f(i,"class","btn btn-primary w-100"),i.disabled=c=!t[0]},m(e,c){r(e,n,c),h(n,t[0]),r(e,o,c),r(e,i,c),y.m(i,null),l||(d=[p(n,"input",t[12]),p(i,"click",t[9])],l=!0)},p(t,o){1&o&&m(n.value)!==t[0]&&h(n,t[0]),g!==(g=b(t))&&(y.d(1),y=g(t),y&&(y.c(),y.m(i,null))),1&o&&c!==(c=!t[0])&&(i.disabled=c)},d(t){t&&s(n),t&&s(o),t&&s(i),y.d(),l=!1,e(d)}}}function H(t){let n,o,i,c,l,d;function b(t,n){return t[6]?R:V}let g=b(t),y=g(t);return{c(){n=a("input"),o=u(),i=a("button"),y.c(),f(n,"type","number"),f(n,"placeholder","Enter OTP"),f(n,"class","w-100 mb-4"),f(i,"class","btn btn-primary w-100"),i.disabled=c=!t[1]},m(e,c){r(e,n,c),h(n,t[1]),r(e,o,c),r(e,i,c),y.m(i,null),l||(d=[p(n,"input",t[11]),p(i,"click",t[10])],l=!0)},p(t,o){2&o&&m(n.value)!==t[1]&&h(n,t[1]),g!==(g=b(t))&&(y.d(1),y=g(t),y&&(y.c(),y.m(i,null))),2&o&&c!==(c=!t[1])&&(i.disabled=c)},d(t){t&&s(n),t&&s(o),t&&s(i),y.d(),l=!1,e(d)}}}function F(t){let n;return{c(){n=d("Send Otp")},m(t,o){r(t,n,o)},d(t){t&&s(n)}}}function J(t){let n;return{c(){n=d("Sending OTP")},m(t,o){r(t,n,o)},d(t){t&&s(n)}}}function V(t){let n;return{c(){n=d("Verify OTP")},m(t,o){r(t,n,o)},d(t){t&&s(n)}}}function R(t){let n;return{c(){n=d("Verifying OTP")},m(t,o){r(t,n,o)},d(t){t&&s(n)}}}function W(n){let o,e,i;return{c(){o=a("a"),e=a("button"),e.textContent="Logout",f(e,"class","btn btn-primary w-100 my-3"),f(o,"href",i=n[8].logout[n[7]])},m(t,n){r(t,o,n),l(o,e)},p:t,d(t){t&&s(o)}}}function q(n){let o,e,i,c,d,p,m,h,b,g,y,v,w,k,$,x,_,T=n[3]&&B(n);function j(t,n){return t[2]?H:D}let E=j(n),M=E(n),O=n[4]&&W(n);return{c(){o=a("link"),e=a("link"),i=a("link"),c=u(),d=a("div"),p=u(),m=a("div"),h=a("div"),h.innerHTML="<h2>Verify Your Mobile</h2>",b=u(),T&&T.c(),g=u(),M.c(),y=u(),O&&O.c(),v=u(),w=a("div"),w.innerHTML='<div class="header">Find your dream job</div> \n <div class="sub-header mb-4">Trusted by 100k+ students</div> \n <img src="https://minio.codingblocks.com/public/company-logo-group.png" alt=""/>',k=u(),$=a("div"),$.innerHTML='<a href="https://www.linkedin.com/school/codingblocksindia/" target="_blank"><img class="social-media-logo mr-2" src="https://minio.codingblocks.com/public/linkedin-logo.png" alt=""/></a> \n <a href="https://twitter.com/codingblocksIN" target="_blank"><img class="social-media-logo mr-2" src="https://minio.codingblocks.com/public/twitter-logo.png" alt=""/></a> \n <a href="https://github.com/coding-blocks" target="_blank"><img class="social-media-logo" src="https://minio.codingblocks.com/public/github-logo.png" alt=""/></a> \n <div><a href="https://codingblocks.com/tos.html" class="sub-header" target="_blank">Coding Blocks | Terms of service</a></div>',x=u(),_=a("link"),this.c=t,f(o,"rel","preconnect"),f(o,"href","https://fonts.googleapis.com"),f(e,"rel","preconnect"),f(e,"href","https://fonts.gstatic.com"),f(e,"crossorigin",""),f(i,"href","https://fonts.googleapis.com/css2?family=Mulish:wght@400;600&display=swap"),f(i,"rel","stylesheet"),f(d,"class","blurrer"),f(h,"class","d-flex justify-content-between align-items-center mb-5"),f(w,"class","mb-5 pt-5"),f($,"class","position-absolute"),f(m,"id","cb-mobile-verification"),f(m,"class","cb-mobile-verification-container"),f(_,"rel","stylesheet"),f(_,"href","https://unpkg.com/@coding-blocks/motley@2.8.6/dist/account/app.min.css")},m(t,n){l(P.head,o),l(P.head,e),l(P.head,i),r(t,c,n),r(t,d,n),r(t,p,n),r(t,m,n),l(m,h),l(m,b),T&&T.m(m,null),l(m,g),M.m(m,null),l(m,y),O&&O.m(m,null),l(m,v),l(m,w),l(m,k),l(m,$),r(t,x,n),r(t,_,n)},p(t,[n]){t[3]?T?T.p(t,n):(T=B(t),T.c(),T.m(m,g)):T&&(T.d(1),T=null),E===(E=j(t))&&M?M.p(t,n):(M.d(1),M=E(t),M&&(M.c(),M.m(m,y))),t[4]?O?O.p(t,n):(O=W(t),O.c(),O.m(m,v)):O&&(O.d(1),O=null)},i:t,o:t,d(t){s(o),s(e),s(i),t&&s(c),t&&s(d),t&&s(p),t&&s(m),T&&T.d(),M.d(),O&&O.d(),t&&s(x),t&&s(_)}}}function I(t,n,o){let e=null;const i=window.location.host.split(".")[0],c={sendOtpMobile:{hack:"https://hack-api.codingblocks.com/api/v2/jwt/otp",online:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile",subscribe:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile",hire:"https://hire-api.codingblocks.com/login/otp/mobile","code-gym":"https://code-gym-api.codingblocks.com/api/jwt/otp"},verifyOtpMobile:{hack:"https://hack-api.codingblocks.com/api/v2/jwt/otp/verify",online:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile/verify",subscribe:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile/verify",hire:"https://hire-api.codingblocks.com/login/otp/mobile/verify","code-gym":"https://code-gym-api.codingblocks.com/api/jwt/otp/verify"},logout:{hack:"/app/logout",online:"/app/logout",subscribe:"/app/logout",hire:"/logout","code-gym":"/logout"}};let l=null,r=null,s=null,a=null,d=!1,u=!1,p=!1;return v(()=>{e=document.cookie.split("; ").filter(t=>"cb_auth"===t.split("=")[0])[0].split("=")[1]}),[l,r,s,a,d,u,p,i,c,async function(){o(5,u=!0);const t=await fetch(c.sendOtpMobile[i]+"?flow=mobile-verification"||"http://localhost:3000/api/jwt/otp",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"JWT "+e},body:JSON.stringify({mobile:l})});if(t.ok){o(5,u=!1);let{id:n,Details:e}=await t.json();o(2,s=n||e)}else{o(5,u=!1);const{message:n,Details:e}=await t.json();(n||e)&&(o(3,a=n||e),n.includes("Try logging in with that account.")&&o(4,d=!0))}},async function(){o(3,a=null),o(6,p=!0);const t=await fetch(c.verifyOtpMobile[i]+"?flow=mobile-verification"||"http://localhost:3000/api/jwt/otp/verify",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"JWT "+e},credentials:"include",body:JSON.stringify({mobile:l,otp_id:s,otp:r})});if(t.ok)o(6,p=!1),window.location.reload();else{o(6,p=!1);const{message:n,Details:e}=await t.json();(n||e)&&o(3,a=n||e)}},function(){r=m(this.value),o(1,r)},function(){l=m(this.value),o(0,l)}]}class Y extends N{constructor(t){super(),this.shadowRoot.innerHTML="<style>input{border:none;border-bottom:solid 1px #E95547;background:#15171E;padding:10px 0px}.blurrer{position:fixed;z-index:1000;top:0;left:0;width:100vw;height:100vh;background-color:#939393;opacity:0.5}.cb-mobile-verification-container{background:#15171E;color:white;width:100vw;min-height:100vh;position:fixed;z-index:1001;top:0;right:0;padding:5rem 3rem 3rem 3rem;font-family:'Mulish';transition:0.5s}:host(.hide-cb-mobile-verification-prompt) .cb-mobile-verification-container{right:-100vw}:host(.hide-cb-mobile-verification-prompt) .blurrer{display:none}@media screen and (min-width: 768px){.cb-mobile-verification-container{width:35vw}:host(.hide-cb-mobile-verification-prompt) .cb-mobile-verification-container{right:-35vw}}.btn{padding:10px 10px;border-radius:3px}.btn.btn-primary{background:linear-gradient(90deg, #F26A3E 0%, #FB8133 100%)}.btn:disabled{background:#939393}.header{font-size:20px}.sub-header{font-size:12px;color:#BDBDBD}.social-media-logo{width:15px}@keyframes dots{25%{content:'.'}50%{content:'..'}75%{content:'...'}100%{content:''}}</style>",A(this,{target:this.shadowRoot,props:b(this.attributes),customElement:!0},I,q,c,{},null),t&&t.target&&r(t.target,this,t.anchor)}}return customElements.define("cb-mobile-verification",Y),Y})); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).cbMobileVerification=n()}(this,(function(){"use strict";function t(){}function n(t){return t()}function o(){return Object.create(null)}function e(t){t.forEach(n)}function i(t){return"function"==typeof t}function c(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function l(t,n){t.appendChild(n)}function r(t,n,o){t.insertBefore(n,o||null)}function s(t){t.parentNode.removeChild(t)}function a(t){return document.createElement(t)}function d(t){return document.createTextNode(t)}function u(){return d(" ")}function p(t,n,o,e){return t.addEventListener(n,o,e),()=>t.removeEventListener(n,o,e)}function f(t,n,o){null==o?t.removeAttribute(n):t.getAttribute(n)!==o&&t.setAttribute(n,o)}function m(t){return""===t?null:+t}function h(t,n){t.value=null==n?"":n}function b(t){const n={};for(const o of t)n[o.name]=o.value;return n}let g;function y(t){g=t}function w(t){(function(){if(!g)throw new Error("Function called outside component initialization");return g})().$$.on_mount.push(t)}const v=[],k=[],$=[],x=[],_=Promise.resolve();let T=!1;function j(t){$.push(t)}const E=new Set;let M=0;function O(){const t=g;do{for(;M<v.length;){const t=v[M];M++,y(t),C(t.$$)}for(y(null),v.length=0,M=0;k.length;)k.pop()();for(let t=0;t<$.length;t+=1){const n=$[t];E.has(n)||(E.add(n),n())}$.length=0}while(v.length);for(;x.length;)x.pop()();T=!1,E.clear(),y(t)}function C(t){if(null!==t.fragment){t.update(),e(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(j)}}const L=new Set;const S="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function z(t,n){-1===t.$$.dirty[0]&&(v.push(t),T||(T=!0,_.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function A(c,l,r,a,d,u,p,f=[-1]){const m=g;y(c);const h=c.$$={fragment:null,ctx:null,props:u,update:t,not_equal:d,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l.context||(m?m.$$.context:[])),callbacks:o(),dirty:f,skip_bound:!1,root:l.target||m.$$.root};p&&p(h.root);let b=!1;if(h.ctx=r?r(c,l.props||{},(t,n,...o)=>{const e=o.length?o[0]:n;return h.ctx&&d(h.ctx[t],h.ctx[t]=e)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](e),b&&z(c,t)),n}):[],h.update(),b=!0,e(h.before_update),h.fragment=!!a&&a(h.ctx),l.target){if(l.hydrate){const t=function(t){return Array.from(t.childNodes)}(l.target);h.fragment&&h.fragment.l(t),t.forEach(s)}else h.fragment&&h.fragment.c();l.intro&&((w=c.$$.fragment)&&w.i&&(L.delete(w),w.i(v))),function(t,o,c,l){const{fragment:r,on_mount:s,on_destroy:a,after_update:d}=t.$$;r&&r.m(o,c),l||j(()=>{const o=s.map(n).filter(i);a?a.push(...o):e(o),t.$$.on_mount=[]}),d.forEach(j)}(c,l.target,l.anchor,l.customElement),O()}var w,v;y(m)}let N;"function"==typeof HTMLElement&&(N=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,n,o){this[t]=o}disconnectedCallback(){e(this.$$.on_disconnect)}$destroy(){!function(t,n){const o=t.$$;null!==o.fragment&&(e(o.on_destroy),o.fragment&&o.fragment.d(n),o.on_destroy=o.fragment=null,o.ctx=[])}(this,1),this.$destroy=t}$on(t,n){const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const{document:P}=S;function B(t){let n,o;return{c(){n=a("div"),o=d(t[3]),f(n,"class","red")},m(t,e){r(t,n,e),l(n,o)},p(t,n){8&n&&function(t,n){n=""+n,t.wholeText!==n&&(t.data=n)}(o,t[3])},d(t){t&&s(n)}}}function D(t){let n,o,i,c,l,d,b;function g(t,n){return t[5]?J:F}let y=g(t),w=y(t);return{c(){n=a("input"),o=u(),i=a("button"),w.c(),f(n,"type","number"),f(n,"placeholder","Enter 10 digit Mobile Number"),f(n,"class","w-100 mb-4"),f(i,"class",c="btn btn-primary w-100 "+(t[5]?"dot-loader":"")),i.disabled=l=!t[0]},m(e,c){r(e,n,c),h(n,t[0]),r(e,o,c),r(e,i,c),w.m(i,null),d||(b=[p(n,"input",t[12]),p(i,"click",t[9])],d=!0)},p(t,o){1&o&&m(n.value)!==t[0]&&h(n,t[0]),y!==(y=g(t))&&(w.d(1),w=y(t),w&&(w.c(),w.m(i,null))),32&o&&c!==(c="btn btn-primary w-100 "+(t[5]?"dot-loader":""))&&f(i,"class",c),1&o&&l!==(l=!t[0])&&(i.disabled=l)},d(t){t&&s(n),t&&s(o),t&&s(i),w.d(),d=!1,e(b)}}}function H(t){let n,o,i,c,l,d,b;function g(t,n){return t[6]?R:V}let y=g(t),w=y(t);return{c(){n=a("input"),o=u(),i=a("button"),w.c(),f(n,"type","number"),f(n,"placeholder","Enter OTP"),f(n,"class","w-100 mb-4"),f(i,"class",c="btn btn-primary w-100 "+(t[6]?"dot-loader":"")),i.disabled=l=!t[1]},m(e,c){r(e,n,c),h(n,t[1]),r(e,o,c),r(e,i,c),w.m(i,null),d||(b=[p(n,"input",t[11]),p(i,"click",t[10])],d=!0)},p(t,o){2&o&&m(n.value)!==t[1]&&h(n,t[1]),y!==(y=g(t))&&(w.d(1),w=y(t),w&&(w.c(),w.m(i,null))),64&o&&c!==(c="btn btn-primary w-100 "+(t[6]?"dot-loader":""))&&f(i,"class",c),2&o&&l!==(l=!t[1])&&(i.disabled=l)},d(t){t&&s(n),t&&s(o),t&&s(i),w.d(),d=!1,e(b)}}}function F(t){let n;return{c(){n=d("Send Otp")},m(t,o){r(t,n,o)},d(t){t&&s(n)}}}function J(t){let n;return{c(){n=d("Sending OTP")},m(t,o){r(t,n,o)},d(t){t&&s(n)}}}function V(t){let n;return{c(){n=d("Verify OTP")},m(t,o){r(t,n,o)},d(t){t&&s(n)}}}function R(t){let n;return{c(){n=d("Verifying OTP")},m(t,o){r(t,n,o)},d(t){t&&s(n)}}}function W(n){let o,e,i;return{c(){o=a("a"),e=a("button"),e.textContent="Logout",f(e,"class","btn btn-primary w-100 my-3"),f(o,"href",i=n[8].logout[n[7]])},m(t,n){r(t,o,n),l(o,e)},p:t,d(t){t&&s(o)}}}function q(n){let o,e,i,c,d,p,m,h,b,g,y,w,v,k,$,x,_,T=n[3]&&B(n);function j(t,n){return t[2]?H:D}let E=j(n),M=E(n),O=n[4]&&W(n);return{c(){o=a("link"),e=a("link"),i=a("link"),c=u(),d=a("div"),p=u(),m=a("div"),h=a("div"),h.innerHTML="<h2>Verify Your Mobile</h2>",b=u(),T&&T.c(),g=u(),M.c(),y=u(),O&&O.c(),w=u(),v=a("div"),v.innerHTML='<div class="header">Find your dream job</div> \n <div class="sub-header mb-4">Trusted by 100k+ students</div> \n <img src="https://minio.codingblocks.com/public/company-logo-group.png" alt=""/>',k=u(),$=a("div"),$.innerHTML='<a href="https://www.linkedin.com/school/codingblocksindia/" target="_blank"><img class="social-media-logo mr-2" src="https://minio.codingblocks.com/public/linkedin-logo.png" alt=""/></a> \n <a href="https://twitter.com/codingblocksIN" target="_blank"><img class="social-media-logo mr-2" src="https://minio.codingblocks.com/public/twitter-logo.png" alt=""/></a> \n <a href="https://github.com/coding-blocks" target="_blank"><img class="social-media-logo" src="https://minio.codingblocks.com/public/github-logo.png" alt=""/></a> \n <div><a href="https://codingblocks.com/tos.html" class="sub-header" target="_blank">Coding Blocks | Terms of service</a></div>',x=u(),_=a("link"),this.c=t,f(o,"rel","preconnect"),f(o,"href","https://fonts.googleapis.com"),f(e,"rel","preconnect"),f(e,"href","https://fonts.gstatic.com"),f(e,"crossorigin",""),f(i,"href","https://fonts.googleapis.com/css2?family=Mulish:wght@400;600&display=swap"),f(i,"rel","stylesheet"),f(d,"class","blurrer"),f(h,"class","d-flex justify-content-between align-items-center mb-5"),f(v,"class","mb-5 pt-5"),f($,"class","position-absolute"),f(m,"id","cb-mobile-verification"),f(m,"class","cb-mobile-verification-container"),f(_,"rel","stylesheet"),f(_,"href","https://unpkg.com/@coding-blocks/motley@2.8.6/dist/account/app.min.css")},m(t,n){l(P.head,o),l(P.head,e),l(P.head,i),r(t,c,n),r(t,d,n),r(t,p,n),r(t,m,n),l(m,h),l(m,b),T&&T.m(m,null),l(m,g),M.m(m,null),l(m,y),O&&O.m(m,null),l(m,w),l(m,v),l(m,k),l(m,$),r(t,x,n),r(t,_,n)},p(t,[n]){t[3]?T?T.p(t,n):(T=B(t),T.c(),T.m(m,g)):T&&(T.d(1),T=null),E===(E=j(t))&&M?M.p(t,n):(M.d(1),M=E(t),M&&(M.c(),M.m(m,y))),t[4]?O?O.p(t,n):(O=W(t),O.c(),O.m(m,w)):O&&(O.d(1),O=null)},i:t,o:t,d(t){s(o),s(e),s(i),t&&s(c),t&&s(d),t&&s(p),t&&s(m),T&&T.d(),M.d(),O&&O.d(),t&&s(x),t&&s(_)}}}function I(t,n,o){let e=null;const i=window.location.host.split(".")[0],c={sendOtpMobile:{hack:"https://hack-api.codingblocks.com/api/v2/jwt/otp",online:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile",subscribe:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile",hire:"https://hire-api.codingblocks.com/login/otp/mobile","code-gym":"https://code-gym-api.codingblocks.com/api/jwt/otp"},verifyOtpMobile:{hack:"https://hack-api.codingblocks.com/api/v2/jwt/otp/verify",online:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile/verify",subscribe:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile/verify",hire:"https://hire-api.codingblocks.com/login/otp/mobile/verify","code-gym":"https://code-gym-api.codingblocks.com/api/jwt/otp/verify"},logout:{hack:"/app/logout",online:"/app/logout",subscribe:"/app/logout",hire:"/logout","code-gym":"/logout"}};let l=null,r=null,s=null,a=null,d=!1,u=!1,p=!1;return w(()=>{e=document.cookie.split("; ").filter(t=>"cb_auth"===t.split("=")[0])[0].split("=")[1]}),[l,r,s,a,d,u,p,i,c,async function(){o(5,u=!0);const t=await fetch(c.sendOtpMobile[i]+"?flow=mobile-verification"||"http://localhost:3000/api/jwt/otp",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"JWT "+e},body:JSON.stringify({mobile:l})});if(t.ok){o(5,u=!1);let{id:n,Details:e}=await t.json();o(2,s=n||e)}else{o(5,u=!1);const{message:n,Details:e}=await t.json();(n||e)&&(o(3,a=n||e),n.includes("Try logging in with that account.")&&o(4,d=!0))}},async function(){o(3,a=null),o(6,p=!0);const t=await fetch(c.verifyOtpMobile[i]+"?flow=mobile-verification"||"http://localhost:3000/api/jwt/otp/verify",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"JWT "+e},credentials:"include",body:JSON.stringify({mobile:l,otp_id:s,otp:r})});if(t.ok)o(6,p=!1),window.location.reload();else{o(6,p=!1);const{message:n,Details:e}=await t.json();(n||e)&&o(3,a=n||e)}},function(){r=m(this.value),o(1,r)},function(){l=m(this.value),o(0,l)}]}class Y extends N{constructor(t){super(),this.shadowRoot.innerHTML="<style>input{border:none;border-bottom:solid 1px #E95547;background:#15171E;padding:10px 0px}.blurrer{position:fixed;z-index:1000;top:0;left:0;width:100vw;height:100vh;background-color:#939393;opacity:0.5}.cb-mobile-verification-container{background:#15171E;color:white;width:100vw;min-height:100vh;position:fixed;z-index:1001;top:0;right:0;padding:5rem 3rem 3rem 3rem;font-family:'Mulish';transition:0.5s}:host(.hide-cb-mobile-verification-prompt) .cb-mobile-verification-container{right:-100vw}:host(.hide-cb-mobile-verification-prompt) .blurrer{display:none}@media screen and (min-width: 768px){.cb-mobile-verification-container{width:35vw}:host(.hide-cb-mobile-verification-prompt) .cb-mobile-verification-container{right:-35vw}}.btn{padding:10px 10px;border-radius:3px}.btn.btn-primary{background:linear-gradient(90deg, #F26A3E 0%, #FB8133 100%)}.btn:disabled{background:#939393}.header{font-size:20px}.sub-header{font-size:12px;color:#BDBDBD}.social-media-logo{width:15px}.dot-loader::after{animation:dots 3s linear infinite;content:''}@keyframes dots{25%{content:'.'}50%{content:'..'}75%{content:'...'}100%{content:''}}</style>",A(this,{target:this.shadowRoot,props:b(this.attributes),customElement:!0},I,q,c,{},null),t&&t.target&&r(t.target,this,t.anchor)}}return customElements.define("cb-mobile-verification",Y),Y})); |
@@ -5,3 +5,3 @@ { | ||
"outDir": "dist/", | ||
"version": "1.12.1", | ||
"version": "1.12.2", | ||
"main": "dist/index.js", | ||
@@ -8,0 +8,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
183910
562