PageSourceSearch

https://seala.ru/_sq/assets/universal/scripts-compressed/async-set…anced-apikeys-1a976bf9ccde3e40-min.en-US.js

js seala.ru collected 2026-10-02 07:31:14 UTC 29,891 bytes, 3 lines download raw bytes

1(globalThis.webpackChunkextract_css=globalThis.webpackChunkextract_css||[]).push([["36099"],{25144:(function(C){"use strict";C.exports={content:"Y8TXmypayaglB1iz",cardList:"nc2_ZgUqEccJ34Lq",activityIndicator:"Z2NB5q5UZs8ob45o"}}),392103:(function(C){"use strict";C.exports={card:"t0j1cHX08AQHWBb4"}}),437817:(function(C){"use strict";C.exports={activityIndicator:"jL2jlcTXCYsSz218",bottomContainer:"KKjDbVC6RqgsyBac",bottomButton:"deD6MkZ0L4klpGMi"}}),982884:(function(C){"use strict";C.exports={header:"P2_Ge_3q6wVutneQ",leftButton:"Srk0WThCfp80Vfm7",rightButton:"m7Kb3QEEkm7INFeY",generateButton:"FBvxIB5qjIY1q_x3"}}),806314:(function(C){"use strict";C.exports={content:"jObcVPcQVkXpNwGr",closeIcon:"rf2oYdJryhckSsVc",badge:"NpTc_B1olY6J_Upv",upgradeTitle:"AM3aN0eLB8YnhKt7",description:"jXXfXHeIAtI4R2Xe",button:"eY3WBTtkoXIa5GQg"}}),289598:(function(C){"use strict";C.exports={scopes:"TSPr1lVBe084R5F0",field:"_VSqn5LEBGoGUL0v",featureGateMenu:"yX4SgnrHc4UMJI23"}}),534950:(function(C,T){"use strict";Object.defineProperty(T,"__esModule",{value:!0}),T.default=void 0;var a;(function(c){c.CART_READONLY="CART_READONLY",c.CONTACT="CONTACT",c.CONTACT_READONLY="CONTACT_READONLY",c.DISCOUNT="DISCOUNT",c.DISCOUNT_READONLY="DISCOUNT_READONLY",c.FORM="FORM",c.FORM_READONLY="FORM_READONLY",c.INVENTORY="INVENTORY",c.INVENTORY_READONLY="INVENTORY_READONLY",c.ORDER="ORDER",c.ORDER_READONLY="ORDER_READONLY",c.PRODUCT="PRODUCT",c.PRODUCT_READONLY="PRODUCT_READONLY",c.PROFILE="PROFILE",c.PROFILE_READONLY="PROFILE_READONLY",c.TRANSACTION="TRANSACTION",c.TRANSACTION_READONLY="TRANSACTION_READONLY",c.UI_TOOLKIT="UI_TOOLKIT"})(a||(a={}));var L=T.default=a;C.exports=T.default}),722680:(function(C,T,a){var L=a(872789),c=a(943057),D=a(515860),g=a(934618);function I(){var P=arguments.length;if(!P)return[];for(var y=Array(P-1),M=arguments[0],O=P;O--;)y[O-1]=arguments[O];return L(g(M)?D(M):[M],c(y,1))}C.exports=I}),602476:(function(C,T,a){"use strict";a.r(T),a.d(T,{default:()=>ct});var L=a(541158),c=a.n(L),D=a(534089),g=a(770528);const I="/api/1/publicapi/keys",y={getAllKeys(){return g.default.get(I)},createKey(o,t){return g.default.post(I,{keyName:o,scopes:t})},deleteKey(o){return g.default.delete(I+"/"+o)}};class M{constructor(){this.generateActions("changeNewKeyName","changeNewKeyScope","createKeyClick","createKeySuccess","createKeyFailure","loadKeysFailure","loadKeysSuccess","confirmAddKey","resetCurrentKey","deleteKeySuccess","deleteKeyFailure","resetDeleteKeyError")}createKey(t,n){return l=>(l(),y.createKey(t,n).then(i=>this.createKeySuccess(i.data),this.createKeyFailure))}deleteKey(t,n,l){return i=>y.deleteKey(t).then(()=>this.deleteKeySuccess({keyId:t,keyName:n,keyScope:l}),this.deleteKeyFailure)}loadKeys(){return t=>(t(),y.getAllKeys().then(n=>this.loadKeysSuccess(n.data),()=>this.loadKeysFailure()))}}const O=D.Z.createActions(M);var ie=a(722680),H=a.n(ie),X=a(94887),w=a.n(X),f=a(305354);class z{constructor(){this.state={isKeyLoading:!1,isKeyListLoading:!1,keyListLoadingError:!1,currentKeyName:"",currentKeyScope:[],websiteKeys:new Map,keyCreationError:!1,keyDeletionError:!1,isKeyDeleteLoading:!1,currentKey:null},this.bindActions(O)}onCreateKeySuccess(t){const{websiteKeys:n}=this.state;n.set(t.id,t),this.setState({isKeyLoading:!1,currentKey:t,websiteKeys:n})}onCreateKeyFailure(t){this.setState({isKeyLoading:!1,keyCreationError:!0})}onCreateKey(){this.setState({isKeyLoading:!0})}onChangeNewKeyName(t){this.setState({currentKeyName:t})}onChangeNewKeyScope(t){let[n,l]=t;this.setState({currentKeyScope:(l?H():w()).call(null,this.state.currentKeyScope,n)})}onLoadKeysSuccess(t){const n=new Map;t.results.forEach(l=>{n.set(l.id,l)}),this.setState({isKeyListLoading:!1,keyListLoadingError:!1,websiteKeys:n})}onLoadKeys(){this.setState({isKeyListLoading:!0})}onLoadKeysFailure(){this.setState({isKeyListLoading:!1,keyListLoadingError:!0})}onDeleteKeySuccess(t){const{websiteKeys:n}=this.state;n.delete(t.keyId),this.setState({websiteKeys:n}),(0,f.F7)({params:{apiKeyName:t.keyName,apiKeyScope:t.keyScope}})}onDeleteKeyFailure(){this.setState({keyDeletionError:!0})}onResetCurrentKey(t){const n={currentKeyName:"",currentKeyScope:[],currentKey:null,keyNameError:!1};t&&(n.keyCreationError=!1),this.setState(n)}addKey(t){const{websiteKeys:n}=this.state;n.set(t.id,t),this.setState({websiteKeys:n})}onResetDeleteKeyError(){this.setState({keyDeletionError:!1})}}const B=D.Z.createStore(z,"ApiKeyStore");var ce=a(273177),e=a(184250),p=a(704935),r=a(923781),Q=a(597001),J=a(753941),$=
1a(326499),q=a(73298),E=a(969196),Y=a(589605),Z=a(125583),j=a(661640),pe=a(138301),k=a(280225),A=a(424547);const ee=o=>{let{children:t,isOpen:n,handleOnClick:l,handleOnRequestClose:i}=o;return e.createElement(A.default.Transition,null,n&&e.createElement(A.default,{onRequestClose:i},e.createElement(A.default.Overlay,null),e.createElement(A.default.Position,{position:"center"},e.createElement(A.default.Dialog,null,e.createElement(k.default,{onClick:l,pt:5,pb:5,pr:6,pl:6,bg:"white",height:"600px",width:"400px"},t)))))};var te=a(851673),ae=a(866946),he=a(719593),Oe=a(644451),Ke=a(982884),G=a.n(Ke);const de=o=>{let{children:t}=o;return e.createElement(k.default,{className:G().header},t)};var Ne=a(106651),Se=a(674838),ue=a(55599),Re=a(864326);const U={READ_ONLY:{value:"READ_ONLY",label:(0,r.t)("Read Only",null,{project:"apps.App.Settings"})},READ_WRITE:{value:"READ_WRITE",label:(0,r.t)("Read and Write",null,{project:"apps.App.Settings"})}},Te=o=>{let{availablePermissions:t,selectedPermissionValue:n,onPermissionChange:l,scopeName:i}=o;return e.createElement(k.default,{pt:2},t.map((d,u)=>{const m=u===t.length-1;return e.createElement(E.default,{as:"label",fontSize:2,lineHeight:2,height:m?"sizes.250":"32px",pb:m?0:3,cursor:"pointer",position:"relative",display:"flex",mr:1,ml:6,fontWeight:"medium",key:u},e.createElement(Re.default,{checked:n===d.value,name:i,value:d.value,onChange:l,mr:2}),d.label)}))},fe=o=>{let{scope:t,isDisabled:n,isGated:l,handleScopeChange:i,handleUpsellBadgeOnClick:d,className:u}=o;const[m,K]=e.useState(!1),[N,b]=e.useState(U.READ_ONLY.value),W=()=>{i(t.key,!1),i(t.readWriteKey,!1)},R=x=>{b(x),x===U.READ_ONLY.value?(i(t.key,!0),i(t.readWriteKey,!1)):(i(t.key,!1),i(t.readWriteKey,!0))},V=l?e.createElement(ue.Z,{knockout:!1,premiumFeatureLabel:"",onLearnMoreClick:d}):null,pt=t.readWriteKey?[U.READ_ONLY,U.READ_WRITE]:[U.READ_ONLY];return e.createElement("div",{className:u},e.createElement(Se.default,{flush:!0,clickable:!(n||l),label:t.name,subtitle:t.description,subtitleMultiline:!0,accessory:()=>V,iconSize:"small",icon:e.createElement(Ne.Z,{isDisabled:n||l,value:m,onChange:x=>{K(x),x?i(t.key,!0):W()}})}),m&&e.createElement(Te,{availablePermissions:pt,selectedPermissionValue:N,onPermissionChange:R,scopeName:t.name}))};var Pe=a(534950),h=a.n(Pe),Le=a(797622),S=a.n(Le),De=a(972375),v=a.n(De),Ie=a(900275),ve=a.n(Ie),Me=a(762379);const ke=[{key:h().FORM_READONLY,name:(0,r.t)("Forms",null,{project:"apps.App.Settings"}),visible:!0,feature:S().FORMS_API,isCommerceApi:!1,description:e.createElement(p.T,{project:"apps.App.Settings"},"Form submission (used by Zapier integration)")},{key:h().PRODUCT_READONLY,readWriteKey:h().PRODUCT,name:(0,r.t)("Products",null,{project:"apps.App.Settings"}),visible:!0,feature:S().PRODUCTS_API,isCommerceApi:!0,description:e.createElement(p.T,{project:"apps.App.Settings"},"Product information")},{key:h().INVENTORY_READONLY,readWriteKey:h().INVENTORY,name:(0,r.t)("Inventory",null,{project:"apps.App.Settings"}),visible:!0,feature:S().INVENTORY_API,isCommerceApi:!0,description:e.createElement(p.T,{project:"apps.App.Settings"},"Inventory stock levels")},{key:h().CART_READONLY,name:(0,r.t)("Carts",null,{project:"apps.App.Settings"}),visible:Me.Z.isFeatureEnabled(ve().COMMERCE_PURCHASE_FUNNEL_ENABLED),feature:S().CARTS_API,isCommerceApi:!0,description:e.createElement(p.T,{project:"apps.App.Settings"},"Cart information")},{key:h().ORDER_READONLY,readWriteKey:h().ORDER,name:(0,r.t)("Orders",null,{project:"apps.App.Settings"}),visible:!0,feature:S().ORDERS_API,isCommerceApi:!0,description:e.createElement(p.T,{project:"apps.App.Settings"},"Order and fulfillment data")},{key:h().TRANSACTION_READONLY,name:(0,r.t)("Transactions",null,{project:"apps.App.Settings"}),visible:!0,feature:S().TRANSACTIONS_API,isCommerceApi:!0,description:e.createElement(p.T,{project:"apps.App.Settings"},"Transactional order and donation data")},{key:h().PROFILE_READONLY,name:(0,r.t)("Profiles",null,{project:"apps.App.Settings"}),visible:!0,feature:S().PROFILES_API,isCommerceApi:!0,description:e.createElement(p.T,{project:"apps.App.Settings"},"Name, address, email, marketing preferences, and other profile information of customers, subscribers, and other website users")},{key:h().CONTACT_READONLY,readWriteKey:h().CONTACT,name:(0,r.t)("Contacts",null,{project:"apps.App.Settings"}),visible:!0,feature:S().CONTACTS_API,isCommerceApi:!0,description:e.createElement(p.T,{project:"apps.App.Settings"},"Name, address, email, marketing preferences, and other contact information of customers, subscribers, and other website users")},{key:h().DISCOUNT_READONLY,readWriteKey:h().DISCOUNT,name:(0,r.t)("Discounts",null,{project:"apps.App.Settings"}),visible:!0,feature:S().DISCOUNTS_API,isCommerceApi:!0,description:e.createElement(p.T,{project:"apps.App.Settings"},"Discount information")}],yt=v().shape({description:v().any.isRequired,feature:v().number,isCommerceApi:v().bool,visible:v().bool.isRequired,key:v().string.isRequired,name:v().string.isRequired});var _e=a(82960),Ye=a.n(_e),ne=a(909993);const je=(o,t)=>o.length&&t.trim().length,Ge=o=>Ye().writeText(o),ye=o=>{const t={ORDER:(0,r.t)("Orders (Read and Write)",null,{project:"apps.App.Settings"}),FORM:(0,r.t)("Forms (Read and Write)",null,{project:"apps.App.Settings"}),INVENTORY:(0,r.t)("Inventory (Read and Write)",null,{project:"apps.App.Settings"}),PRODUCT:(0,r.t)("Products (Read and Write)",null,{project:"apps.App.Settings"}),TRANSACTION:(0,r.t)("Transactions (Read and Write)",null,{project:"apps.App.Settings"}),PROFILE:(0,r.t)("Profiles (Read and Write)",null,{project:"apps.App.Settings"}),DISCOUNT:(0,r.t)("Discounts (Read and Write)",null,{project:"apps.App.Settings"}),CONTACT:(0,r.t)("Contacts (Read and Write)",null,{project:"apps.App.Settings"}),ORDER_READONLY:(0,r.t)("Orders (Read Only)",null,{project:"apps.App.Settings"}),FORM_READONLY:(0,r.t)("Forms (Read Only)",null,{project:"apps.App.Settings"}),INVENTORY_READONLY:(0,r.t)("Inventory (Read Only)",null,{project:"apps.App.Settings"}),PRODUCT_READONLY:(0,r.t)("Products (Read Only)",null,{project:"apps.App.Settings"}),TRANSACTION_READONLY:(0,r.t)("Transactions (Read Only)",null,{project:"apps.App.Settings"}),PROFILE_READONLY:(0,r.t)("Profiles (Read Only)",null,{project:"apps.App.Settings"}),DISCOUNT_READONLY:(0,r.t)("Discounts (Read Only)",null,{project:"apps.App.Settings"}),CONTACT_READONLY:(0,r.t)("Contacts (Read Only)",null,{project:"apps.App.Settings"}),CART_READONLY:(0,r.t)("Carts (Read Only)",null,{project:"apps.App.Settings"})};return o.sort().filter(n=>!!t[n]).reduce((n,l)=>n.concat(t[l]),[]).join(", ")},Ue=o=>!!o.feature&&ne.Z.isFeatureGated(o.feature),me=()=>ne.Z.isFeatureGated(S().INVENTORY_API),se=()=>ne.Z.isFeatureGated(S().FORMS_API),Fe=o=>{let{className:t,isTrial:n,isDisabled:l,handleScopeChange:i,handleUpsellBadgeOnClick:d}=o;const u=ke.filter(m=>m.visible);return e.createElement("div",{className:t},u.map((m,K)=>{const N=!l&&!n&&Ue(m);return e.createElement(fe,{key:K,scope:m,handleScopeChange:i,isDisabled:l,isGated:N,handleUpsellBadgeOnClick:d})}))};var be=a(289598),le=a.n(be),Ve=a(651653),xe=a.n(Ve);const Be=o=>{let{isDisabled:t,keyName:n,selectedScopes:l,handleKeyNameChange:i,handleScopeChange:d,handleOnCancel:u,handleOnGenerateKey:m,handleShowUpsellModal:K,isTrial:N}=o;return e.createElement(e.Fragment,null,e.createElement(de,null,e.createElement(ae.Z,{className:G().leftButton,label:(0,r.t)("Cancel",null,{project:"apps.App.Settings"}),onClick:u}),e.createElement(ae.Z,{className:xe()(G().rightButton,G().generateButton),label:(0,r.t)("Generate Key",null,{project:"apps.App.Settings"}),onClick:m,isDisabled:t||!je(l,n)})),(N||t)&&e.createElement(Oe.Z,{className:le().featureGateMenu,premiumFeatureLabel:(0,r.t)("Premium Feature",null,{project:"apps.App.Settings"}),learnMoreLabel:(0,r.t)("Learn More",null,{project:"apps.App.Settings"}),onLearnMoreClick:K}),e.createElement(E.default.Title,{textAlign:"left",color:"gray.100"},e.createElement(p.T,{project:"apps.App.Settings"},"Generate API Key")),e.createElement(E.default.Subtitle,{mt:"8px",textAlign:"left",color:"gray.400",fontWeight:"400"},e.createElement(p.T,{project:"apps.App.Settings"},"API keys require access to your site name, site ID, language, currency, time zone and location.")),e.createElement(E.default.Label,{mt:8,color:"gray.400"},e.createElement(p.T,{project:"apps.App.Settings"},"Key Name")),e.createElement(he.default,{className:le().field,flush:!0,placeholder:(0,r.t)("Add...",null,{project:"apps.App.Settings"}),inline:!1,value:n,onChange:i,isDisabled:t}),e.createElement(E.default.Label,{mt:6,color:"gray.400"},e.createElement(p.T,{project:"apps.App.Settings"},"Permissions")),e.createElement(Fe,{className:le().scopes,handleScopeChange:d,isTrial:N,isDisabled:t,handleUpsellBadgeOnClick:K}),e.createElement(k.default,{height:"55px"}))};var Ze=a(437817),re=a.n(Ze);const We=o=>{let{keyValue:t,keyName:n,selectedScopes:l,handleOnClose:i,handleOnCopyKey:d}=o;const u=ye(l);return e.createElement(e.Fragment,null,e.createElement(de,null,e.createElement(ae.Z,{className:G().leftButton,label:(0,r.t)("Close",null,{project:"apps.App.Settings"}),onClick:i})),e.createElement(E.default.Title,{color:"gray.100"},e.createElement(p.T,{project:"apps.App.Settings"},"API Key Generated")),e.createElement(E.default.Subtitle,{mr:6,mt:"8px",color:"gray.400",fontWeight:"400"},e.createElement(p.T,{project:"apps.App.Settings"},"Keep your API key somewhere safe. For your security, this is the only time we\u2019ll show your key.")),e.createElement(E.default.Label,{mt:6,color:"gray.400"},e.createElement(p.T,{project:"apps.App.Settings"},"Key Name")),e.createElement(E.default.Body,{mt:2,color:"gray.100"},n),e.createElement(E.default.Label,{mt:8,color:"gray.400"},e.createElement(p.T,{project:"apps.App.Settings"},"Permissions")),e.createElement(E.default.Body,{mt:2,color:"gray.100"},u),e.createElement(E.default.Label,{mt:8,color:"gray.400"},e.createElement(p.T,{project:"apps.App.Settings"},"API Key")),e.createElement(E.default.Body,{mt:2,color:"gray.100"},t),e.createElement("div",{className:re().bottomContainer},e.createElement(Y.default.Primary,{className:re().bottomButton,size:"large",width:"100%",letterSpacing:"0.5px",onClick:d},e.createElement(p.T,{project:"apps.App.Settings"},"Copy Key"))))};var F=a(860800);const Ae=o=>{let{isOpen:t,title:n,message:l,handleOnClose:i}=o;return e.createElement(A.default.Transition,null,t&&e.createElement(A.default,{onRequestClose:i},e.createElement(A.default.Overlay,null),e.createElement(A.default.Position,{position:"center"},e.createElement(F.Z,{title:n,message:l,buttons:[()=>e.createElement(F.Z.Button,{key:"close",onClick:i},e.createElement(p.T,{project:"apps.App.Settings"},"Close"))]}))))};class He extends e.Component{handleGenerateKey(){const{keyName:t,selectedScopes:n,handleGenerateKey:l}=this.props;l(t,n),(0,f.Cs)({params:{apiKeyName:t,selectedApiKeyScopes:n}})}handleGenerateCancel(){const{keyName:t,selectedScopes:n}=this.props;(0,f.CH)({params:{apiKeyName:t,selectedApiKeyScopes:n}}),this.closeModalAndResetCurrentKey()}handleViewClose(){const{keyName:t,selectedScopes:n}=this.props;(0,f.vn)({params:{apiKeyName:t,selectedApiKeyScopes:n}}),this.closeModalAndResetCurrentKey()}handleCopyKey(){const{keyValue:t,keyName:n,selectedScopes:l}=this.props;try{Ge(t.key),(0,f.mp)({params:{apiKeyName:n,selectedApiKeyScopes:l}})}catch{console.warn("Copy command failed.")}}closeModalAndResetCurrentKey(){const{generateKeyError:t,handleResetGenerateKey:n,handleOnClose:l}=this.props;n(t),l()}renderModalContent(){const{isDisabled:t,isTrial:n,keyValue:l,keyName:i,selectedScopes:d,isKeyLoading:u,handleKeyNameChange:m,handleScopeChange:K,handleShowUpsellModal:N}=this.props;return l?e.createElement(We,{keyValue:l.key,keyName:i,selectedScopes:d,handleOnClose:()=>this.handleViewClose(),handleOnCopyKey:()=>this.handleCopyKey()}):u?e.createElement("div",{className:re().activityIndicator},e.createElement(Z.default,null)):e.createElement(Be,{isDisabled:t,isTrial:n,isKeyLoading:u,keyName:i,selectedScopes:d,handleKeyNameChange:m,handleScopeChange:K,handleShowUpsellModal:N,handleOnCancel:()=>this.handleGenerateCancel(),handleOnGenerateKey:()=>this.handleGenerateKey()})}render(){const{isOpen:t,generateKeyError:n,handleModalOnClick:l}=this.props;return e.createElement(e.Fragment,null,e.createElement(Ae,{isOpen:n,handleOnClose:()=>this.closeModalAndResetCurrentKey(),title:(0,r.t)("Error",null,{project:"apps.App.Settings"}),message:(0,r.t)("An error occurred while generating the API key. Please try again later.",null,{project:"apps.App.Settings"})}),e.createElement(ee,{isOpen:t,handleOnClick:l,handleOnRequestClose:()=>this.handleGenerateCancel()},this.renderModalContent()))}}const Xe=He,we=o=>{let{isOpen:t,handleOnConfirm:n,handleOnClose:l}=o;return e.createElement(A.default.Transition,null,t&&e.createElement(A.default,{onRequestClose:l},e.createElement(A.default.Overlay,null),e.createElement(A.default.Position,{position:"center"},e.createElement(F.Z,{title:(0,r.t)("Delete API Key",null,{project:"apps.App.Settings"}),message:(0,r.t)("Integrations using this API key will immediately lose access to your site data. To provide access again, you\u2019ll need to generate a new key.",null,{project:"apps.App.Settings"}),buttons:[()=>e.createElement(F.Z.Button,{key:"cancel",onClick:l},e.createElement(p.T,{project:"apps.App.Settings"},"Cancel")),()=>e.createElement(F.Z.Button,{key:"delete",onClick:n},e.createElement(p.T,{project:"apps.App.Settings"},"Delete"))]}))))};var ze=a(810792),Qe=a(921605),Je=a(801708),Ee=a(647221),$e=a(806314),_=a.n($e);const Ce=(0,Ee.m)(),qe=()=>Ce?(0,r.t)("Upgrade to a Core, Plus or Advanced plan to generate API Keys. The Basic plan doesn\u2019t include this feature.",null,{project:"apps.App.Settings"}):me()&&!se()?(0,r.t)("Upgrade to the Commerce Advanced plan to use this API. Your current plan doesn\u2019t include this feature.",null,{project:"apps.App.Settings"}):(0,r.t)("Upgrade to a Business or Commerce plan to generate API Keys. The Personal plan doesn\u2019t include this feature.",null,{project:"apps.App.Settings"}),et=o=>{let{isOpen:t,isTrial:n,handleOnClose:l}=o;const i=n?"/settings/billing/upgrade":"/settings/billing/subscriptions/website",d=n?(0,r.t)("Upgrade to keep using this feature after your trial",null,{project:"apps.App.Settings"}):(0,r.t)("Upgrade required",null,{project:"apps.App.Settings"}),u=Ce?(0,r.t)("Upgrade to a Core, Plus or Advanced plan to continue using API Keys after your trial ends.",null,{project:"apps.App.Settings"}):(0,r.t)("Upgrade to a Business or Commerce plan to continue using API Keys after your trial ends.",null,{project:"apps.App.Settings"}),m=n?u:qe();return e.createElement(A.default.Transition,null,t&&e.createElement(A.default,{onRequestClose:l},e.createElement(A.default.Overlay,null),e.createElement(A.default.Position,{position:"center"},e.createElement(A.default.Dialog,null,e.createElement(k.default,{p:3,bg:"white",height:"auto",width:"330px"},e.createElement("div",{className:_().content},e.createElement("button",{className:_().closeIcon,onClick:l},e.createElement(ze.Z,{height:16,width:16,color:"gray.400"})),e.createElement(ue.Z,{className:_().badge,premiumFeatureLabel:(0,r.t)("Premium Feature",null,{project:"apps.App.Settings"})}),e.createElement("span",{className:_().upgradeTitle},d),e.createElement("span",{className:_().description},m)),e.createElement(Je.Z,{to:i},e.createElement(Qe.Z,{className:_().button},e.createElement(p.T,{project:"apps.App"},"Upgrade Now"))))))))};var ge=a(975966),tt=a(392103),at=a.n(tt);const nt=o=>{let{apiKey:t,handleDeleteOnClick:n}=o;const{name:l,scopes:i=[],createdOn:d}=t,u=ye(i),m=d?(0,r.t)("Generated {date}",{date:(0,r.p6)(new Date(d),{date:"medium"})},{project:"apps.App.Settings"}):(0,r.t)("Generated",null,{project:"apps.App.Settings"});return e.createElement(ge.ZP,{elevation:0,expanded:!0,className:at().c
1ard},e.createElement(ge.IO,null,e.createElement(E.default.Label,{mt:1},m),e.createElement(E.default.Subtitle,{mt:2,mb:0},l),e.createElement(E.default.Body,{mt:1,mb:0,fontWeight:100,color:"gray.400"},u),e.createElement(Y.default.Tertiary,{mt:3,onClick:()=>n(t)},e.createElement(p.T,{project:"apps.App.Settings"},"Delete"))))},st=o=>{let{className:t,apiKeyList:n,handleDeleteOnClick:l}=o;return e.createElement("div",{className:t},n.map(i=>e.createElement(nt,{key:i.id,apiKey:i,handleDeleteOnClick:l})))};var lt=a(868192),rt=a(25144),oe=a.n(rt);class ot extends e.Component{constructor(t){super(t),this.state={showGenerateKeyModal:!1,showDeleteKeyModal:!1,showUpsellModal:!1,deleteKey:null}}setShowGenerateKeyModal(t){this.setState({showGenerateKeyModal:t})}setShowDeleteKeyModal(t){this.setState({showDeleteKeyModal:t})}setShowUpsellModal(t){this.setState({showUpsellModal:t})}setDeleteKey(t){this.setState({deleteKey:t})}resetDeleteKey(){this.setState({deleteKey:null})}handleDeleteOnClick(t){(0,f.gC)({params:{apiKeyName:t.name,apiKeyScope:t.scopes}}),this.setDeleteKey(t),this.setShowDeleteKeyModal(!0)}handleDeleteKeyConfirm(){const{deleteKey:t}=this.state;if(t){const{id:n,name:l,scopes:i=[]}=t;O.deleteKey(n,l,i)}this.resetDeleteKey(),this.setShowDeleteKeyModal(!1)}handleDeleteKeyErrorClose(){O.resetDeleteKeyError(),this.resetDeleteKey(),this.setShowDeleteKeyModal(!1)}handleKeyNameChange(t){O.changeNewKeyName(t)}handleScopeChange(t,n){O.changeNewKeyScope(t,n)}handleGenerateKey(t,n){O.createKey(t.trim(),n)}handleResetGenerateKey(t){O.resetCurrentKey(t)}handleGenerateKeyModalOnClick(){this.isGenerateKeyModalDisabled()&&this.setShowUpsellModal(!0)}isGenerateKeyModalDisabled(){return(0,Ee.m)()?!j.Z.isTrial()&&me()&&se():!j.Z.isTrial()&&se()}renderPanelContent(){const{isKeyListLoading:t,keyListLoadingError:n,keyDeletionError:l,keyList:i}=this.props,d=[...i.values()];return t?e.createElement("div",{className:oe().activityIndicator},e.createElement(Z.default,null)):n?e.createElement(E.default.Subtitle,{mt:10,textAlign:"center"},e.createElement(p.T,{project:"apps.App.Settings"},"An error has occurred while loading your website\u2019s API Keys. Please refresh the page or try again later.")):e.createElement(e.Fragment,null,e.createElement("div",{className:oe().content},e.createElement(Y.default.Primary,{size:"medium",sx:{width:{_:"auto","mobile-*":"100%"},mt:2,letterSpacing:"0.5px"},onClick:()=>{(0,f.QC)(),this.setShowGenerateKeyModal(!0)}},e.createElement(p.T,{project:"apps.App.Settings"},"Generate Key")),d.length>0&&e.createElement(st,{className:oe().cardList,apiKeyList:d,handleDeleteOnClick:u=>this.handleDeleteOnClick(u),keyDeletionError:l})))}render(){const{showGenerateKeyModal:t,showDeleteKeyModal:n,showUpsellModal:l}=this.state,{isKeyLoading:i,apiKeyValue:d,apiKey:u,apiKeyScope:m,keyCreationError:K,keyDeletionError:N}=this.props,b=e.createElement("a",{href:lt.API_ABOUT_PAGE,target:"_blank",onClick:()=>(0,f.rJ)()},e.createElement(p.T,{project:"apps.App.Settings"},"Learn More")),W=j.Z.isTrial();return e.createElement(Q.Z,null,e.createElement(pe.Z,null,R=>e.createElement(q.O,R)),e.createElement(J.Z,null,(0,r.t)("Developer API Keys",null,{project:"apps.App.Settings"})),e.createElement($.Z,null,e.createElement(p.T,{project:"apps.App.Settings",learnMoreLink:b},"Generate API keys to give specific integrations access to your site. {learnMoreLink}")),this.renderPanelContent(),e.createElement(we,{isOpen:n,handleOnConfirm:()=>this.handleDeleteKeyConfirm(),handleOnClose:()=>this.setShowDeleteKeyModal(!1)}),e.createElement(Ae,{isOpen:N,handleOnClose:()=>this.handleDeleteKeyErrorClose(),title:(0,r.t)("Error",null,{project:"apps.App.Settings"}),message:(0,r.t)("An error occurred while deleting the API key. Please try again later.",null,{project:"apps.App.Settings"})}),e.createElement(et,{isOpen:l,isTrial:W,handleOnClose:()=>this.setShowUpsellModal(!1)}),e.createElement(Xe,{isOpen:t,isDisabled:this.isGenerateKeyModalDisabled(),isTrial:W,keyValue:u,keyName:d,selectedScopes:m,generateKeyError:K,isKeyLoading:i,handleGenerateKey:(R,V)=>this.handleGenerateKey(R,V),handleKeyNameChange:R=>this.handleKeyNameChange(R),handleScopeChange:(R,V)=>
1this.handleScopeChange(R,V),handleOnClose:()=>this.setShowGenerateKeyModal(!1),handleResetGenerateKey:R=>this.handleResetGenerateKey(R),handleShowUpsellModal:()=>this.setShowUpsellModal(!0),handleModalOnClick:()=>this.handleGenerateKeyModalOnClick()}))}}const it=ot,ct=c()({getStores(){return[B]},getPropsFromStores(){const{isKeyLoading:o,isKeyListLoading:t,currentKeyName:n,currentKeyScope:l,websiteKeys:i,keyNameError:d,scopeErrorMessage:u,keyCreationError:m,keyDeletionError:K,keyListLoadingError:N,currentKey:b}=B.getState();return{apiKey:b,apiKeyValue:n,apiKeyScope:l,isKeyListLoading:t,isKeyLoading:o,keyCreationError:m,keyDeletionError:K,keyList:i,keyListLoadingError:N,keyNameError:d,scopeErrorMessage:u}},componentDidConnect(){O.loadKeys()}},it)}),305354:(function(C,T,a){"use strict";a.d(T,{T:()=>E,vT:()=>Z,pu:()=>Y,rJ:()=>z,vn:()=>J,Y$:()=>q,mp:()=>p,F7:()=>e,Cs:()=>r,jj:()=>A,QC:()=>B,CH:()=>Q,gC:()=>ce,qh:()=>j,gW:()=>w,Kc:()=>H,L3:()=>f,U3:()=>X,a:()=>$});var L=(function(s){return s.CART_PAGE_PRODUCT_FORM_OPEN="commerce_cart_page_product_form_open",s.CART_PAGE_PRODUCT_FORM_CLOSE="commerce_cart_page_product_form_close",s.CART_PAGE_PRODUCT_FORM_SUBMIT="commerce_cart_page_product_form_submit",s.CART_PAGE_LOADED="commerce_cart_page_loaded",s.CREATE_CUSTOMER_ACCOUNT="CompleteRegistration",s.ADD_TO_CART="AddToCart",s.SEARCH="Search",s.SUBSCRIBE_NEWSLETTER="Lead",s.VIEW_PRODUCT_PAGE="ViewContent",s.PURCHASE="Purchase",s.INVENTORY_PANEL_SEARCH_PRODUCTS="commerce_inventory_panel_search_products",s.INVENTORY_PANEL_SORT_ON_NAME="commerce_inventory_panel_sort_on_name",s.INVENTORY_PANEL_SORT_ON_STOCK="commerce_inventory_panel_sort_on_stock",s.INVENTORY_PANEL_SORT_ON_PRICE="commerce_inventory_panel_sort_on_price",s.INVENTORY_PANEL_CLICK_ROW_EXPANDER="commerce_inventory_panel_click_row_expander",s.INVENTORY_PANEL_CLICK_ROW="commerce_inventory_panel_click_row",s.INVENTORY_PANEL_CLICK_NEXT_PAGE="commerce_inventory_panel_click_next_page",s.INVENTORY_PANEL_SETTINGS_OPEN="commerce_inventory_panel_settings_open",s.INVENTORY_PANEL_SETTINGS_CLOSE="commerce_inventory_panel_settings_close",s.INVENTORY_PANEL_SETTINGS_SAVE="commerce_inventory_panel_settings_save",s.INVENTORY_PANEL_SETTINGS_TOGGLE_SCARCITY_PDP="commerce_inventory_panel_settings_toggle_scarcity_pdp",s.INVENTORY_PANEL_SETTINGS_TOGGLE_SCARCITY_BLOCKS="commerce_inventory_panel_settings_toggle_scarcity_blocks",s.INVENTORY_PANEL_SETTINGS_CHANGE_SCARCITY_THRESHOLD="commerce_inventory_panel_settings_change_scarcity_threshold",s.FACEBOOK_DYNAMIC_ADS_PRODUCTS_FEED_URL_COPY="commerce_facebook_ads_feed_url_copy",s.FACEBOOK_PIXEL_SAVE_ID="commerce_facebook_pixel_save_id",s})(L||{});const c=L;var D=(function(s){return s.API_KEY_CREATION_MODAL_COPY="api_key_creation_modal_copy",s.API_KEY_CREATION_MODAL_CANCEL="api_key_creation_modal_cancel",s.API_KEY_CREATION_MODAL_NEXT="api_key_creation_modal_next",s.API_KEY_CREATION_MODAL_COMPLETE="api_key_creation_modal_complete",s.API_KEYS_PANEL_CREATE_KEY="api_keys_panel_create_key",s.API_KEYS_PANEL_LEARN_MORE="api_keys_panel_learn_more",s.API_KEYS_PANEL_DELETE_KEY="api_keys_panel_delete_key",s.API_KEYS_PANEL_DELETE_KEY_CONFIRM="api_keys_panel_delete_key_confirm",s})(D||{});const g=D;function I(s){let ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const te=window.top;te.fbq&&te.fbq("track",s,ee)}const P=I;var y=a(775035);const M=()=>trackInternal(CommerceEvent.CART_PAGE_PRODUCT_FORM_OPEN),O=()=>trackInternal(CommerceEvent.CART_PAGE_PRODUCT_FORM_CLOSE),ie=()=>trackInternal(CommerceEvent.CART_PAGE_PRODUCT_FORM_SUBMIT),H=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return P(c.ADD_TO_CART,s)},X=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return P(c.SEARCH,s)},w=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return P(c.SUBSCRIBE_NEWSLETTER,s)},f=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return P(c.VIEW_PRODUCT_PAGE,s)},z=()=>(0,y.Z)("interface_click",{identifier:g.API_KEYS_PANEL_LEARN_MORE}),B=()=>(0,y.Z)("interface_click",{identifier:g.API_KEYS_PANEL_CREATE_KEY}),ce=s=>(0,y.Z)("interface_click",{identifier:g.API_KEYS_PANEL_DELETE_KEY,...s}),e=s=>(0,y.Z)("interface_click",{identifier:g.API_KEYS_PANEL_DELETE_KEY_CONFIRM,...s}),p=s=>(0,y.Z)("interface_click",{identifier:g.API_KEY_CREATION_MODAL_COPY,...s}),r=s=>(0,y.Z)("interface_click",{identifier:g.API_KEY_CREATION_MODAL_NEXT,...s}),Q=s=>(0,y.Z)("interface_click",{identifier:g.API_KEY_CREATION_MODAL_CANCEL,...s}),J=s=>(0,y.Z)("interface_click",{identifier:g.API_KEY_CREATION_MODAL_COMPLETE,...s}),$=()=>
1(0,y.Z)(c.FACEBOOK_DYNAMIC_ADS_PRODUCTS_FEED_URL_COPY),q=()=>(0,y.Z)(c.FACEBOOK_PIXEL_SAVE_ID),E=()=>(0,y.Z)(c.INVENTORY_PANEL_SEARCH_PRODUCTS),Y=()=>(0,y.Z)(c.INVENTORY_PANEL_SORT_ON_NAME),Z=()=>(0,y.Z)(c.INVENTORY_PANEL_SORT_ON_STOCK),j=()=>(0,y.Z)(c.INVENTORY_PANEL_SORT_ON_PRICE),pe=()=>trackInternal(CommerceEvent.INVENTORY_PANEL_CLICK_ROW_EXPANDER),k=()=>trackInternal(CommerceEvent.INVENTORY_PANEL_CLICK_ROW),A=()=>(0,y.Z)(c.INVENTORY_PANEL_CLICK_NEXT_PAGE)})}]);
2
3//# sourceMappingURL=https://sourcemaps.squarespace.net/universal/scripts-compressed/sourcemaps/5b49dae52d4a6915/async-settings-advanced-apikeys-1a976bf9ccde3e40-min.en-US.js.map

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.