1 line
5.1 KiB
JavaScript
1 line
5.1 KiB
JavaScript
(()=>{"use strict";var e,t,r,n,o,s,a={626:(e,t,r)=>{function n(e){!function(e,t){{let e="Assertion failed";t&&(e=e+": "+t);const r=new Error(e);throw function(){const e=this||self;return e.traceAssertionsForTesting,e}().traceAssertionsForTesting&&console.warn(r.stack),r}}(0,e||"Unreachable code hit")}r.d(t,{Aw:()=>f});var o=class{constructor(){this.resolve_,this.reject_,this.isFulfilled_=!1,this.promise_=new Promise(((e,t)=>{this.resolve_=t=>{e(t),this.isFulfilled_=!0},this.reject_=e=>{t(e),this.isFulfilled_=!0}}))}get isFulfilled(){return this.isFulfilled_}set isFulfilled(e){n()}get promise(){return this.promise_}set promise(e){n()}get resolve(){return this.resolve_}set resolve(e){n()}get reject(){return this.reject_}set reject(e){n()}};let s=1;function a(){return s++}const i={};function c(e,t){const r=Array.prototype.slice.call(arguments,1),n=new o,s=e+"_"+a();return i[s]=n,chrome.send(e,[s].concat(r)),n.promise}const l={};window.cr=window.cr||{},window.cr.webUIResponse=function(e,t,r){const n=i[e];delete i[e],t?n.resolve(r):n.reject(r)},window.cr.webUIListenerCallback=function(e,t){const r=l[e];if(!r)return;const n=Array.prototype.slice.call(arguments,1);for(const e in r)r[e].apply(null,n)},window.loadTimeData;const u=window.chrome;let d,h;!function(e){e.AAD="aad",e.AAD_DEGRADED="aad_degraded",e.MSA="msa",e.MSA_DEGRADED="msa_degraded",e.ON_PREMISES="on_premises",e.NONE="none"}(d||(d={})),d.NONE,function(e){e.NONE="none",e.GOOGLE="google"}(h||(h={}));class f{static getActiveProfileInfo(){return c("getProfileInfo")}static getInactiveProfileInfo(){return c("getNonActiveProfiles")}static openSettingsForProfile(e){u.send("launchProfileSettings",[e])}static dismissProfilePreviousSignIn(){u.send("dismissPreviousSignIn")}static handleChangeProfilePictureLinkClicked(){u.send("handleChangePictureLinkClicked")}static openExtensionsForProfile(e){u.send("launchProfileExtensions",[e])}static openSystemSettingsForProfile(e){u.send("launchProfileSystemSettings",[e])}static openEdgeBarSettingsForProfile(e){u.send("launchProfileEdgeBarSettings",[e])}}},607:(e,t,r)=>{r.a(e,(async(e,t)=>{try{var n,o,s=r(914),a=r(626),i=e([s]);let c;function l(e){c.contentWindow.postMessage(e,"*")}function u(e){switch(e.name){case n.InitializePane:{const t=JSON.parse(e.details.stringValue);a.Aw.getActiveProfileInfo().then((e=>{const r={...t.userInfo,pictureUrl:e.iconUrl};l({message:o.InitializePane,publisherData:t.publisherInfo,userData:r,localCards:t.localCards})}));break}case n.CheckoutInProgress:"AutofillStart"===e.details.stringValue?l({message:o.AutofillStart}):"PaymentStart"===e.details.stringValue&&l({message:o.PaymentStart});break;case n.CheckoutSucceeded:l({message:o.CheckoutSucceeded});break;case n.CheckoutFailed:l({message:o.CheckoutFailed,reason:e.details.stringValue})}}function d(){const e=new s.s;e.updateLoadTimeData.addListener(u),s.h.getRemote().registerPage(e.$.bindNewPipeAndPassRemote())}function h(){if(s.h&&s.s){const e=document.getElementsByTagName("iframe");e&&e.length>0&&(c=e[0],window.onmessage=e=>{switch(e.data.message){case o.ReadyToProcess:s.h.getRemote().initializePane();break;case o.StartCheckout:s.h.getRemote().startCheckout(e.data.params);break;case o.UIEvent:s.h.getRemote().recordUIEvents(e.data.params.event)}},d())}}s=(i.then?(await i)():i)[0],function(e){e.InitializePane="InitializePane",e.CheckoutInProgress="CheckoutInProgress",e.CheckoutFailed="CheckoutFailed",e.CheckoutSucceeded="CheckoutSucceeded"}(n||(n={})),function(e){e.InitializePane="InitializePane",e.CheckoutFailed="CheckoutFailed",e.CheckoutSucceeded="CheckoutSucceeded",e.ReadyToProcess="ReadyToProcess",e.StartCheckout="StartCheckout",e.AutofillStart="AutofillStart",e.PaymentStart="PaymentStart",e.UIEvent="UIEvent"}(o||(o={})),h(),t()}catch(f){t(f)}}))},914:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{h:()=>e,s:()=>o});const{PageHandler:e,PageCallbackRouter:o}=await import("./wallet-buynow.mojom-webui.js");n()}catch(e){n(e)}}),1)}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return a[e](r,r.exports,c),r.exports}e="function"=
|