vendor: 5,578 bytes, lines 1-2
1/*! For license information please see credit-cards.87ee1a170e5fbece683d.js.LICENSE.txt */ 2"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[3422],{9418(e,t,r){r.r(t);var n,a,i,o=r(68909),c=r(75058),u=r(16029),l=r(92170),d=r.n(l),s=r(8992),f=r(35704),p=r(35567),v=r(31205),y=r(27448),m=r(97785),h=r(43241),b=r(65756),_=r(33937),g=r(39242),E=r(68569),C=r(746),w=r(91950);function k(){var e=A(),t=e.m(k),r=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function n(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===r||"GeneratorFunction"===(t.displayName||t.name))}var a={throw:1,return:2,break:3,continue:3};function i(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,a[e],t)},delegateYield:function(e,a,i){return t.resultName=a,r(n.d,x(e),i)},finish:function(e){return r(n.f,e)}},r=function(e,r,a){n.p=t.prev,n.n=t.next;try{return e(r,a)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(k=function(){return{wrap:function(t,r,n,a){return e.w(i(t),r,n,a&&a.reverse())},isGeneratorFunction:n,mark:e.m,awrap:function(e,t){return new j(e,t)},AsyncIterator:N,async:function(e,t,r,a,o){return(n(t)?D:S)(i(e),t,r,a,o)},keys:O,values:x}})()}function x(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(U(e)+" is not iterable")}function O(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}}function S(e,t,r,n,a){var i=D(e,t,r,n,a);return i.next().then(function(e){return e.done?e.value:i.next()})}function D(e,t,r,n,a){return new N(A().w(e,t,r,n),a||Promise)}function N(e,t){function r(n,a,i,o){try{var c=e[n](a),u=c.value;return u instanceof j?t.resolve(u.v).then(function(e){r("next",e,i,o)},function(e){r("throw",e,i,o)}):t.resolve(u).then(function(e){c.value=e,i(c)},function(e){return r("throw",e,i,o)})}catch(e){o(e)}}var n;this.next||(T(N.prototype),T(N.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),T(this,"_invoke",function(e,a,i){function o(){return new t(function(t,n){r(e,i,t,n)})}return n=n?n.then(o,o):o()},!0)}function A(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function i(r,n,a,i){var u=n&&n.prototype instanceof c?n:c,l=Object.create(u.prototype);return T(l,"_invoke",function(r,n,a){var i,c,u,l=0,d=a||[],s=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return i=t,c=0,u=e,f.n=r,o}};function p(r,n){for(c=r,u=n,t=0;!s&&l&&!a&&t<d.length;t++){var a,i=d[t],p=f.p,v=i[2];r>3?(a=v===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=p&&((a=r<2&&p<i[1])?(c=0,f.v=n,f.n=i[1]):p<v&&(a=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,f.n=v,c=0))}if(a||r>1)return o;throw s=!0,n}return function(a,d,v){if(l>1)throw TypeError("Generator is already running");for(s&&1===d&&p(d,v),c=d,u=v;(t=c<2?e:u)||!s;){i||(c?c<3?(c>1&&(f.n=-1),p(c,u)):f.n=u:f.v=u);try{if(l=2,i){if(c||(a="next"),t=i[a]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+a+"' method"),c=1);i=e}else if((t=(s=f.n<0)?u:r.call(n,f))!==o)break}catch(t){i=e,c=1,u=t}finally{l=1}}return{value:t,done:s}}}(r,a,i),!0),l}var o={};function c(){}function u(){}function l(){}t=Object.getPrototypeOf;var d=[][n]?t(t([][n]())):(T(t={},n,function(){return this}),t),s=l.prototype=c.prototype=Object.create(d);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,T(e,a,"GeneratorFunction")),e.prototype=Object.create(s),e}return u.prototype=l,T(s,"constructor",l),T(l,"constructor",u),u.displayName="GeneratorFunction",T(l,a,"GeneratorFunction"),T(s),T(s,a,"Generator"),T(s,n,function(){return this}),T(s,"toString",function(){return"[object Generator]"}),(A=function(){return{w:i,m:f}})()}function T(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}T=function(e,t,r,n){function i(t,r){T(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},T(e,t,r,n)}function j(e,t){this.v=e,this.k=t}function P(e,t,r,n,a,i,o){try{var c=e[i](o),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,a)}function R(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(e){P(i,n,a,o,c,"next",e)}function c(e){P(i,n,a,o,c,"throw",e)}o(void 0)})}}function I(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function F(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$(n.key),n)}}function z(e,t,r){return t=G(t),function(e,t){if(t&&("object"==U(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}
2(e,L()?Reflect.construct(t,r||[],G(e).constructor):t.apply(e,r))}function L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(L=function(){return!!e})()}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},B(e,t)}function M(e,t,r){return(t=$(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $(e){var t=function(e,t){if("object"!=U(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=U(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==U(t)?t:t+""}function U(e){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(e)}var Y=function(e,t,r,n){var a,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":U(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},K=(0,c.Ng)(function(e){return{auth:e.auth}},null,null,{forwardRef:!0}),q=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),M(r=z(this,t,[e]),"state",{page:1,pageSize:25}),M(r,"refetch",void 0),M(r,"editCardModal",void 0),r.editCardModal=o.createRef(),r.addCard=r.addCard.bind(r),r.deleteCard=r.deleteCard.bind(r),r.setDefault=r.setDefault.bind(r),r.getCardTiles=r.getCardTiles.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}(t,e),r=t,c=[{key:"GET_CARDS",value:function(){return(0,u.Ay)(n||(n=I(["\n query user_cards($filter: CreditCardSearchInput!, $pagination: Pagination!) {\n myCreditCards(filter: $filter, pagination: $pagination){\n total\n cards {\n credit_card_id\n card_number\n card_type\n description\n expiration_date\n expiration_month\n expiration_year\n first_name\n middle_name\n last_name\n is_default\n card_status\n }\n }\n }\n "])))}},{key:"getCardTiles",value:function(e){var t,r,n=this;return o.createElement(o.Fragment,null,null===(t=e.myCreditCards)||void 0===t||null===(r=t.cards)||void 0===r?void 0:r.map(function(e){return o.createElement("div",{key:null==e?void 0:e.credit_card_id,className:"mycreditcard ".concat((null==e?void 0:e.card_status)===s.CardStatus.PENDING.valueOf()&&"pending")},n.cardStatus(e),n.cardDescritpion(e),n.defaultCardButton(e),n.cardActions(e),n.cardNumber(e),n.creditCardExpiration(e),n.cardName(e),n.cardIcon(e))}))}},{key:"render",value:function(){var e,t,r=this,n=this.props.auth,a=this.state,i=a.page,c=a.pageSize;return o.createElement(o.Fragment,null,o.createElement(v.Y,{ref:this.editCardModal}),o.createElement(g.X,{query:this.GET_CARDS(),variables:{filter:{user_id:null==n||null===(e=n.user)||void 0===e||null===(t=e.user_id)||void 0===t?void 0:t.toString(),include_pending:!0},pagination:{page:i,pageSize:c}},fetchPolicy:"network-only"},function(e){var t=e.data,n=e.loading,a=e.error,i=e.refetch;return r.refetch=i,a?o.createElement(y.v,{error:a}):n?o.createElement("div",{className:"loader"},"Loading..."):t?o.createElement(o.Fragment,null,r.cardPagination(t),r.cardList(t)):o.createElement(o.Fragment,null,"Unknown error gathering cards")}))}},{key:"cardPagination",value:function(e){var t,r,n=this,a=this.state,i=a.page,c=a.pageSize;return o.createElement("div",{className:"cardpagination"},o.createElement("button",{className:"btn btn-primary addCardBtn",onClick:this.addCard},"Add Card"),!(null==e||null===(t=e.myCreditCards)||void 0===t||null===(r=t.cards)||void 0===r||!r.length)&&o.createElement(E.d,{pagination:{page:i,pageSize:c,total:e.myCreditCards.total},updateState:function(e){return n.setState(e)}}))}},{key:"cardList",value:function(e){var t,r;return o.createElement(o.Fragment,null,null!==(t=e.myCreditCards)&&void 0!==t&&null!==(r=t.cards)&&void 0!==r&&r.length?o.createElement(o.Fragment,null,o.createElement("div",{className:"accountcards"},this.getCardTiles(e)),o.createElement("span",{style:{paddingInline:"5px",textAlign:"center"}},o.createElement("strong",null,"Modifications/updates cannot be made to an existing credit card. You must first ADD the new credit card, then DELETE the old credit card."))):o.createElement("div",null,"You currently have no credit cards"))}},{key:"cardStatus",value:function(e){return(null==e?void 0:e.card_status)===s.CardStatus.PENDING.valueOf()&&o.createElement("div",{key:"pending",className:"cardpending"},"Pending Approval")}},{key:"cardDescritpion",value:function(e){return o.createElement("div",{key:"description",className:"carddescription"},null==e?void 0:e.description)}},{key:"defaultCardButton",value:function(e){var t=this;return o.createElement("div",{key:"default",className:"defaultcard"},(null==e?void 0:e.is_default)&&o.createElement(o.Fragment,null,"Default Card ",o.createElement(h.FontAwesomeIcon,{icon:["fas","check"],title:"This card is the default card"})),!(null!=e&&e.is_default)&&o.createElement(b.A,{outline:!0,size:"sm",onClick:function(){return t.setDefault(null==e?void 0:e.credit_card_id)}},"Set Default"))}},{key:"cardActions",value:function(e){var t=this;return o.createElement("div",{key:"actions",className:"carddelete"},o.createElement(b.A,{color:"danger",size:"sm",title:"Delete card",onClick:function(){return t.deleteCard(null==e?void 0:e.credit_card_id)}},o.createElement(h.FontAwesomeIcon,{icon:["fas","trash-alt"]})))}},{key:"cardNumber",value:function(e){return o.createElement("div",{key:"number",className:"cardnumber"},null==e?void 0:e.card_number)}},{key:"creditCardExpiration",value:function(e){return o.createElement("div",{key:"expiration",className:"cardexpiration"},"Exp ",null==e?void 0:e.expiration_month,"/",null==e?void 0:e.expiration_year,d()(null==e?void 0:e.expiration_date).tz("utc").add(1,"month").isBefore(d()())&&o.createElement(_.A,{color:"danger",style:{marginLeft:"5px"}},"Expired"))}},{key:"cardName",value:function(e){return o.createElement("div",{key:"name",className:"cardname"},null==e?void 0:e.first_name," ",null==e?void 0:e.last_name)}},{key:"cardIcon",value:function(e){var t,r;switch(null==e?void 0:e.card_type){case s.CardType.AMERICAN_EXPRESS.valueOf():r=o.createElement(h.FontAwesomeIcon,{icon:["fab","cc-amex"],title:(0,s.getEnumDisplay)(s.CardType,null==e?void 0:e.card_type),size:"2x"});break;case s.CardType.DINERS_CLUB.valueOf():r=o.createElement(h.FontAwesomeIcon,{icon:["fab","cc-diners-club"],title:(0,s.getEnumDisplay)(s.CardType,null==e?void 0:e.card_type),size:"2x"});break;case s.CardType.DISCOVER.valueOf():r=o.createElement(h.FontAwesomeIcon,{icon:["fab","cc-discover"],title:(0,s.getEnumDisplay)(s.CardType,null==e?void 0:e.card_type),size:"2x"});break;case s.CardType.JCB.valueOf():r=o.createElement(h.FontAwesomeIcon,{icon:["fab","cc-jcb"],title:(0,s.getEnumDisplay)(s.CardType,null==e?void 0:e.card_type),size:"2x"});break;case s.CardType.MASTERCARD.valueOf():r=o.createElement(h.FontAwesomeIcon,{icon:["fab","cc-mastercard"],title:(0,s.getEnumDisplay)(s.CardType,null==e?void 0:e.card_type),size:"2x"});break;case s.CardType.VISA.valueOf():r=o.createElement(h.FontAwesomeIcon,{icon:["fab","cc-visa"],title:(0,s.getEnumDisplay)(s.CardType,null==e?void 0:e.card_type),size:"2x"});break;default:r=o.createElement(h.FontAwesomeIcon,{icon:["fas","credit-card-front"],title:(0,s.getEnumDisplay)(s.CardType,null!==(t=null==e?void 0:e.card_type)&&void 0!==t?t:s.CardType.UNKNOWN.valueOf()),size:"2x"})}return o.createElement("div",{key:"type",className:"cardtype"},r)}},{key:"DELETE_CARD",value:function(){return(0,u.Ay)(a||(a=I(["\n mutation delete_card(\n $credit_card_id: String!\n ) {\n deleteCreditCard(\n credit_card_id: $credit_card_id\n )\n }\n "])))}}
2,{key:"deleteCard",value:(O=R(k().mark(function e(t){return k().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new Error("No credit card ID provided. Perhaps the card has already been deleted?");case 2:return e.next=4,(0,f.confirm)({title:"Delete Card",message:"This will remove the card from your account. You will need to re-enter card details to add it back in. Are you sure you want to delete this card?"});case 4:if(e.sent){e.next=7;break}return e.abrupt("return");case 7:return e.prev=7,e.next=10,p.Sn.mutate({mutation:this.DELETE_CARD(),variables:{credit_card_id:t.toString()}});case 10:m.oR.success("Card deleted"),this.refetch&&this.refetch(),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0),(0,C.IY)(e.t0);case 18:case"end":return e.stop()}},e,this,[[7,14]])})),function(e){return O.apply(this,arguments)})},{key:"SET_DEFAULT",value:function(){return(0,u.Ay)(i||(i=I(["\n mutation set_default_cc(\n $credit_card_id: String!\n ) {\n setDefaultCreditCard(\n credit_card_id: $credit_card_id\n )\n }\n "])))}},{key:"setDefault",value:(x=R(k().mark(function e(t){return k().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new Error("No credit card ID provided");case 2:return e.prev=2,e.next=5,p.Sn.mutate({mutation:this.SET_DEFAULT(),variables:{credit_card_id:t.toString()}});case 5:m.oR.success("Card set as default"),this.refetch&&this.refetch(),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),console.error(e.t0),m.oR.error("Error changing default card: "+e.t0.message);case 13:case"end":return e.stop()}},e,this,[[2,9]])})),function(e){return x.apply(this,arguments)})},{key:"addCard",value:(w=R(k().mark(function e(){var t,r;return k().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props.auth,e.prev=1,this.editCardModal.current){e.next=4;break}throw new Error("NO REF");case 4:if(null!=t&&null!==(r=t.user)&&void 0!==r&&r.user_id){e.next=6;break}throw new Error("No user ID found");case 6:return e.next=8,this.editCardModal.current.open({user_id:t.user.user_id,credit_card_id:"new",card:{},title:"New Card"});case 8:this.refetch&&this.refetch(),e.next=17;break;case 11:if(e.prev=11,e.t0=e.catch(1),"cancel"!==e.t0){e.next=15;break}return e.abrupt("return");case 15:m.oR.error("An unknown error has occurred"),console.log("Form ERROR:",e.t0);case 17:case"end":return e.stop()}},e,this,[[1,11]])})),function(){return w.apply(this,arguments)})}],c&&F(r.prototype,c),l&&F(r,l),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,c,l,w,x,O}(o.Component);const H=q=Y([K,(0,w.override)("plugins/pages/account/credit-cards/index")],q);r.d(t,["default",0,H])}}]);
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.