import{h}from"@stencil/core";import{__,sprintf}from"@wordpress/i18n";export class ScPaymentMethodDetails{constructor(){this.paymentMethod=void 0,this.editHandler=void 0}render(){var t,e,o,i,n,d,a,l,r,s;return h("sc-card",null,h("sc-flex",{alignItems:"center",justifyContent:"flex-start",style:{gap:"0.5em"}},h("sc-payment-method",{paymentMethod:this.paymentMethod}),h("div",null,!!(null===(e=null===(t=this.paymentMethod)||void 0===t?void 0:t.card)||void 0===e?void 0:e.exp_month)&&h("span",null, // Translators: %d/%d is month and year of expiration. sprintf(__("Exp. %d/%d","surecart"),null===(i=null===(o=this.paymentMethod)||void 0===o?void 0:o.card)||void 0===i?void 0:i.exp_month,null===(d=null===(n=this.paymentMethod)||void 0===n?void 0:n.card)||void 0===d?void 0:d.exp_year)),!!(null===(l=null===(a=this.paymentMethod)||void 0===a?void 0:a.paypal_account)||void 0===l?void 0:l.email)&&(null===(s=null===(r=this.paymentMethod)||void 0===r?void 0:r.paypal_account)||void 0===s?void 0:s.email)),h("sc-button",{type:"text",circle:!0,onClick:this.editHandler},h("sc-icon",{name:"edit-2"}))))}static get is(){return"sc-payment-method-details"}static get encapsulation(){return"shadow"}static get properties(){return{paymentMethod:{type:"unknown",mutable:!1,complexType:{original:"PaymentMethod",resolved:"PaymentMethod",references:{PaymentMethod:{location:"import",path:"../../../types"}}},required:!1,optional:!1,docs:{tags:[],text:""}},editHandler:{type:"unknown",mutable:!1,complexType:{original:"() => void",resolved:"() => void",references:{}},required:!1,optional:!1,docs:{tags:[],text:""}}}}}/** * AJAX Request Queue * * - add() * - remove() * - run() * - stop() * * @since 1.0.0 */ var AstraSitesAjaxQueue = ( function () { var requests = []; return { /** * Add AJAX request * * @since 1.0.0 */ add: function ( opt ) { requests.push( opt ); }, /** * Remove AJAX request * * @since 1.0.0 */ remove: function ( opt ) { if ( jQuery.inArray( opt, requests ) > -1 ) requests.splice( $.inArray( opt, requests ), 1 ); }, /** * Run / Process AJAX request * * @since 1.0.0 */ run: function () { var self = this, oriSuc; if ( requests.length ) { oriSuc = requests[ 0 ].complete; requests[ 0 ].complete = function () { if ( typeof oriSuc === 'function' ) oriSuc(); requests.shift(); self.run.apply( self, [] ); }; jQuery.ajax( requests[ 0 ] ); } else { self.tid = setTimeout( function () { self.run.apply( self, [] ); }, 1000 ); } }, /** * Stop AJAX request * * @since 1.0.0 */ stop: function () { requests = []; clearTimeout( this.tid ); }, }; } )(); ( function ( $ ) { $elscope = {}; $.fn.isInViewport = function () { // If not have the element then return false! if ( ! $( this ).length ) { return false; } var elementTop = $( this ).offset().top; var elementBottom = elementTop + $( this ).outerHeight(); var viewportTop = $( window ).scrollTop(); var viewportBottom = viewportTop + $( window ).height(); return elementBottom > viewportTop && elementTop < viewportBottom; }; AstraElementorSitesAdmin = { visited_pages: [], reset_remaining_posts: 0, site_imported_data: null, backup_taken: false, templateData: {}, insertData: {}, log_file: '', pages_list: '', insertActionFlag: false, page_id: '', site_id: '', block_id: '', requiredPlugins: [], canImport: false, canInsert: false, type: 'pages', action: '', masonryObj: [], index: 0, blockCategory: '', blockColor: '', processing: false, siteType: '', page: 1, per_page: 20, init: function () { this._bind(); }, /** * Binds events for the Astra Sites. * * @since 1.0.0 * @access private * @method _bind */ _bind: function () { if ( elementorCommon ) { let add_section_tmpl = $( '#tmpl-elementor-add-section' ); if ( add_section_tmpl.length > 0 ) { let action_for_add_section = add_section_tmpl.text(); let white_label_class = ''; let stylesheet = ''; if ( astraElementorSites.isWhiteLabeled ) { white_label_class = ' ast-elementor-white-label'; stylesheet = '"; } action_for_add_section = action_for_add_section.replace( '