shopify_app 19.1.0 → 20.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +1 -1
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +7 -7
- data/README.md +0 -1
- data/app/assets/javascripts/shopify_app/app_bridge_3.1.1.js +10 -0
- data/app/assets/javascripts/shopify_app/app_bridge_redirect.js +1 -1
- data/app/assets/javascripts/shopify_app/app_bridge_utils_3.1.1.js +1 -0
- data/app/assets/javascripts/shopify_app/redirect.js +6 -8
- data/docs/Releasing.md +1 -1
- data/docs/Upgrading.md +1 -0
- data/lib/shopify_app/jobs/webhooks_manager_job.rb +1 -1
- data/lib/shopify_app/version.rb +1 -1
- data/package.json +1 -1
- data/shopify_app.gemspec +2 -2
- metadata +7 -6
- data/app/assets/javascripts/shopify_app/app_bridge_2.0.12.js +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b8ae8364bd81cd0bf10ead72febecbd0069968ebafdbf30e281009acb5df7cd
|
4
|
+
data.tar.gz: 0b80cdb7413c0ef4550736a7d8dfb3cedcc9cd62c97544ac9317c74f5a59e407
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46c3562137cacaa6e4d99c56fb4cc69f18e8710c94d63db8bffba86741d038f834e3ad647c01798ae0e9716d81754237dbb9ad22544c2fb65d350b5b87f323fe
|
7
|
+
data.tar.gz: 656972e623f00f803540a3ea9078613143a6d7d9282af054bf5bdfcc764f25a689a491c8c5000385bd610e10b2456c31abda4b001a1823eefcfa0cb6ec1953d1
|
data/.github/workflows/build.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
Unreleased
|
2
2
|
----------
|
3
3
|
|
4
|
+
20.0.2 (July 7, 2022)
|
5
|
+
----------
|
6
|
+
|
7
|
+
* Bump [Shopify API](https://github.com/Shopify/shopify-api-ruby) to version 11.0.1. It includes [these updates](https://github.com/Shopify/shopify-api-ruby/blob/main/CHANGELOG.md#version-1101). Fix an issue where HMAC signature verification would fail in OAuth flows during API key rotation.
|
8
|
+
|
9
|
+
20.0.1 (July 6, 2022)
|
10
|
+
----------
|
11
|
+
|
12
|
+
* Accept extra keyword arguments to WebhooksManagerJob to ease upgrade path from v18 or older (https://github.com/Shopify/shopify_app/pull/1466)
|
13
|
+
|
14
|
+
20.0.0 (July 4, 2022)
|
15
|
+
----------
|
16
|
+
|
17
|
+
* Bump [Shopify API](https://github.com/Shopify/shopify-api-ruby) to version 11.0.0. It includes [these updates](https://github.com/Shopify/shopify-api-ruby/blob/main/CHANGELOG.md#version-1100). The breaking change relates to the removal of API version `2021-07` support.
|
18
|
+
* Internal update, adding App Bridge 3 for redirect (only). [#1458](https://github.com/Shopify/shopify_app/pull/1458)
|
19
|
+
|
4
20
|
19.1.0 (June 20, 2022)
|
5
21
|
----------
|
6
22
|
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
shopify_app (
|
4
|
+
shopify_app (20.0.2)
|
5
5
|
activeresource
|
6
6
|
browser_sniffer (~> 2.0)
|
7
7
|
jwt (>= 2.2.3)
|
8
8
|
rails (> 5.2.1)
|
9
9
|
redirect_safely (~> 1.0)
|
10
|
-
shopify_api (~>
|
10
|
+
shopify_api (~> 11.0)
|
11
11
|
sprockets-rails (>= 2.0.0)
|
12
12
|
|
13
13
|
GEM
|
@@ -124,7 +124,7 @@ GEM
|
|
124
124
|
nokogiri (1.13.4)
|
125
125
|
mini_portile2 (~> 2.8.0)
|
126
126
|
racc (~> 1.4)
|
127
|
-
oj (3.13.
|
127
|
+
oj (3.13.16)
|
128
128
|
openssl (3.0.0)
|
129
129
|
parallel (1.21.0)
|
130
130
|
parser (3.1.0.0)
|
@@ -194,7 +194,7 @@ GEM
|
|
194
194
|
rubocop (~> 1.24)
|
195
195
|
ruby-progressbar (1.11.0)
|
196
196
|
securerandom (0.2.0)
|
197
|
-
shopify_api (
|
197
|
+
shopify_api (11.0.1)
|
198
198
|
concurrent-ruby
|
199
199
|
hash_diff
|
200
200
|
httparty
|
@@ -204,8 +204,8 @@ GEM
|
|
204
204
|
securerandom
|
205
205
|
sorbet-runtime
|
206
206
|
zeitwerk (~> 2.5)
|
207
|
-
sorbet-runtime (0.5.
|
208
|
-
sprockets (4.
|
207
|
+
sorbet-runtime (0.5.10141)
|
208
|
+
sprockets (4.1.1)
|
209
209
|
concurrent-ruby (~> 1.0)
|
210
210
|
rack (> 1, < 3)
|
211
211
|
sprockets-rails (3.4.2)
|
@@ -224,7 +224,7 @@ GEM
|
|
224
224
|
websocket-driver (0.7.5)
|
225
225
|
websocket-extensions (>= 0.1.0)
|
226
226
|
websocket-extensions (0.1.5)
|
227
|
-
zeitwerk (2.
|
227
|
+
zeitwerk (2.6.0)
|
228
228
|
|
229
229
|
PLATFORMS
|
230
230
|
ruby
|
data/README.md
CHANGED
@@ -6,7 +6,6 @@
|
|
6
6
|
|
7
7
|
[gem]: https://img.shields.io/gem/v/shopify_app.svg
|
8
8
|
[gem_url]: https://rubygems.org/gems/shopify_app
|
9
|
-
[supported_rails_version]: https://img.shields.io/badge/rails-%3C6.2.0-orange
|
10
9
|
|
11
10
|
This gem builds Rails applications that can be embedded in the Shopify Admin.
|
12
11
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("app-bridge",[],e):"object"==typeof exports?exports["app-bridge"]=e():t["app-bridge"]=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NonSnakeCaseGroup=e.findMatchInEnum=e.forEachInEnum=e.getMergedProps=e.updateActionFromPayload=e.isValidOptionalString=e.isValidOptionalNumber=e.getEventNameSpace=e.getVersion=e.actionWrapper=void 0;var i=r(13),a=o(r(25)),s=r(1),u=r(26);function c(){return u.version}function p(t,e){var r=a.default(t,e);return r||Object.assign(t,e)}e.actionWrapper=function(t){return n(n({},t),{version:c(),clientInterface:{name:u.name,version:c()}})},e.getVersion=c,e.getEventNameSpace=function(t,r,n){if(r.startsWith(""+i.PREFIX+i.SEPARATOR))return r;var o=function(t){if(e.NonSnakeCaseGroup.includes(t))return t.toUpperCase();return(r=t,r.replace(/([A-Z])/g,(function(t,e,r){return(0===r?"":"_")+t[0].toLowerCase()}))).toUpperCase();var r}(t);if(n){var a=n.subgroups,s=n.type;a&&a.length>0&&(o+=o.length>0?i.SEPARATOR:"",a.forEach((function(t,e){o+=""+t.toUpperCase()+(e<a.length-1?i.SEPARATOR:"")}))),s!==t&&s&&(o+=""+(o.length>0?i.SEPARATOR:"")+s.toUpperCase())}return o&&(o+=""+(o.length>0?i.SEPARATOR:"")+r.toUpperCase()),""+i.PREFIX+i.SEPARATOR+o},e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t},e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,p(t,e)),!0)},e.getMergedProps=p,e.forEachInEnum=function(t,e){Object.keys(t).forEach((function(r){e(t[r])}))},e.findMatchInEnum=function(t,e){var r=Object.keys(t).find((function(r){return e===t[r]}));return r?t[r]:void 0},e.NonSnakeCaseGroup=[s.Group.AuthCode,s.Group.Button,s.Group.ButtonGroup,s.Group.Cart,s.Group.Error,s.Group.Features,s.Group.Fullscreen,s.Group.Link,s.Group.Loading,s.Group.Menu,s.Group.Modal,s.Group.Navigation,s.Group.Pos,s.Group.Print,s.Group.ResourcePicker,s.Group.Scanner,s.Group.SessionToken,s.Group.Share,s.Group.TitleBar,s.Group.Toast,s.Group.unstable_Picker]},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ComponentType=e.Group=void 0,function(t){t.AuthCode="AuthCode",t.Button="Button",t.ButtonGroup="ButtonGroup",t.Cart="Cart",t.Client="Client",t.ContextualSaveBar="ContextualSaveBar",t.Error="Error",t.Features="Features",t.FeedbackModal="FeedbackModal",t.Fullscreen="Fullscreen",t.LeaveConfirmation="LeaveConfirmation",t.Link="Link",t.Loading="Loading",t.Menu="Menu",t.Modal="Modal",t.Navigation="Navigation",t.Performance="Performance",t.Pos="Pos",t.Print="Print",t.ResourcePicker="Resource_Picker",t.unstable_Picker="unstable_Picker",t.Scanner="Scanner",t.SessionToken="SessionToken",t.Share="Share",t.TitleBar="TitleBar",t.Toast="Toast",t.MarketingExternalActivityTopBar="MarketingExternalActivityTopBar"}(e.Group||(e.Group={})),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup"}(e.ComponentType||(e.ComponentType={}))},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ActionSetWithChildren=e.ActionSet=void 0;var u=r(4),c=r(8),p=r(3),f=r(1),l=s(r(34)),h=r(0),d=function(){function t(t,e,r,n){var o=this;this.app=t,this.type=e,this.group=r,this.subgroups=[],this.subscriptions=[],t||p.throwError(p.Action.INVALID_ACTION,"Missing required `app`"),this.id=n||l.default(),this.defaultGroup=r;var i=this.set;this.set=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return o.app.hooks?(t=o.app.hooks).run.apply(t,a([u.LifecycleHook.UpdateAction,i,o],e)):i.apply(o,e)}}return t.prototype.set=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},Object.defineProperty(t.prototype,"component",{get:function(){return{id:this.id,subgroups:this.subgroups,type:this.type}},enumerable:!1,configurable:!0}),t.prototype.updateSubscription=function(t,e,r){var n,o=t.eventType,i=t.callback,a=t.component;return(n=this.subscriptions.findIndex((function(e){return e===t})))>=0?this.subscriptions[n].unsubscribe():n=void 0,this.group=e,this.subgroups=r,Object.assign(a,{subgroups:this.subgroups}),this.subscribe(o,i,a,n)},t.prototype.error=function(t){var e=this,r=[];return h.forEachInEnum(p.Action,(function(n){r.push(e.subscriptions.length),e.subscribe(n,t)})),function(){r.map((function(t){return e.subscriptions[t]})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))}},t.prototype.subscribe=function(t,e,r,n){var o,a=this,s=r||this.component,u=t.toUpperCase(),c="number"==typeof n?e:e.bind(this);o=p.isErrorEventName(t)?h.getEventNameSpace(f.Group.Error,t,i(i({},s),{type:""})):h.getEventNameSpace(this.group,t,s);var l=this.app.subscribe(o,c,r?r.id:this.id),d={eventType:u,unsubscribe:l,callback:c,component:s,updateSubscribe:function(t,e){return a.updateSubscription(d,t,e)}};return"number"==typeof n&&n>=0&&n<this.subscriptions.length?this.subscriptions[n]=d:this.subscriptions.push(d),l},t.prototype.unsubscribe=function(t){return void 0===t&&(t=!1),A(this.subscriptions,this.defaultGroup,t),this},t}();e.ActionSet=d;var y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=[],e}return o(e,t),e.prototype.unsubscribe=function(t,r){return void 0===t&&(t=!0),void 0===r&&(r=!1),A(this.subscriptions,this.defaultGroup,r),this.children.forEach((function(r){r instanceof e?r.unsubscribe(t,!t):r.unsubscribe(!t)})),this},e.prototype.getChild=function(t){var e=this.children.findIndex((function(e){return e.id===t}));return e>=0?this.children[e]:void 0},e.prototype.getChildIndex=function(t){return this.children.findIndex((function(e){return e.id===t}))},e.prototype.getChildSubscriptions=function(t,e){return this.subscriptions.filter((function(r){return r.component.id===t&&(!e||e===r.eventType)}))},e.prototype.addChild=function(t,r,n){var o=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||r===t.group&&n===t.subgroups||(i.forEach((function(t){(0,t.updateSubscribe)(r,n)})),Object.assign(t,{group:r,subgroups:n}),t instanceof e&&t.children.forEach((function(t){return o.addChild(t,r,n)}))),this},e.prototype.removeChild=function(t){var e=this;return c.removeFromCollection(this.children,this.getChild(t),(function(){e.subscriptions.filter((function(e){return e.component.id===t})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))})),this},e.prototype.subscribeToChild=function(t,e,r){var n=this,o=r.bind(this);if(e instanceof Array)return e.forEach((function(e){return n.subscribeToChild(t,e,r)})),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),a=this.getChildSubscriptions(t.id,i);if(a.length>0)a.forEach((function(e){return e.updateSubscribe(n.group,t.subgroups)}));else{var s={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,o,s)}return this},e.prototype.getUpdatedChildActions=function(t,e){if(0!==t.length){for(var r=t.filter((function(t,e,r){return e===r.indexOf(t)})),n=r.map((function(t){return t.id})),o=e.filter((function(t){return n.indexOf(t.id)<0}));o.length>0;){if(!(i=o.pop()))break;this.removeChild(i.id)}return r}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(d);function A(t,e,r){void 0===r&&(r=!1),t.forEach((function(t){r?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()})),r||(t.length=0)}e.ActionSetWithChildren=y},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=e.fromAction=e.AppBridgeError=e.invalidOriginAction=e.isErrorEventName=e.permissionAction=e.networkAction=e.persistenceAction=e.unsupportedOperationAction=e.unexpectedAction=e.invalidAction=e.invalidActionType=e.invalidPayload=e.Message=e.AppActionType=e.Action=void 0;var n,o=r(0),i=r(1);function a(t,e,r){var n=e.payload;return o.actionWrapper({type:t,group:i.Group.Error,payload:{action:e,message:r,type:t,id:n&&n.id?n.id:void 0}})}!function(t){t.INVALID_ACTION="APP::ERROR::INVALID_ACTION",t.INVALID_ACTION_TYPE="APP::ERROR::INVALID_ACTION_TYPE",t.INVALID_PAYLOAD="APP::ERROR::INVALID_PAYLOAD",t.INVALID_OPTIONS="APP::ERROR::INVALID_OPTIONS",t.UNEXPECTED_ACTION="APP::ERROR::UNEXPECTED_ACTION",t.PERSISTENCE="APP::ERROR::PERSISTENCE",t.UNSUPPORTED_OPERATION="APP::ERROR::UNSUPPORTED_OPERATION",t.NETWORK="APP::ERROR::NETWORK",t.PERMISSION="APP::ERROR::PERMISSION",t.FAILED_AUTHENTICATION="APP::ERROR::FAILED_AUTHENTICATION",t.INVALID_ORIGIN="APP::ERROR::INVALID_ORIGIN"}(n=e.Action||(e.Action={})),function(t){t.INVALID_CONFIG="APP::ERROR::INVALID_CONFIG",t.MISSING_CONFIG="APP::APP_ERROR::MISSING_CONFIG",t.MISSING_APP_BRIDGE_MIDDLEWARE="APP::APP_ERROR::MISSING_APP_BRIDGE_MIDDLEWARE",t.WINDOW_UNDEFINED="APP::APP_ERROR::WINDOW_UNDEFINED",t.REDUX_REINSTANTIATED="APP::APP_ERROR::REDUX_REINSTANTIATED",t.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN",t.MISSING_HOST_PROVIDER="APP::APP_ERROR::MISSING_HOST_PROVIDER",t.MISSING_ROUTER_CONTEXT="APP::APP_ERROR::MISSING_ROUTER_CONTEXT",t.MISSING_HISTORY_BLOCK="APP::APP_ERROR::MISSING_HISTORY_BLOCK"}(e.AppActionType||(e.AppActionType={})),function(t){t.MISSING_PAYLOAD="Missing payload",t.INVALID_PAYLOAD_ID="Id in payload is missing or invalid"}(e.Message||(e.Message={})),e.invalidPayload=function(t,e){return a(n.INVALID_PAYLOAD,t,e||"The action's payload is missing required properties or has invalid properties")},e.invalidActionType=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:n.INVALID_ACTION_TYPE},type:n.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:n.INVALID_ACTION},type:n.INVALID_ACTION})},e.unexpectedAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:n.UNEXPECTED_ACTION},type:n.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return a(n.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return a(n.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return a(n.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return a(n.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof o.findMatchInEnum(n,t)},e.invalidOriginAction=function(t){return o.actionWrapper({group:i.Group.Error,payload:{message:t,type:n.INVALID_ORIGIN},type:n.INVALID_ORIGIN})};var s=function(t){this.name="AppBridgeError",this.message=t,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(this.message).stack};function u(t,e,r){var n=new s(t?e+": "+t:e);return n.action=r,n.type=e,n}e.AppBridgeError=s,s.prototype=Object.create(Error.prototype),e.fromAction=u,e.throwError=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r,n,o=t[0];throw"string"==typeof t[1]?r=t[1]:(n=t[1],r=t[2]||""),u(r,o,n)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LifecycleHook=e.MessageType=e.PermissionType=e.isV1Config=void 0,e.isV1Config=function(t){return void 0!==t.shopOrigin},function(t){t.Dispatch="Dispatch",t.Subscribe="Subscribe"}(e.PermissionType||(e.PermissionType={})),function(t){t.GetState="getState",t.Dispatch="dispatch",t.Subscribe="subscribe",t.Unsubscribe="unsubscribe"}(e.MessageType||(e.MessageType={})),function(t){t.UpdateAction="UpdateAction",t.DispatchAction="DispatchAction"}(e.LifecycleHook||(e.LifecycleHook={}))},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Button=e.isValidButtonProps=e.update=e.clickButton=e.Style=e.Icon=e.Action=void 0;var a,s=r(0),u=r(2),c=r(1);function p(t,e,r){var n=e.id,o=s.getEventNameSpace(t,a.CLICK,e),i={id:n,payload:r};return s.actionWrapper({type:o,group:t,payload:i})}function f(t,e,r){var n=e.id,o=r.label,u=s.getEventNameSpace(t,a.UPDATE,e),c=i(i({},r),{id:n,label:o});return s.actionWrapper({type:u,group:t,payload:c})}!function(t){t.CLICK="CLICK",t.UPDATE="UPDATE"}(a=e.Action||(e.Action={})),function(t){t.Print="print"}(e.Icon||(e.Icon={})),function(t){t.Danger="danger"}(e.Style||(e.Style={})),e.clickButton=p,e.update=f,e.isValidButtonProps=function(t){return"string"==typeof t.id&&"string"==typeof t.label};var l=function(t){function e(e,r){var n=t.call(this,e,c.ComponentType.Button,c.Group.Button)||this;return n.disabled=!1,n.loading=!1,n.plain=!1,n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{disabled:this.disabled,icon:this.icon,label:this.label,style:this.style,loading:this.loading,plain:this.plain}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=s.getMergedProps(this.options,t),n=r.label,o=r.disabled,i=r.icon,u=r.style,c=r.loading,p=r.plain;return this.label=n,this.disabled=Boolean(o),this.icon=i,this.style=u,this.loading=Boolean(c),this.plain=Boolean(p),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case a.CLICK:this.app.dispatch(p(this.group,this.component,e));break;case a.UPDATE:var r=f(this.group,this.component,this.payload);this.app.dispatch(r)}return this},e}(u.ActionSet);e.Button=l,e.create=function(t,e){return new l(t,e)}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(12);o(r(4),e),o(r(12),e),e.default=i.createClientApp},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSingleButton=void 0;var n=r(5);e.getSingleButton=function(t,e,r,o){return t.addChild(e,t.group,r),t.subscribeToChild(e,n.Action.UPDATE,o),e.payload}},function(t,e,r){"use strict";function n(t,e,r){var n=t.findIndex((function(t){return t===e}));return n>=0&&(t.splice(n,1),r&&r(e),!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.removeFromCollection=e.addAndRemoveFromCollection=void 0,e.addAndRemoveFromCollection=function(t,e,r){return t.push(e),function(){return n(t,e,r)}},e.removeFromCollection=n},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ButtonGroup=e.isGroupedButtonPayload=e.isGroupedButton=e.update=e.Action=void 0;var a,s=r(7),u=r(0),c=r(2),p=r(1);function f(t,e,r){return function(t,e,r,n,o){var a=e.id,s=n.label,c=u.getEventNameSpace(t,r,e),p=i(i({},n),{id:a,label:s,payload:o});return u.actionWrapper({type:c,group:t,payload:p})}(t,e,a.UPDATE,r)}!function(t){t.UPDATE="UPDATE"}(a=e.Action||(e.Action={})),e.update=f,e.isGroupedButton=function(t){var e=t;return e.buttons&&e.buttons.length>0&&void 0!==e.label},e.isGroupedButtonPayload=function(t){var e=t;return Array.isArray(e.buttons)&&"string"==typeof e.id&&"string"==typeof e.label};var l=function(t){function e(e,r){var n=t.call(this,e,p.ComponentType.ButtonGroup,p.Group.ButtonGroup)||this;return n.disabled=!1,n.plain=!1,n.buttonsOptions=[],n.buttons=[],n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{buttons:this.buttonsOptions,disabled:this.disabled,label:this.label,plain:this.plain}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=u.getMergedProps(this.options,t),n=r.label,o=r.disabled,i=r.buttons,s=r.plain;return this.label=n,this.disabled=Boolean(o),this.buttons=this.getButtons(i),this.plain=Boolean(s),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:var e=f(this.group,this.component,this.payload);this.app.dispatch(e)}return this},e.prototype.updateButtons=function(t){if(this.buttons&&0!==this.buttons.length){for(var e,r=0,n=this.buttons;r<n.length;r++){var o=n[r];if(e=u.updateActionFromPayload(o,t))break}e&&this.dispatch(a.UPDATE)}},e.prototype.getSingleButton=function(t){return s.getSingleButton(this,t,this.subgroups,this.updateButtons)},e.prototype.getButtons=function(t){var e=this,r=[];return t?(t.forEach((function(t){var n=s.getSingleButton(e,t,e.subgroups,e.updateButtons);r.push(n)})),this.buttonsOptions=t,r):[]},e}(c.ActionSetWithChildren);e.ButtonGroup=l,e.create=function(t,e){return new l(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Toast=e.clear=e.show=e.Action=void 0;var a,s=r(0),u=r(2),c=r(1);function p(t){return s.actionWrapper({group:c.Group.Toast,payload:t,type:a.SHOW})}function f(t){return s.actionWrapper({payload:t,group:c.Group.Toast,type:a.CLEAR})}!function(t){t.SHOW="APP::TOAST::SHOW",t.CLEAR="APP::TOAST::CLEAR"}(a=e.Action||(e.Action={})),e.show=p,e.clear=f;var l=function(t){function e(e,r){var n=t.call(this,e,c.Group.Toast,c.Group.Toast)||this;return n.message="",n.duration=5e3,n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{duration:this.duration,isError:this.isError,message:this.message}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){var e=s.getMergedProps(this.options,t),r=e.message,n=e.duration,o=e.isError;return this.message=r,this.duration=n,this.isError=o,this},e.prototype.dispatch=function(t){switch(t){case a.SHOW:var e=p(this.payload);this.app.dispatch(e);break;case a.CLEAR:this.app.dispatch(f({id:this.id}))}return this},e}(u.ActionSet);e.Toast=l,e.create=function(t,e){return new l(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.AppLink=e.update=e.Action=void 0;var a,s=r(0),u=r(2),c=r(1),p=r(22);function f(t,e,r){var n=e.id,o=r.label,u=r.destination,c=i(i({},r),{id:n,label:o,destination:u});return s.actionWrapper({group:t,type:s.getEventNameSpace(t,a.UPDATE,e),payload:c})}!function(t){t.UPDATE="UPDATE"}(a=e.Action||(e.Action={})),e.update=f;var l=function(t){function e(e,r){var n=t.call(this,e,c.Group.Link,c.Group.Link)||this;return n.label="",n.destination="",n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{label:this.label,destination:this.destination,redirectType:p.Action.APP}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){var t=this.options,e=t.label,r=t.destination,n=t.redirectType,o=r;return{id:this.id,label:e,destination:{path:o},redirectType:n}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=s.getMergedProps(this.options,t),n=r.label,o=r.destination;return this.label=n,this.destination=o,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:var e=f(this.group,this.component,this.payload);this.app.dispatch(e)}return this},e}(u.ActionSet);e.AppLink=l,e.create=function(t,e){return new l(t,e)}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createApp=e.createAppWrapper=e.createClientApp=e.WINDOW_UNDEFINED_MESSAGE=void 0;var a=r(0),s=r(14),u=r(3),c=r(15),p=r(28),f=r(17),l=r(18),h=r(29),d=r(19),y=r(4),A=i(r(30));e.WINDOW_UNDEFINED_MESSAGE="window is not defined. Running an app outside a browser is not supported";function P(t,r,n){if(void 0===n&&(n=[]),!t)throw u.fromAction(e.WINDOW_UNDEFINED_MESSAGE,u.AppActionType.WINDOW_UNDEFINED);var o=d.getLocation(),i=r||o&&o.origin;if(!i)throw u.fromAction("local origin cannot be blank",u.AppActionType.MISSING_LOCAL_ORIGIN);var a=c.fromWindow(t,i);return e.createClientApp(a,n)}function E(t){var e=d.getWindow();return e&&e.top?P(e.top)(t):p.serverAppBridge}e.createClientApp=function(t,e){void 0===e&&(e=[]);var r=[],i=c.createTransportListener();return t.subscribe((function(t){var e=t.data,n=e.type,o=e.payload;switch(n){case"getState":r.splice(0).forEach((function(t){return t(o)}));break;case"dispatch":if(i.handleMessage(o),i.handleActionDispatch(o))return;var s=a.findMatchInEnum(u.Action,o.type);s&&u.throwError(s,o)}})),function(c){var p=function(t){var e;if(!t.host)throw u.fromAction("host must be provided",u.AppActionType.INVALID_CONFIG);if(!t.apiKey)throw u.fromAction("apiKey must be provided",u.AppActionType.INVALID_CONFIG);try{var r=atob(null===(e=t.host)||void 0===e?void 0:e.replace(/_/g,"/").replace(/-/g,"+"));return n(n({},t),{host:r})}catch(t){throw u.fromAction("not a valid host, please use the value provided by Shopify",u.AppActionType.INVALID_CONFIG)}}(c),P=function(t,e){return function(r,n){t.dispatch({payload:n,source:e,type:r})}}(t,p),E=i.createSubscribeHandler(P);function v(t){return P(y.MessageType.Dispatch,t),t}P(y.MessageType.Unsubscribe),function(t,e){var r=e.apiKey,n=e.host,o=e.forceRedirect,i=void 0===o?!f.isDevelopmentClient:o,a=d.getLocation();if(!f.isUnframed&&a&&r&&n&&i&&d.shouldRedirect(t)){var s="https://"+n+"/apps/"+r+a.pathname+(a.search||"");d.redirect(s)}}(t.hostFrame,p);for(var g=new URL("https://"+p.host).origin,_=new A.default,O={hostOrigin:g,localOrigin:t.localOrigin,hooks:_,dispatch:function(t){return O.hooks?O.hooks.run(y.LifecycleHook.DispatchAction,v,O,t):v(t)},featuresAvailable:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=Array.isArray(r)?o([],r):t;return O.getState("features").then((function(t){return n.length?n.reduce((function(e,r){return Object.keys(t).includes(r)&&(e[r]=t[r]),e}),{}):t}))},getState:function(t){return t&&"string"!=typeof t?Promise.resolve(void 0):new Promise((function(t){r.push(t),P(y.MessageType.GetState)})).then((function(e){var r=e;if(t)for(var n=0,o=t.split(".");n<o.length;n++){var i=o[n];if(null==r||"object"!=typeof r||Array.isArray(r)||!Object.keys(r).includes(i))return;r=r[i]}return r}))},subscribe:E,error:function(t,e){var r=[];return a.forEachInEnum(u.Action,(function(n){r.push(E(n,t,e))})),function(){r.forEach((function(t){return t()}))}}},b=0,T=e;b<T.length;b++){(0,T[b])(_,O)}return function(t){t.subscribe(s.Action.APP,h.handleAppPrint),t.dispatch(l.initialize())}(O),O}},e.createAppWrapper=P,e.createApp=E,e.default=E},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SEPARATOR=e.PREFIX=void 0,e.PREFIX="APP",e.SEPARATOR="::"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.app=e.Action=void 0;var n,o=r(0),i=r(1);!function(t){t.APP="APP::PRINT::APP"}(n=e.Action||(e.Action={})),e.app=function(){return o.actionWrapper({group:i.Group.Print,type:n.APP})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createTransportListener=e.fromWindow=e.fromFrame=e.Context=void 0;var n=r(3),o=r(16),i=r(4),a=r(8),s=r(17);!function(t){t.Modal="Modal",t.Main="Main"}(e.Context||(e.Context={})),e.fromFrame=function(t,e,r){var i=[],u=t.host,c=t.window;if(!u)throw n.fromAction("App frame is undefined",n.AppActionType.WINDOW_UNDEFINED);return s.isUnframed&&window.MobileWebView&&Object.assign(window.MobileWebView,{postMessageToIframe:function(t,e){null==c||c.postMessage(t,e),function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&"dispatch"===t.type&&"object"==typeof t.payload}(t)&&u.postMessage(JSON.stringify(t.payload),location.origin)},updateIframeUrl:function(r){var n=window.location,o=(t.window||{}).location;try{new URL(r).origin===e&&o?o.replace(r):n.href=r}catch(t){}}}),u.addEventListener("message",(function(t){if(t.source!==u&&o.isAppMessage(t))if(t.origin===e)if(s.isUnframed&&window.MobileWebView){p=JSON.stringify({id:"unframed://fromClient",origin:e,data:t.data});window.MobileWebView.postMessage(p)}else for(var r=0,a=i;r<a.length;r++){(0,a[r])(t)}else{var p,f="Message origin '"+t.origin+"' does not match app origin '"+e+"'.",l={type:"dispatch",payload:p=n.invalidOriginAction(f)};null==c||c.postMessage(l,t.origin)}})),{context:r,localOrigin:e,frameWindow:c,hostFrame:u,dispatch:function(t){null==c||c.postMessage(t,e)},subscribe:function(t){return a.addAndRemoveFromCollection(i,t)}}},e.fromWindow=function(t,e){var r=[];return void 0!==typeof window&&window.addEventListener("message",(function(e){if((window!==t||s.isUnframed)&&e.source===t&&(o.isAppBridgeAction(e.data.payload)||o.isAppMessage(e)))for(var n=0,i=r;n<i.length;n++){(0,i[n])(e)}})),{localOrigin:e,hostFrame:t,dispatch:function(r){var n;if(null===(n=r.source)||void 0===n?void 0:n.host)if(s.isUnframed&&window&&window.MobileWebView){var o=JSON.stringify({id:"unframed://fromClient",origin:e,data:r});window.MobileWebView.postMessage(o)}else{var i=new URL("https://"+r.source.host).origin;t.postMessage(r,i)}},subscribe:function(t){return a.addAndRemoveFromCollection(r,t)}}},e.createTransportListener=function(){var t=[],e={};return{createSubscribeHandler:function(r){return function(){if(arguments.length<2)return a.addAndRemoveFromCollection(t,{callback:arguments[0]});var n=Array.from(arguments),o=n[0],s=n[1],u=n[2],c={callback:s,id:u},p={type:o,id:u};return Object.prototype.hasOwnProperty.call(e,o)||(e[o]=[]),r&&r(i.MessageType.Subscribe,p),a.addAndRemoveFromCollection(e[o],c,(function(){r&&r(i.MessageType.Unsubscribe,p)}))}},handleMessage:function(e){t.forEach((function(t){return t.callback(e)}))},handleActionDispatch:function(t){var r=t.type,n=t.payload,o=!1;if(Object.prototype.hasOwnProperty.call(e,r))for(var i=0,a=e[r];i<a.length;i++){var s=a[i],u=s.id,c=s.callback;!(n&&n.id===u)&&u||(c(n),o=!0)}return o}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAppMessage=e.isPermitted=e.getPermissionKey=e.isFromApp=e.isAppBridgeAction=void 0;var n=r(4),o=r(13),i=r(0);function a(t){return t.replace(new RegExp("^"+o.PREFIX+o.SEPARATOR+"\\w+"+o.SEPARATOR),"")}e.isAppBridgeAction=function(t){return t instanceof Object&&Object.prototype.hasOwnProperty.call(t,"type")&&t.type.toString().startsWith(o.PREFIX)},e.isFromApp=function(t){return"object"==typeof t&&"object"==typeof t.source&&"string"==typeof t.source.apiKey},e.getPermissionKey=a,e.isPermitted=function(t,e,r){var n=e.group,o=e.type;if(!n||!Object.prototype.hasOwnProperty.call(t,n))return!1;var i=t[n];if(!i)return!1;var s=a(o);return!!i[s]&&!0===i[s][r]},e.isAppMessage=function(t){if("object"!=typeof t||!t.data||"object"!=typeof t.data)return!1;var e=t.data;return Object.prototype.hasOwnProperty.call(e,"type")&&void 0!==i.findMatchInEnum(n.MessageType,e.type)}},function(t,e,r){"use strict";(function(t){var r,n;Object.defineProperty(e,"__esModule",{value:!0}),e.isUnframed=e.isDevelopmentClient=e.isProduction=e.isDevelopment=e.isClient=e.isServer=void 0,e.isServer="undefined"==typeof window,e.isClient=!e.isServer,e.isDevelopment=void 0!==t&&t.env&&!1,e.isProduction=!e.isDevelopment,e.isDevelopmentClient=e.isDevelopment&&e.isClient,e.isUnframed=e.isClient&&(null===(n=null===(r=window.navigator)||void 0===r?void 0:r.userAgent)||void 0===n?void 0:n.indexOf("Unframed"))>0}).call(this,r(27))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initialize=e.Action=void 0;var n,o=r(1),i=r(0);!function(t){t.INITIALIZE="APP::CLIENT::INITIALIZE"}(n=e.Action||(e.Action={})),e.initialize=function(){return i.actionWrapper({group:o.Group.Client,type:n.INITIALIZE})}},function(t,e,r){"use strict";function n(){return o()?window.location:void 0}function o(){return"undefined"!=typeof window}Object.defineProperty(e,"__esModule",{value:!0}),e.getWindow=e.getLocation=e.redirect=e.shouldRedirect=void 0,e.shouldRedirect=function(t){return t===window},e.redirect=function(t){var e=n();e&&e.assign(t)},e.getLocation=n,e.getWindow=function(){return o()?window:void 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=void 0,function(t){t.UPDATE="APP::FEATURES::UPDATE",t.REQUEST="APP::FEATURES::REQUEST",t.REQUEST_UPDATE="APP::FEATURES::REQUEST::UPDATE"}(e.Action||(e.Action={}))},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ModalIframe=e.ModalMessage=e.Modal=e.isMessageModal=e.isIframeModal=e.data=e.update=e.clickFooterButton=e.updateModalSize=e.closeModal=e.openModal=e.Size=e.Action=void 0;var a,s,u=r(7),c=r(0),p=r(2),f=r(1),l=r(5);!function(t){t.OPEN="APP::MODAL::OPEN",t.CLOSE="APP::MODAL::CLOSE",t.UPDATE="APP::MODAL::UPDATE",t.UPDATE_CONTENT="APP::MODAL::CONTENT::UPDATE",t.FOOTER_BUTTON_CLICK="APP::MODAL::FOOTER::BUTTON::CLICK",t.FOOTER_BUTTON_UPDATE="APP::MODAL::FOOTER::BUTTON::UPDATE",t.UPDATE_SIZE="APP::MODAL::UPDATE_SIZE",t.DATA="APP::MODAL::DATA"}(a=e.Action||(e.Action={})),function(t){t.Small="small",t.Medium="medium",t.Large="large",t.Full="full",t.Auto="auto"}(s=e.Size||(e.Size={}));var h={group:f.Group.Modal,subgroups:["Footer"],type:f.ComponentType.Button};function d(t){return c.actionWrapper({group:f.Group.Modal,payload:t,type:a.OPEN})}function y(t){return c.actionWrapper({group:f.Group.Modal,payload:t,type:a.CLOSE})}function A(t){return c.actionWrapper({payload:t,group:f.Group.Modal,type:a.UPDATE})}function P(t){return c.actionWrapper({payload:t,group:f.Group.Modal,type:a.DATA})}function E(t){return"string"==typeof t.url||"string"==typeof t.path}e.openModal=d,e.closeModal=y,e.updateModalSize=function(t){return c.actionWrapper({group:f.Group.Modal,payload:t,type:a.UPDATE_SIZE})},e.clickFooterButton=function(t,e){var r=i({id:t},h);return l.clickButton(f.Group.Modal,r,e)},e.update=A,e.data=P,e.isIframeModal=E,e.isMessageModal=function(t){return"string"==typeof t.message};var v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=s.Small,e}return o(e,t),Object.defineProperty(e.prototype,"footer",{get:function(){if(this.footerPrimary||this.footerSecondary)return{buttons:{primary:this.footerPrimary,secondary:this.footerSecondary}}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"footerOptions",{get:function(){if(this.footerPrimaryOptions||this.footerSecondaryOptions)return{buttons:{primary:this.footerPrimaryOptions,secondary:this.footerSecondaryOptions}}},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.app.dispatch(y({id:this.id}))},e.prototype.setFooterPrimaryButton=function(t,e){var r=this,n=h.subgroups;this.footerPrimaryOptions=this.getChildButton(t,this.footerPrimaryOptions),this.footerPrimary=this.footerPrimaryOptions?u.getSingleButton(this,this.footerPrimaryOptions,n,(function(t){r.updatePrimaryFooterButton(t,e)})):void 0},e.prototype.setFooterSecondaryButtons=function(t,e){var r=this,n=h.subgroups,o=t||[],i=this.footerOptions&&this.footerOptions.buttons.secondary||[];this.footerSecondaryOptions=this.getUpdatedChildActions(o,i),this.footerSecondary=this.footerSecondaryOptions?this.footerSecondaryOptions.map((function(t){return u.getSingleButton(r,t,n,(function(t){r.updateSecondaryFooterButton(t,e)}))})):void 0},e.prototype.getChildButton=function(t,e){var r=t?[t]:[],n=e?[e]:[],o=this.getUpdatedChildActions(r,n);return o?o[0]:void 0},e.prototype.updatePrimaryFooterButton=function(t,e){this.footer&&this.footer.buttons.primary&&c.updateActionFromPayload(this.footer.buttons.primary,t)&&e()},e.prototype.updateSecondaryFooterButton=function(t,e){if(this.footer&&this.footer.buttons&&this.footer.buttons.secondary){for(var r,n=0,o=this.footer.buttons.secondary;n<o.length;n++){var i=o[n];if(r=c.updateActionFromPayload(i,t))break}r&&e()}},e}(p.ActionSetWithChildren);e.Modal=v;var g=function(t){function e(e,r){var n=t.call(this,e,f.Group.Modal,f.Group.Modal)||this;return n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{footer:this.footer,id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,message:this.message,size:this.size,title:this.title}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){var r=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),o=n.title,i=n.footer,s=n.message,u=n.size;return this.title=o,this.message=s,this.size=u,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,(function(){r.dispatch(a.UPDATE)})),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,(function(){r.dispatch(a.UPDATE)})),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.OPEN:this.app.dispatch(d(this.payload));break;case a.CLOSE:this.close();break;case a.UPDATE:this.app.dispatch(A(this.payload))}return this},e}(v);e.ModalMessage=g;var _=function(t){function e(e,r){var n=t.call(this,e,f.Group.Modal,f.Group.Modal)||this;return n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{footer:this.footer,id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,path:this.path,size:this.size,title:this.title,url:this.url,loading:this.loading}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){var r=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),o=n.title,i=n.footer,s=n.path,u=n.url,p=n.size,f=n.loading;return this.title=o,this.url=u,this.path=s,this.size=p,this.loading=f,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,(function(){r.dispatch(a.UPDATE)})),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,(function(){r.dispatch(a.UPDATE)})),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case a.OPEN:this.app.dispatch(d(this.payload));break;case a.CLOSE:this.close();break;case a.UPDATE:this.app.dispatch(A(this.payload));break;case a.DATA:this.app.dispatch(P(e||{}))}return this},e}(v);e.ModalIframe=_;e.create=function(t,e){return E(e)?new _(t,e):new g(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Redirect=e.isRemotePayload=e.isAdminSectionPayload=e.isAdminPathPayload=e.isAppPayload=e.toDestination=e.toApp=e.toRemote=e.toAdminSection=e.toAdminPath=e.isProductVariantCreateResourcePayload=e.isProductVariantResourcePayload=e.isCreateResourcePayload=e.isResourcePayload=e.ResourceType=e.Action=void 0;var a,s=r(0),u=r(2),c=r(1);function p(t){return!0===t.create}function f(t){var e=t;return void 0!==e.id&&void 0!==e.variant}function l(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:a.ADMIN_PATH})}function h(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:a.ADMIN_SECTION})}function d(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:a.REMOTE})}function y(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:a.APP})}function A(t,e,r){switch(t){case a.APP:var n=P(e)?e:{path:e};return y(i({id:r},n));case a.ADMIN_PATH:var o=E(e)?e:{path:e};return l(i({id:r},o));case a.ADMIN_SECTION:var s=v(e)?e:{section:e};return h(i({id:r},s));case a.REMOTE:var u=g(e)?e:{url:e};return d(i({id:r},u))}}function P(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"path")}function E(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"path")}function v(t){return"object"==typeof t&&"object"==typeof t.section&&Object.prototype.hasOwnProperty.call(t.section,"name")}function g(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"url")}!function(t){t.ADMIN_SECTION="APP::NAVIGATION::REDIRECT::ADMIN::SECTION",t.ADMIN_PATH="APP::NAVIGATION::REDIRECT::ADMIN::PATH",t.REMOTE="APP::NAVIGATION::REDIRECT::REMOTE",t.APP="APP::NAVIGATION::REDIRECT::APP"}(a=e.Action||(e.Action={})),function(t){t.Product="products",t.Collection="collections",t.Order="orders",t.Customer="customers",t.Discount="discounts"}(e.ResourceType||(e.ResourceType={})),e.isResourcePayload=function(t){return"string"==typeof t.id},e.isCreateResourcePayload=p,e.isProductVariantResourcePayload=f,e.isProductVariantCreateResourcePayload=function(t){return!!f(t)&&p(t.variant)},e.toAdminPath=l,e.toAdminSection=h,e.toRemote=d,e.toApp=y,e.toDestination=A,e.isAppPayload=P,e.isAdminPathPayload=E,e.isAdminSectionPayload=v,e.isRemotePayload=g;var _=function(t){function e(e){return t.call(this,e,"Redirect",c.Group.Navigation)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t,e){var r=A(t,e,this.payload.id);return this.app.dispatch(r),this},e}(u.ActionSet);e.Redirect=_,e.create=function(t){return new _(t)}},function(t,e,r){"use strict";(function(t){
|
2
|
+
/*!
|
3
|
+
* The buffer module from node.js, for the browser.
|
4
|
+
*
|
5
|
+
* @author Feross Aboukhadijeh <http://feross.org>
|
6
|
+
* @license MIT
|
7
|
+
*/
|
8
|
+
var n=r(63),o=r(64),i=r(65);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=l(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=s(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|h(e.length);return 0===(t=s(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):l(t,e);if("Buffer"===e.type&&i(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function p(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(p(e),t=s(t,e<0?0:0|h(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|h(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function h(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return x(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return m(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function A(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function P(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:E(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):E(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function E(t,e,r,n,o){var i,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var p=-1;for(i=r;i<s;i++)if(c(t,i)===c(e,-1===p?0:i-p)){if(-1===p&&(p=i),i-p+1===u)return p*a}else-1!==p&&(i-=i-p),p=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var f=!0,l=0;l<u;l++)if(c(t,i+l)!==c(e,l)){f=!1;break}if(f)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function g(t,e,r,n){return W(F(e,t.length-r),t,r,n)}function _(t,e,r,n){return W(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function O(t,e,r,n){return _(t,e,r,n)}function b(t,e,r,n){return W(x(e),t,r,n)}function T(t,e,r,n){return W(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function m(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,s,u,c=t[o],p=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(p=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(p=u);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(p=u);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(p=u)}null===p?(p=65533,f=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return c(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return p(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return f(null,t)},u.allocUnsafeSlow=function(t){return f(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)A(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)A(this,e,e+3),A(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)A(this,e,e+7),A(this,e+1,e+6),A(this,e+2,e+5),A(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?m(this,0,t):y.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(i,a),c=this.slice(n,o),p=t.slice(e,r),f=0;f<s;++f)if(c[f]!==p[f]){i=c[f],a=p[f];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return P(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return P(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return O(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function I(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=k(t[i]);return o}function w(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function M(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function U(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,i){return i||L(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,i){return i||L(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var o=e-t;r=new u(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||D(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||D(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):U(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);D(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);D(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):U(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=u.isBuffer(t)?t:F(new u(t,n).toString()),s=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%s]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function k(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function x(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(62))},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createApp=e.default=e.actions=void 0;var i=r(6),a=r(31);Object.defineProperty(e,"actions",{enumerable:!0,get:function(){return a.compatibilityActions}});var s=r(59);function u(t){return s.compatibilityCreateApp(t,i.createApp)}o(r(67),e),e.default=u,e.createApp=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,r){if(null==r)return r;if(void 0===e||!Object.prototype.isPrototypeOf.call(Object.getPrototypeOf(e),r)||"Object"!==r.constructor.name&&"Array"!==r.constructor.name)return r;var n={};return Object.keys(r).forEach((function(o){Object.prototype.hasOwnProperty.call(e,o)?"object"!=typeof e[o]||Array.isArray(e[o])?n[o]=r[o]:n[o]=t(e[o],r[o]):n[o]=r[o]})),Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(r,t)||(n[t]=e[t])})),Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}},function(t){t.exports=JSON.parse('{"name":"@shopify/app-bridge","version":"3.1.1","types":"index.d.ts","main":"index.js","unpkg":"umd/index.js","jsdelivr":"umd/index.js","files":["/actions/","/client/","/umd/","/util/","/validate/","/development.d.ts","/development.js","/index.d.ts","/index.js","/MessageTransport.d.ts","/MessageTransport.js","/production.d.ts","/production.js"],"private":false,"publishConfig":{"access":"public","@shopify:registry":"https://registry.npmjs.org"},"repository":"git@github.com:Shopify/app-bridge.git","homepage":"https://shopify.dev/tools/app-bridge","author":"Shopify Inc.","license":"MIT","scripts":{"build":"yarn build:tsc && yarn build:npm && yarn build:umd","build:tsc":"NODE_ENV=production tsc","build:umd":"NODE_ENV=production webpack -p","build:npm":"shx cp -r ./npm/index.js ./index.js","check":"tsc","clean":"cat package.json | node -pe \\"JSON.parse(require(\'fs\').readFileSync(\'/dev/stdin\').toString()).files.map(f => \'./\'+f).join(\' \')\\" | xargs rm -rf","pack":"yarn pack","size":"size-limit"},"sideEffects":false,"size-limit":[{"limit":"17 KB","path":"production.js"}],"dependencies":{"base64url":"^3.0.1"},"devDependencies":{"@types/node":"^10.12.5","shx":"^0.3.3"}}')},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,c=[],p=!1,f=-1;function l(){p&&u&&(p=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!p){var t=s(l);p=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,p=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||p||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.serverAppBridge=void 0;var n=r(3),o=function(){};e.serverAppBridge={dispatch:function(){return{}},error:function(){return o},featuresAvailable:function(){return Promise.reject(n.fromAction("Feature detection is only available on the client side.",n.AppActionType.WINDOW_UNDEFINED))},getState:function(){return Promise.reject(n.fromAction("State is only available on the client side.",n.AppActionType.WINDOW_UNDEFINED))},localOrigin:"",hostOrigin:"",subscribe:function(){return o}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.handleAppPrint=void 0;var n=r(19);function o(){var t;null===(t=n.getWindow())||void 0===t||t.print()}function i(){var t=function(){var t=n.getWindow();if(t&&t.document&&t.document.body){var e=t.document.createElement("input");return e.style.display="none",t.document.body.appendChild(e),e}}();t&&(t.select(),o(),t.remove())}e.handleAppPrint=function(){navigator.userAgent.indexOf("iOS")>=0?i():o()}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8),o=function(){function t(){this.map={}}return t.prototype.set=function(t,e){Object.prototype.hasOwnProperty.call(this.map,t)||(this.map[t]=[]);var r={handler:e,remove:function(){}},o=n.addAndRemoveFromCollection(this.map[t],r);return r={handler:e,remove:o},o},t.prototype.get=function(t){var e=this.map[t];return e?e.map((function(t){return t.handler})):void 0},t.prototype.run=function(t,e,r){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];var i=0,a=this.get(t)||[];function s(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=a[i++];return o?o(s).apply(r,t):e.apply(r,t)}return s.apply(r,n)},t}();e.default=o},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&o(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.compatibilityActions=void 0;var s=a(r(32));e.compatibilityActions=Object.entries(s).reduce((function(t,e){var r,o,i=e[0],a=e[1];return Object.keys(s.Group).includes(i)?n(n({},t),((o={})[i]=n(n({},a),{ActionType:a.Action}),o)):n(n({},t),((r={})[i]=a,r))}),{})},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e},a=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.unstable_Picker=e.Performance=e.Pos=e.AppLink=e.ChannelMenu=e.NavigationMenu=e.Share=e.ContextualSaveBar=e.MarketingExternalActivityTopBar=e.TitleBar=e.SessionToken=e.ResourcePicker=e.Redirect=e.Print=e.ModalContent=e.Modal=e.Loading=e.LeaveConfirmation=e.History=e.Toast=e.Fullscreen=e.FeedbackModal=e.Features=e.Flash=e.Error=e.Client=e.Cart=e.Scanner=e.ButtonGroup=e.Button=e.AuthCode=e.isAppBridgeAction=void 0;var s=i(r(33));e.AuthCode=s;var u=i(r(5));e.Button=u;var c=i(r(9));e.ButtonGroup=c;var p=i(r(35));e.Cart=p;var f=i(r(18));e.Client=f;var l=i(r(3));e.Error=l;var h=i(r(36));e.Flash=h;var d=i(r(38));e.Features=d;var y=i(r(40));e.FeedbackModal=y;var A=i(r(41));e.Fullscreen=A;var P=i(r(42));e.LeaveConfirmation=P;var E=i(r(43));e.Loading=E;var v=i(r(21));e.Modal=v;var g=i(r(44));e.ModalContent=g;var _=i(r(45));e.History=_;var O=i(r(22));e.Redirect=O;var b=i(r(14));e.Print=b;var T=i(r(46));e.ResourcePicker=T;var S=i(r(47));e.Scanner=S;var m=i(r(48));e.SessionToken=m;var R=i(r(49));e.TitleBar=R;var C=i(r(10));e.Toast=C;var I=i(r(51));e.ContextualSaveBar=I;var w=i(r(52));e.Share=w;var M=i(r(53));e.NavigationMenu=M;var D=i(r(54));e.ChannelMenu=D;var N=i(r(11));e.AppLink=N;var U=i(r(55));e.Pos=U;var L=i(r(56));e.MarketingExternalActivityTopBar=L;var j=i(r(57));e.Performance=j;var B=i(r(58));e.unstable_Picker=B;var G=r(16);Object.defineProperty(e,"isAppBridgeAction",{enumerable:!0,get:function(){return G.isAppBridgeAction}}),a(r(1),e)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.respond=e.request=e.Action=void 0;var n,o=r(0),i=r(1);!function(t){t.REQUEST="APP::AUTH_CODE::REQUEST",t.RESPOND="APP::AUTH_CODE::RESPOND"}(n=e.Action||(e.Action={})),e.request=function(t){return o.actionWrapper({group:i.Group.AuthCode,type:n.REQUEST,payload:{id:t}})},e.respond=function(t){return o.actionWrapper({payload:t,group:i.Group.AuthCode,type:n.RESPOND})}},function(t,e,r){"use strict";function n(t){return Array.from(t).map((function(t){return("00"+t.toString(16)).slice(-2)})).join("")}function o(t){if("function"==typeof Uint8Array&&"object"==typeof window&&window.crypto){var e=new Uint8Array(t),r=window.crypto.getRandomValues(e);if(r)return r}return Array.from(new Array(t),(function(){return 255*Math.random()|0}))}function i(){var t=o(1),e=o(2);return t[0]&=191,e[0]&=79,[n(o(4)),"-",n(o(2)),"-",n(e),"-",n(t),n(o(1)),"-",n(o(6))].join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=void 0,e.generateUuid=i,e.default=i},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Cart=e.setLineItemProperties=e.removeLineItemDiscount=e.setLineItemDiscount=e.removeLineItem=e.updateLineItem=e.addLineItem=e.removeProperties=e.setProperties=e.setDiscount=e.updateCustomerAddress=e.addCustomerAddress=e.setCustomer=e.update=e.fetch=e.Action=void 0;var a,s=r(0),u=r(2),c=r(1);function p(t,e){return void 0===e&&(e={}),s.actionWrapper({group:c.Group.Cart,type:t,payload:e})}!function(t){t.FETCH="APP::CART::FETCH",t.UPDATE="APP::CART::UPDATE",t.SET_CUSTOMER="APP::CART::SET_CUSTOMER",t.REMOVE_CUSTOMER="APP::CART::REMOVE_CUSTOMER",t.ADD_CUSTOMER_ADDRESS="APP::CART::ADD_CUSTOMER_ADDRESS",t.UPDATE_CUSTOMER_ADDRESS="APP::CART::UPDATE_CUSTOMER_ADDRESS",t.SET_DISCOUNT="APP::CART::SET_DISCOUNT",t.REMOVE_DISCOUNT="APP::CART::REMOVE_DISCOUNT",t.SET_PROPERTIES="APP::CART::SET_PROPERTIES",t.REMOVE_PROPERTIES="APP::CART::REMOVE_PROPERTIES",t.CLEAR="APP::CART::CLEAR",t.ADD_LINE_ITEM="APP::CART::ADD_LINE_ITEM",t.UPDATE_LINE_ITEM="APP::CART::UPDATE_LINE_ITEM",t.REMOVE_LINE_ITEM="APP::CART::REMOVE_LINE_ITEM",t.SET_LINE_ITEM_DISCOUNT="APP::CART::SET_LINE_ITEM_DISCOUNT",t.REMOVE_LINE_ITEM_DISCOUNT="APP::CART::REMOVE_LINE_ITEM_DISCOUNT",t.SET_LINE_ITEM_PROPERTIES="APP::CART::SET_LINE_ITEM_PROPERTIES",t.REMOVE_LINE_ITEM_PROPERTIES="APP::CART::REMOVE_LINE_ITEM_PROPERTIES"}(a=e.Action||(e.Action={})),e.fetch=function(){return p(a.FETCH)},e.update=function(t){return p(a.UPDATE,t)},e.setCustomer=function(t){return p(a.SET_CUSTOMER,t)},e.addCustomerAddress=function(t){return p(a.ADD_CUSTOMER_ADDRESS,t)},e.updateCustomerAddress=function(t){return p(a.UPDATE_CUSTOMER_ADDRESS,t)},e.setDiscount=function(t){return p(a.SET_DISCOUNT,t)},e.setProperties=function(t){return p(a.SET_PROPERTIES,t)},e.removeProperties=function(t){return p(a.REMOVE_PROPERTIES,t)},e.addLineItem=function(t){return p(a.ADD_LINE_ITEM,t)},e.updateLineItem=function(t){return p(a.UPDATE_LINE_ITEM,t)},e.removeLineItem=function(t){return p(a.REMOVE_LINE_ITEM,t)},e.setLineItemDiscount=function(t){return p(a.SET_LINE_ITEM_DISCOUNT,t)},e.removeLineItemDiscount=function(t){return p(a.REMOVE_LINE_ITEM_DISCOUNT,t)},e.setLineItemProperties=function(t){return p(a.SET_LINE_ITEM_PROPERTIES,t)};var f=function(t){function e(e,r){return t.call(this,e,c.Group.Cart,c.Group.Cart,r?r.id:void 0)||this}return o(e,t),e.prototype.dispatch=function(t,e){switch(t){case a.FETCH:this.dispatchCartAction(a.FETCH);break;case a.UPDATE:this.dispatchCartAction(a.UPDATE,e);break;case a.SET_CUSTOMER:this.dispatchCartAction(a.SET_CUSTOMER,e);break;case a.REMOVE_CUSTOMER:this.dispatchCartAction(a.REMOVE_CUSTOMER,e);break;case a.ADD_CUSTOMER_ADDRESS:this.dispatchCartAction(a.ADD_CUSTOMER_ADDRESS,e);break;case a.UPDATE_CUSTOMER_ADDRESS:this.dispatchCartAction(a.UPDATE_CUSTOMER_ADDRESS,e);break;case a.SET_DISCOUNT:this.dispatchCartAction(a.SET_DISCOUNT,e);break;case a.REMOVE_DISCOUNT:this.dispatchCartAction(a.REMOVE_DISCOUNT,e);break;case a.SET_PROPERTIES:this.dispatchCartAction(a.SET_PROPERTIES,e);break;case a.REMOVE_PROPERTIES:this.dispatchCartAction(a.REMOVE_PROPERTIES,e);break;case a.CLEAR:this.dispatchCartAction(a.CLEAR,e);break;case a.ADD_LINE_ITEM:this.dispatchCartAction(a.ADD_LINE_ITEM,e);break;case a.UPDATE_LINE_ITEM:this.dispatchCartAction(a.UPDATE_LINE_ITEM,e);break;case a.REMOVE_LINE_ITEM:this.dispatchCartAction(a.REMOVE_LINE_ITEM,e);break;case a.SET_LINE_ITEM_DISCOUNT:this.dispatchCartAction(a.SET_LINE_ITEM_DISCOUNT,e);break;case a.REMOVE_LINE_ITEM_DISCOUNT:this.dispatchCartAction(a.REMOVE_LINE_ITEM_DISCOUNT,e);break;case a.SET_LINE_ITEM_PROPERTIES:this.dispatchCartAction(a.SET_LINE_ITEM_PROPERTIES,e);break;case a.REMOVE_LINE_ITEM_PROPERTIES:this.dispatchCartAction(a.REMOVE_LINE_ITEM_PROPERTIES,e)}return this},e.prototype.dispatchCartAction=function(t,e){this.app.dispatch(p(t,i(i({},e),{id:this.id})))},e}(u.ActionSet);e.Cart=f,e.create=function(t,e){return new f(t,e)}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(37),e)},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Flash=e.FlashAction=e.ShowAction=e.show=e.ClearAction=e.clear=e.ActionBase=void 0;var i=r(10),a=r(10);Object.defineProperty(e,"ActionBase",{enumerable:!0,get:function(){return a.ActionBase}}),Object.defineProperty(e,"clear",{enumerable:!0,get:function(){return a.clear}}),Object.defineProperty(e,"ClearAction",{enumerable:!0,get:function(){return a.ClearAction}}),Object.defineProperty(e,"show",{enumerable:!0,get:function(){return a.show}}),Object.defineProperty(e,"ShowAction",{enumerable:!0,get:function(){return a.ShowAction}}),Object.defineProperty(e,"FlashAction",{enumerable:!0,get:function(){return a.ToastAction}});var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i.Toast);e.Flash=s,e.create=function(t,e){return new s(t,e)}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(39),e),o(r(20),e)},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Features=void 0;var a=r(0),s=r(2),u=r(1),c=r(20),p=function(t){function e(e,r){return t.call(this,e,u.Group.Features,u.Group.Features,r?r.id:void 0)||this}return o(e,t),e.prototype.dispatch=function(t,e){switch(t){case c.Action.REQUEST:this.dispatchFeaturesAction(c.Action.REQUEST,e)}return this},e.prototype.dispatchFeaturesAction=function(t,e){this.app.dispatch(a.actionWrapper({group:u.Group.Features,type:t,payload:i(i({},e||{}),{id:this.id})}))},e}(s.ActionSet);e.Features=p,e.create=function(t,e){return new p(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.FeedbackModal=e.close=e.open=e.Action=void 0;var a,s=r(0),u=r(2),c=r(1);function p(t){return s.actionWrapper({group:c.Group.FeedbackModal,payload:t,type:a.OPEN})}function f(t){return s.actionWrapper({group:c.Group.FeedbackModal,payload:t,type:a.CLOSE})}!function(t){t.OPEN="APP::FEEDBACK_MODAL::OPEN",t.CLOSE="APP::FEEDBACK_MODAL::CLOSE"}(a=e.Action||(e.Action={})),e.open=p,e.close=f;var l=function(t){function e(e,r){var n=t.call(this,e,c.Group.FeedbackModal,c.Group.FeedbackModal)||this;return n.options=r,n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){return this.options=s.getMergedProps(this.options,t),this},e.prototype.dispatch=function(t){switch(t){case a.OPEN:var e=p(this.payload);this.app.dispatch(e);break;case a.CLOSE:var r=f(this.payload);this.app.dispatch(r)}return this},e}(u.ActionSet);e.FeedbackModal=l,e.create=function(t,e){return new l(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Fullscreen=e.exit=e.enter=e.Action=void 0;var i,a=r(0),s=r(2),u=r(1);!function(t){t.ENTER="APP::FULLSCREEN::ENTER",t.EXIT="APP::FULLSCREEN::EXIT"}(i=e.Action||(e.Action={})),e.enter=function(){return a.actionWrapper({group:u.Group.Fullscreen,type:i.ENTER})},e.exit=function(){return a.actionWrapper({group:u.Group.Fullscreen,type:i.EXIT})};var c=function(t){function e(e){return t.call(this,e,u.Group.Fullscreen,u.Group.Fullscreen)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t){return this.app.dispatch(a.actionWrapper({group:this.group,type:t,payload:this.payload})),this},e}(s.ActionSet);e.Fullscreen=c,e.create=function(t){return new c(t)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.LeaveConfirmation=e.confirm=e.disable=e.enable=e.Action=void 0;var a,s=r(0),u=r(2),c=r(1);function p(t){return void 0===t&&(t={}),s.actionWrapper({group:c.Group.LeaveConfirmation,payload:t,type:a.ENABLE})}function f(t){return void 0===t&&(t={}),s.actionWrapper({group:c.Group.LeaveConfirmation,payload:t,type:a.DISABLE})}function l(t){return void 0===t&&(t={}),s.actionWrapper({group:c.Group.LeaveConfirmation,payload:t,type:a.CONFIRM})}!function(t){t.ENABLE="APP::LEAVE_CONFIRMATION::ENABLE",t.DISABLE="APP::LEAVE_CONFIRMATION::DISABLE",t.CONFIRM="APP::LEAVE_CONFIRMATION::CONFIRM"}(a=e.Action||(e.Action={})),e.enable=p,e.disable=f,e.confirm=l;var h=function(t){function e(e,r){void 0===r&&(r={});var n=t.call(this,e,c.Group.LeaveConfirmation,c.Group.LeaveConfirmation)||this;return n.options=r,n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){return this.options=s.getMergedProps(this.options,t),this},e.prototype.dispatch=function(t){switch(t){case a.ENABLE:var e=p(this.payload);this.app.dispatch(e);break;case a.DISABLE:var r=f(this.payload);this.app.dispatch(r);break;case a.CONFIRM:var n=l(this.payload);this.app.dispatch(n)}return this},e}(u.ActionSet);e.LeaveConfirmation=h,e.create=function(t,e){return void 0===e&&(e={}),new h(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Loading=e.stop=e.start=e.Action=void 0;var i,a=r(0),s=r(2),u=r(1);function c(t){return a.actionWrapper({payload:t,group:u.Group.Loading,type:i.START})}function p(t){return a.actionWrapper({payload:t,group:u.Group.Loading,type:i.STOP})}!function(t){t.START="APP::LOADING::START",t.STOP="APP::LOADING::STOP"}(i=e.Action||(e.Action={})),e.start=c,e.stop=p;var f=function(t){function e(e){return t.call(this,e,u.Group.Loading,u.Group.Loading)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t){switch(t){case i.START:this.app.dispatch(c(this.payload));break;case i.STOP:this.app.dispatch(p(this.payload))}return this},e}(s.ActionSet);e.Loading=f,e.create=function(t){return new f(t)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ModalContent=e.Action=void 0;var u,c=r(0),p=r(2),f=r(1),l=r(21);!function(t){t.LOADING="LOADING",t.LOADED="LOADED"}(u=e.Action||(e.Action={}));var h=function(t){function e(e,r){return t.call(this,e,f.Group.Modal,f.Group.Modal,r?r.id:void 0)||this}return o(e,t),e.prototype.loaded=function(){this.dispatch(u.LOADED)},e.prototype.loading=function(){this.dispatch(u.LOADING)},e.prototype.dispatch=function(t){switch(t){case u.LOADED:this.dispatchModalAction(l.Action.UPDATE_CONTENT,{loading:!1});break;case u.LOADING:this.dispatchModalAction(l.Action.UPDATE_CONTENT,{loading:!0})}return this},e.prototype.dispatchModalAction=function(t,e){return a(this,void 0,void 0,(function(){var r;return s(this,(function(n){return r=c.actionWrapper({type:t,group:f.Group.Modal,payload:i({},e)}),this.app.dispatch(r),[2]}))}))},e}(p.ActionSet);e.ModalContent=h,e.create=function(t,e){return new h(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.History=e.replace=e.push=e.Action=void 0;var a,s=r(0),u=r(2),c=r(1);function p(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:a.PUSH})}function f(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:a.REPLACE})}!function(t){t.PUSH="APP::NAVIGATION::HISTORY::PUSH",t.REPLACE="APP::NAVIGATION::HISTORY::REPLACE"}(a=e.Action||(e.Action={})),e.push=p,e.replace=f;var l=function(t){function e(e){return t.call(this,e,"History",c.Group.Navigation)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t,e){var r=i(i({},this.payload),{path:e});switch(t){case a.PUSH:this.app.dispatch(p(r));break;case a.REPLACE:this.app.dispatch(f(r))}return this},e}(u.ActionSet);e.History=l,e.create=function(t){return new l(t)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ResourcePicker=e.update=e.close=e.cancel=e.open=e.select=e.ActionVerb=e.ResourceType=e.ProductStatus=e.ProductVariantInventoryManagement=e.ProductVariantInventoryPolicy=e.WeightUnit=e.FulfillmentServiceType=e.CollectionSortOrder=e.Action=void 0;var a,s,u,c=r(0),p=r(2),f=r(1);function l(t){return c.actionWrapper({payload:t,group:f.Group.ResourcePicker,type:a.SELECT})}function h(t){return c.actionWrapper({payload:t,group:f.Group.ResourcePicker,type:a.OPEN})}function d(t){return c.actionWrapper({payload:t,group:f.Group.ResourcePicker,type:a.CANCEL})}function y(t){return c.actionWrapper({payload:t,group:f.Group.ResourcePicker,type:a.UPDATE})}!function(t){t.OPEN="APP::RESOURCE_PICKER::OPEN",t.SELECT="APP::RESOURCE_PICKER::SELECT",t.CLOSE="APP::RESOURCE_PICKER::CLOSE",t.UPDATE="APP::RESOURCE_PICKER::UPDATE",t.CANCEL="APP::RESOURCE_PICKER::CANCEL"}(a=e.Action||(e.Action={})),function(t){t.Manual="MANUAL",t.BestSelling="BEST_SELLING",t.AlphaAsc="ALPHA_ASC",t.AlphaDesc="ALPHA_DESC",t.PriceDesc="PRICE_DESC",t.PriceAsc="PRICE_ASC",t.CreatedDesc="CREATED_DESC",t.Created="CREATED"}(e.CollectionSortOrder||(e.CollectionSortOrder={})),function(t){t.GiftCard="GIFT_CARD",t.Manual="MANUAL",t.ThirdParty="THIRD_PARTY"}(e.FulfillmentServiceType||(e.FulfillmentServiceType={})),function(t){t.Kilograms="KILOGRAMS",t.Grams="GRAMS",t.Pounds="POUNDS",t.Ounces="OUNCES"}(e.WeightUnit||(e.WeightUnit={})),function(t){t.Deny="DENY",t.Continue="CONTINUE"}(e.ProductVariantInventoryPolicy||(e.ProductVariantInventoryPolicy={})),function(t){t.Shopify="SHOPIFY",t.NotManaged="NOT_MANAGED",t.FulfillmentService="FULFILLMENT_SERVICE"}(e.ProductVariantInventoryManagement||(e.ProductVariantInventoryManagement={})),function(t){t.Active="ACTIVE",t.Archived="ARCHIVED",t.Draft="DRAFT"}(e.ProductStatus||(e.ProductStatus={})),function(t){t.Product="product",t.ProductVariant="variant",t.Collection="collection"}(s=e.ResourceType||(e.ResourceType={})),function(t){t.Add="add",t.Select="select"}(u=e.ActionVerb||(e.ActionVerb={})),e.select=l,e.open=h,e.cancel=d,e.close=function(t){return c.actionWrapper({payload:t,group:f.Group.ResourcePicker,type:a.CANCEL})},e.update=y;var A=function(t){function e(e,r,n){var o=t.call(this,e,f.Group.ResourcePicker,f.Group.ResourcePicker)||this;return o.initialSelectionIds=[],o.selection=[],o.resourceType=n,o.set(r,!1),o}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{id:this.id,resourceType:this.resourceType})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){var t={initialQuery:this.initialQuery,selectMultiple:this.selectMultiple,initialSelectionIds:this.initialSelectionIds,showHidden:this.showHidden,actionVerb:this.actionVerb};return this.resourceType===s.Product?i(i({},t),{showVariants:this.showVariants,showDraft:this.showDraft,showArchived:this.showArchived,showDraftBadge:this.showDraftBadge,showArchivedBadge:this.showArchivedBadge}):t},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=c.getMergedProps(this.options,t),n=r.initialQuery,o=r.initialSelectionIds,i=void 0===o?[]:o,a=r.showHidden,s=void 0===a||a,p=r.showVariants,f=void 0===p||p,l=r.showDraft,h=void 0===l||l,d=r.showArchived,y=void 0===d||d,A=r.showDraftBadge,P=void 0!==A&&A,E=r.showArchivedBadge,v=void 0!==E&&E,g=r.selectMultiple,_=void 0===g||g,O=r.actionVerb,b=void 0===O?u.Add:O;return this.initialQuery=n,this.initialSelectionIds=i,this.showHidden=s,this.showVariants=f,this.showDraft=h,this.showArchived=y,this.showDraftBadge=P,this.showArchivedBadge=v,this.selectMultiple=_,this.actionVerb=b,e&&this.update(),this},e.prototype.dispatch=function(t,e){return t===a.OPEN?this.open():t===a.UPDATE?this.update():t===a.CLOSE||t===a.CANCEL?this.cancel():t===a.SELECT&&(this.selection=e,this.app.dispatch(l({id:this.id,selection:this.selection}))),this},e.prototype.update=function(){this.app.dispatch(y(this.payload))},e.prototype.open=function(){this.app.dispatch(h(this.payload))},e.prototype.cancel=function(){this.app.dispatch(d({id:this.id}))},e.prototype.close=function(){this.cancel()},e}(p.ActionSet);e.ResourcePicker=A;e.create=function(t,e){var r=e.resourceType,n=e.options;return new A(t,void 0===n?{}:n,r)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.capture=e.openCamera=e.create=e.Scanner=e.Action=void 0;var i,a=r(0),s=r(2),u=r(1);!function(t){t.OPEN_CAMERA="APP::SCANNER::OPEN::CAMERA",t.CAPTURE="APP::SCANNER::CAPTURE"}(i=e.Action||(e.Action={}));var c=function(t){function e(e,r){return t.call(this,e,u.Group.Scanner,u.Group.Scanner,r?r.id:void 0)||this}return o(e,t),e.prototype.dispatch=function(t){switch(t){case i.OPEN_CAMERA:this.dispatchScannerAction(i.OPEN_CAMERA)}return this},e.prototype.dispatchScannerAction=function(t){this.app.dispatch(a.actionWrapper({type:t,group:u.Group.Scanner,payload:{id:this.id}}))},e}(s.ActionSet);e.Scanner=c,e.create=function(t,e){return new c(t,e)},e.openCamera=function(){return a.actionWrapper({group:u.Group.Scanner,type:i.OPEN_CAMERA})},e.capture=function(t){return a.actionWrapper({group:u.Group.Scanner,type:i.CAPTURE,payload:t})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.respond=e.request=e.Action=void 0;var n,o=r(0),i=r(1);!function(t){t.REQUEST="APP::SESSION_TOKEN::REQUEST",t.RESPOND="APP::SESSION_TOKEN::RESPOND"}(n=e.Action||(e.Action={})),e.request=function(){return o.actionWrapper({group:i.Group.SessionToken,type:n.REQUEST})},e.respond=function(t){return o.actionWrapper({payload:t,group:i.Group.SessionToken,type:n.RESPOND})}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.TitleBar=e.update=e.clickBreadcrumb=e.clickActionButton=e.Action=void 0;var a,s=r(5),u=r(9),c=r(50),p=r(7),f=r(0),l=r(2),h=r(1);!function(t){t.UPDATE="APP::TITLEBAR::UPDATE",t.BUTTON_CLICK="APP::TITLEBAR::BUTTONS::BUTTON::CLICK",t.BUTTON_UPDATE="APP::TITLEBAR::BUTTONS::BUTTON::UPDATE",t.BUTTON_GROUP_UPDATE="APP::TITLEBAR::BUTTONS::BUTTONGROUP::UPDATE",t.BREADCRUMBS_CLICK="APP::TITLEBAR::BREADCRUMBS::BUTTON::CLICK",t.BREADCRUMBS_UPDATE="APP::TITLEBAR::BREADCRUMBS::BUTTON::UPDATE"}(a=e.Action||(e.Action={}));var d={group:h.Group.TitleBar,subgroups:["Buttons"]},y={group:h.Group.TitleBar,subgroups:["Breadcrumbs"],type:h.ComponentType.Button};function A(t){return f.actionWrapper({payload:t,group:h.Group.TitleBar,type:a.UPDATE})}e.clickActionButton=function(t,e){var r=h.ComponentType.Button,n=i({id:t,type:r},d);return s.clickButton(h.Group.TitleBar,n,e)},e.clickBreadcrumb=function(t,e){var r=i({id:t},y);return s.clickButton(h.Group.TitleBar,r,e)},e.update=A;var P=function(t){function e(e,r){var n=t.call(this,e,h.Group.TitleBar,h.Group.TitleBar)||this;return r.title||r.breadcrumbs||r.buttons?(n.set(r),n):n}return o(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{breadcrumbs:this.breadcrumbsOption,buttons:this.buttonsOptions,title:this.title}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{breadcrumbs:this.breadcrumb,buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=f.getMergedProps(this.options,t),n=r.title,o=r.buttons,i=r.breadcrumbs;return this.title=n,this.setBreadcrumbs(i),this.setPrimaryButton(o?o.primary:void 0),this.setSecondaryButton(o?o.secondary:void 0),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(A(this.payload))}return this},e.prototype.getButton=function(t,e,r){return t instanceof u.ButtonGroup?c.getGroupedButton(this,t,e,r):p.getSingleButton(this,t,e,r)},e.prototype.updatePrimaryButton=function(t){this.primary&&f.updateActionFromPayload(this.primary,t)&&this.dispatch(a.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find((function(e){return e.id===t.id}));if(e){(u.isGroupedButtonPayload(t),f.updateActionFromPayload(e,t))&&this.dispatch(a.UPDATE)}}},e.prototype.updateBreadcrumbButton=function(t){this.breadcrumb&&f.updateActionFromPayload(this.breadcrumb,t)&&this.dispatch(a.UPDATE)},e.prototype.setPrimaryButton=function(t){this.primaryOptions=this.getChildButton(t,this.primaryOptions),this.primary=this.primaryOptions?this.getButton(this.primaryOptions,d.subgroups,this.updatePrimaryButton):void 0},e.prototype.setSecondaryButton=function(t){var e=this,r=t||[],n=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(r,n),this.secondary=this.secondaryOptions?this.secondaryOptions.map((function(t){return e.getButton(t,d.subgroups,e.updateSecondaryButtons)})):void 0},e.prototype.setBreadcrumbs=function(t){this.breadcrumbsOption=this.getChildButton(t,this.breadcrumbsOption),this.breadcrumb=this.breadcrumbsOption?this.getButton(this.breadcrumbsOption,y.subgroups,this.updateBreadcrumbButton):void 0},e.prototype.getChildButton=function(t,e){var r=t?[t]:[],n=e?[e]:[],o=this.getUpdatedChildActions(r,n);return o?o[0]:void 0},e}(l.ActionSetWithChildren);e.TitleBar=P,e.create=function(t,e){return new P(t,e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getGroupedButton=void 0;var n=r(9);e.getGroupedButton=function(t,e,r,o){t.addChild(e,t.group,r);var i=e.id,a=e.label,s=e.disabled,u=e.buttons,c=e.plain;return t.subscribeToChild(e,n.Action.UPDATE,o),{id:i,label:a,buttons:u,disabled:s,plain:c}}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ContextualSaveBar=e.discard=e.save=e.hide=e.show=e.Action=void 0;var a,s=r(0),u=r(2),c=r(1);function p(t,e){return s.actionWrapper({group:c.Group.ContextualSaveBar,type:t,payload:e})}!function(t){t.DISCARD="APP::CONTEXTUAL_SAVE_BAR::DISCARD",t.SAVE="APP::CONTEXTUAL_SAVE_BAR::SAVE",t.SHOW="APP::CONTEXTUAL_SAVE_BAR::SHOW",t.HIDE="APP::CONTEXTUAL_SAVE_BAR::HIDE",t.UPDATE="APP::CONTEXTUAL_SAVE_BAR::UPDATE"}(a=e.Action||(e.Action={})),e.show=function(t){return p(a.SHOW,t)},e.hide=function(t){return p(a.HIDE,t)},e.save=function(t){return p(a.SAVE,t)},e.discard=function(t){return p(a.DISCARD,t)};var f=function(t){function e(e,r){void 0===r&&(r={});var n=t.call(this,e,c.Group.ContextualSaveBar,c.Group.ContextualSaveBar)||this;return n.options=r,n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=s.getMergedProps(this.options,t);return this.options=r,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){return this.app.dispatch(p(t,this.payload)),this},e}(u.ActionSet);e.ContextualSaveBar=f,e.create=function(t,e){return new f(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.close=e.show=e.create=e.Share=e.Action=void 0;var a,s=r(1),u=r(0),c=r(2);!function(t){t.SHOW="APP::SHARE::SHOW",t.CLOSE="APP::SHARE::CLOSE"}(a=e.Action||(e.Action={}));var p=function(t){function e(e){return t.call(this,e,s.Group.Share,s.Group.Share)||this}return o(e,t),e.prototype.dispatch=function(t,e){switch(t){case a.SHOW:this.dispatchShareAction(a.SHOW,e);break;default:throw new Error("Action: "+t+" not supported")}return this},e.prototype.dispatchShareAction=function(t,e){this.app.dispatch(u.actionWrapper({type:t,group:s.Group.Share,payload:i({id:this.id},e)}))},e}(c.ActionSet);e.Share=p,e.create=function(t){return new p(t)},e.show=function(){return u.actionWrapper({group:s.Group.Share,type:a.SHOW})},e.close=function(){return u.actionWrapper({group:s.Group.Share,type:a.CLOSE})}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.NavigationMenu=e.update=e.Action=void 0;var a,s=r(11),u=r(0),c=r(2),p=r(1),f=["Navigation_Menu"];function l(t){return u.actionWrapper({payload:t,group:p.Group.Menu,type:a.UPDATE})}!function(t){t.UPDATE="APP::MENU::NAVIGATION_MENU::UPDATE",t.LINK_UPDATE="APP::MENU::NAVIGATION_MENU::LINK::UPDATE"}(a=e.Action||(e.Action={})),e.update=l;var h=function(t){function e(e,r){var n=t.call(this,e,"Navigation_Menu",p.Group.Menu)||this;return n.items=[],n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{items:this.itemsOptions,active:this.activeOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{active:this.active,items:this.items,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=u.getMergedProps(this.options,t),n=r.items,o=r.active;return this.setItems(n),this.activeOptions=o,this.active=o&&o.id,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(l(this.payload))}return this},e.prototype.updateItem=function(t){if(this.items){var e=this.items.find((function(e){return e.id===t.id}));e&&u.updateActionFromPayload(e,t)&&this.dispatch(a.UPDATE)}},e.prototype.setItems=function(t){var e=this,r=t||[],n=this.itemsOptions||[];this.itemsOptions=this.getUpdatedChildActions(r,n),this.items=this.itemsOptions?this.itemsOptions.map((function(t){return e.addChild(t,e.group,f),e.subscribeToChild(t,s.Action.UPDATE,e.updateItem),t.payload})):[]},e}(c.ActionSetWithChildren);e.NavigationMenu=h,e.create=function(t,e){return new h(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ChannelMenu=e.update=e.Action=void 0;var a,s=r(11),u=r(0),c=r(2),p=r(1),f=["Channel_Menu"];function l(t){return u.actionWrapper({payload:t,group:p.Group.Menu,type:a.UPDATE})}!function(t){t.UPDATE="APP::MENU::CHANNEL_MENU::UPDATE",t.LINK_UPDATE="APP::MENU::CHANNEL_MENU::LINK::UPDATE"}(a=e.Action||(e.Action={})),e.update=l;var h=function(t){function e(e,r){var n=t.call(this,e,"Channel_Menu",p.Group.Menu)||this;return n.items=[],n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{items:this.itemsOptions,active:this.activeOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{active:this.active,items:this.items,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=u.getMergedProps(this.options,t),n=r.items,o=r.active;return this.setItems(n),this.activeOptions=o,this.active=o&&o.id,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(l(this.payload))}return this},e.prototype.updateItem=function(t){if(this.items){var e=this.items.find((function(e){return e.id===t.id}));e&&u.updateActionFromPayload(e,t)&&this.dispatch(a.UPDATE)}},e.prototype.setItems=function(t){var e=this,r=t||[],n=this.itemsOptions||[];this.itemsOptions=this.getUpdatedChildActions(r,n),this.items=this.itemsOptions?this.itemsOptions.map((function(t){return e.addChild(t,e.group,f),e.subscribeToChild(t,s.Action.UPDATE,e.updateItem),t.payload})):[]},e}(c.ActionSetWithChildren);e.ChannelMenu=h,e.create=function(t,e){return new h(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Pos=e.close=e.Action=void 0;var i,a=r(0),s=r(2),u=r(1);function c(){return a.actionWrapper({group:u.Group.Pos,type:i.CLOSE})}!function(t){t.CLOSE="APP::POS::CLOSE",t.LOCATION_UPDATE="APP::POS::LOCATION::UPDATE",t.USER_UPDATE="APP::POS::USER::UPDATE",t.DEVICE_UPDATE="APP::POS::DEVICE::UPDATE"}(i=e.Action||(e.Action={})),e.close=c;var p=function(t){function e(e){return t.call(this,e,u.Group.Pos,u.Group.Pos)||this}return o(e,t),e.prototype.dispatch=function(t){switch(t){case i.CLOSE:this.app.dispatch(c())}return this},e}(s.ActionSet);e.Pos=p,e.create=function(t){return new p(t)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.MarketingExternalActivityTopBar=e.update=e.clickActionButton=e.MarketingActivityStatusBadgeType=e.Action=void 0;var a,s=r(5),u=r(7),c=r(0),p=r(2),f=r(1);!function(t){t.UPDATE="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::UPDATE",t.BUTTON_CLICK="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::BUTTONS::BUTTON::CLICK",t.BUTTON_UPDATE="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::BUTTONS::BUTTON::UPDATE"}(a=e.Action||(e.Action={})),function(t){t.Default="DEFAULT",t.Success="SUCCESS",t.Attention="ATTENTION",t.Warning="WARNING",t.Info="INFO"}(e.MarketingActivityStatusBadgeType||(e.MarketingActivityStatusBadgeType={}));var l={group:f.Group.MarketingExternalActivityTopBar,subgroups:["Buttons"]};function h(t){return c.actionWrapper({payload:t,group:f.Group.MarketingExternalActivityTopBar,type:a.UPDATE})}e.clickActionButton=function(t,e){var r=f.ComponentType.Button,n=i({id:t,type:r},l);return s.clickButton(f.Group.MarketingExternalActivityTopBar,n,e)},e.update=h;var d=function(t){function e(e,r){var n=t.call(this,e,f.Group.MarketingExternalActivityTopBar,f.Group.MarketingExternalActivityTopBar)||this;return n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{title:this.title,status:this.status,saving:this.saving,saved:this.saved,buttons:this.buttonsOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=c.getMergedProps(this.options,t),n=r.title,o=r.buttons,i=r.saved,s=r.saving,u=r.status;return this.title=n,this.saving=s,this.saved=i,this.status=u,this.setPrimaryButton(o?o.primary:void 0),this.setSecondaryButtons(o?o.secondary:void 0),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(h(this.payload))}return this},e.prototype.getButton=function(t,e,r){return u.getSingleButton(this,t,e,r)},e.prototype.updatePrimaryButton=function(t){this.primary&&c.updateActionFromPayload(this.primary,t)&&this.dispatch(a.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find((function(e){return e.id===t.id}));if(e)c.updateActionFromPayload(e,t)&&this.dispatch(a.UPDATE)}},e.prototype.setPrimaryButton=function(t){this.primaryOptions=this.getChildButton(t,this.primaryOptions),this.primary=this.primaryOptions?this.getButton(this.primaryOptions,l.subgroups,this.updatePrimaryButton):void 0},e.prototype.setSecondaryButtons=function(t){var e=this,r=t||[],n=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(r,n),this.secondary=this.secondaryOptions?this.secondaryOptions.map((function(t){return e.getButton(t,l.subgroups,e.updateSecondaryButtons)})):void 0},e.prototype.updateSaving=function(t){this.saving=t,this.dispatch(a.UPDATE)},e.prototype.updateSaved=function(t){this.saved=t,this.dispatch(a.UPDATE)},e.prototype.updateStatus=function(t){this.status=t,this.dispatch(a.UPDATE)},e.prototype.getChildButton=function(t,e){var r=t?[t]:[],n=e?[e]:[],o=this.getUpdatedChildActions(r,n);return o?o[0]:void 0},e}(p.ActionSetWithChildren);e.MarketingExternalActivityTopBar=d,e.create=function(t,e){return new d(t,e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fullPageLoad=e.skeletonPageLoad=e.Action=void 0;var n,o=r(1),i=r(0);!function(t){t.SKELETON_PAGE_LOAD="APP::PERFORMANCE::SKELETON_PAGE_LOAD",t.FULL_PAGE_LOAD="APP::PERFORMANCE::FULL_PAGE_LOAD"}(n=e.Action||(e.Action={})),e.skeletonPageLoad=function(){return i.actionWrapper({group:o.Group.Performance,type:n.SKELETON_PAGE_LOAD})},e.fullPageLoad=function(){return i.actionWrapper({group:o.Group.Performance,type:n.FULL_PAGE_LOAD})}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.unstable_Picker=e.loadMore=e.search=e.update=e.cancel=e.open=e.select=e.Action=void 0;var a,s=r(0),u=r(2),c=r(1);function p(t){return s.actionWrapper({payload:t,group:c.Group.unstable_Picker,type:a.SELECT})}function f(t){return s.actionWrapper({payload:t,group:c.Group.unstable_Picker,type:a.OPEN})}function l(t){return s.actionWrapper({payload:t,group:c.Group.unstable_Picker,type:a.CANCEL})}function h(t){return s.actionWrapper({payload:t,group:c.Group.unstable_Picker,type:a.UPDATE})}function d(t){return s.actionWrapper({payload:t,group:c.Group.unstable_Picker,type:a.SEARCH})}function y(t){return s.actionWrapper({payload:t,group:c.Group.unstable_Picker,type:a.LOAD_MORE})}!function(t){t.OPEN="APP::PICKER::OPEN",t.SELECT="APP::PICKER::SELECT",t.UPDATE="APP::PICKER::UPDATE",t.CANCEL="APP::PICKER::CANCEL",t.SEARCH="APP::PICKER::SEARCH",t.LOAD_MORE="APP::PICKER::LOAD_MORE"}(a=e.Action||(e.Action={})),e.select=p,e.open=f,e.cancel=l,e.update=h,e.search=d,e.loadMore=y;var A=function(t){function e(e,r){var n=t.call(this,e,c.Group.unstable_Picker,c.Group.unstable_Picker)||this;return n.items=[],n.selectedItems=[],n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{items:this.items,maxSelectable:this.maxSelectable,selectedItems:this.selectedItems,title:this.title,loading:this.loading,searchQuery:this.searchQuery,searchQueryPlaceholder:this.searchQueryPlaceholder,primaryActionLabel:this.primaryActionLabel,secondaryActionLabel:this.secondaryActionLabel,emptySearchLabel:this.emptySearchLabel}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=s.getMergedProps(this.options,t),n=r.selectedItems,o=void 0===n?[]:n,i=r.maxSelectable,a=void 0===i?0:i,u=r.items,c=void 0===u?[]:u,p=r.loading,f=void 0!==p&&p,l=r.title,h=r.searchQuery,d=r.searchQueryPlaceholder,y=r.primaryActionLabel,A=r.secondaryActionLabel,P=r.emptySearchLabel;return this.title=l,this.items=c,this.selectedItems=o,this.maxSelectable=a,this.loading=f,this.searchQuery=h,this.searchQueryPlaceholder=d,this.primaryActionLabel=y,this.secondaryActionLabel=A,this.emptySearchLabel=P,e&&this.update(),this},e.prototype.dispatch=function(t,e){return t===a.OPEN?this.open():t===a.UPDATE?this.update():t===a.CANCEL?this.cancel():t===a.SELECT?(this.selectedItems=(null==e?void 0:e.selectedItems)||[],this.app.dispatch(p({id:this.id,selectedItems:this.selectedItems}))):t===a.SEARCH?(this.searchQuery=(null==e?void 0:e.searchQuery)||"",this.app.dispatch(d({id:this.id,searchQuery:this.searchQuery}))):t===a.LOAD_MORE&&this.loadMore(),this},e.prototype.update=function(){this.app.dispatch(h(this.payload))},e.prototype.open=function(){this.app.dispatch(f(this.payload))},e.prototype.cancel=function(){this.app.dispatch(l({id:this.id}))},e.prototype.loadMore=function(){this.app.dispatch(y(this.payload))},e}(u.ActionSet);e.unstable_Picker=A;e.create=function(t,e){return new A(t,e)}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.compatibilityCreateApp=e.setClientInterfaceHook=void 0;var o=n(r(60)),i=r(6);e.setClientInterfaceHook=function(t){return function(e){return e.clientInterface.name="@shopify/app-bridge [CDN Compatibility]",t(e)}},e.compatibilityCreateApp=function(t,r){var n=r(i.isV1Config(t)?function(t){var e=t.shopOrigin+"/admin",r=o.default(e);return{apiKey:t.apiKey,host:r,forceRedirect:t.forceRedirect}}(t):t);return i.isV1Config(t)&&n.hooks.set(i.LifecycleHook.DispatchAction,e.setClientInterfaceHook),n}},function(t,e,r){t.exports=r(61).default,t.exports.default=t.exports},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(66);function o(e,r){return void 0===r&&(r="utf8"),t.isBuffer(e)?a(e.toString("base64")):a(t.from(e,r).toString("base64"))}function i(t){return t=t.toString(),n.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function a(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=o;s.encode=o,s.decode=function(e,r){return void 0===r&&(r="utf8"),t.from(i(e),"base64").toString(r)},s.toBase64=i,s.fromBase64=a,s.toBuffer=function(e){return t.from(i(e),"base64")},e.default=s}).call(this,r(23).Buffer)},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),a=n[0],s=n[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),p=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],u[p++]=e>>16&255,u[p++]=e>>8&255,u[p++]=255&e;2===s&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,u[p++]=255&e);1===s&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,u[p++]=e>>8&255,u[p++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,s=r-o;a<s;a+=16383)i.push(p(t,a,a+16383>s?s:a+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],o[a.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function p(t,e,r){for(var o,i,a=[],s=e;s<r;s+=3)o=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
9
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
10
|
+
e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,p=-7,f=r?o-1:0,l=r?-1:1,h=t[e+f];for(f+=l,i=h&(1<<-p)-1,h>>=-p,p+=s;p>0;i=256*i+t[e+f],f+=l,p-=8);for(a=i&(1<<-p)-1,i>>=-p,p+=n;p>0;a=256*a+t[e+f],f+=l,p-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,u,c=8*i-o-1,p=(1<<c)-1,f=p>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=p?(s=0,a=p):a+f>=1?(s=(e*u-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&s,h+=d,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;t[r+h]=255&a,h+=d,a/=256,c-=8);t[r+h-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var r=e.length,n=r%4;if(!n)return e;var o=r,i=4-n,a=r+i,s=t.alloc(a);for(s.write(e);i--;)s.write("=",o++);return s.toString()}}).call(this,r(23).Buffer)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(6);Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i.createApp}}),o(r(15),e),o(r(6),e)}])}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("app-bridge-utils",[],e):"object"==typeof exports?exports["app-bridge-utils"]=e():t["app-bridge-utils"]=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=13)}([function(t,e,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NonSnakeCaseGroup=e.findMatchInEnum=e.forEachInEnum=e.getMergedProps=e.updateActionFromPayload=e.isValidOptionalString=e.isValidOptionalNumber=e.getEventNameSpace=e.getVersion=e.actionWrapper=void 0;var i=n(5),a=o(n(18)),u=n(1),s=n(19);function c(){return s.version}function p(t,e){var n=a.default(t,e);return n||Object.assign(t,e)}e.actionWrapper=function(t){return r(r({},t),{version:c(),clientInterface:{name:s.name,version:c()}})},e.getVersion=c,e.getEventNameSpace=function(t,n,r){if(n.startsWith(""+i.PREFIX+i.SEPARATOR))return n;var o=function(t){if(e.NonSnakeCaseGroup.includes(t))return t.toUpperCase();return(n=t,n.replace(/([A-Z])/g,(function(t,e,n){return(0===n?"":"_")+t[0].toLowerCase()}))).toUpperCase();var n}(t);if(r){var a=r.subgroups,u=r.type;a&&a.length>0&&(o+=o.length>0?i.SEPARATOR:"",a.forEach((function(t,e){o+=""+t.toUpperCase()+(e<a.length-1?i.SEPARATOR:"")}))),u!==t&&u&&(o+=""+(o.length>0?i.SEPARATOR:"")+u.toUpperCase())}return o&&(o+=""+(o.length>0?i.SEPARATOR:"")+n.toUpperCase()),""+i.PREFIX+i.SEPARATOR+o},e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t},e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,p(t,e)),!0)},e.getMergedProps=p,e.forEachInEnum=function(t,e){Object.keys(t).forEach((function(n){e(t[n])}))},e.findMatchInEnum=function(t,e){var n=Object.keys(t).find((function(n){return e===t[n]}));return n?t[n]:void 0},e.NonSnakeCaseGroup=[u.Group.AuthCode,u.Group.Button,u.Group.ButtonGroup,u.Group.Cart,u.Group.Error,u.Group.Features,u.Group.Fullscreen,u.Group.Link,u.Group.Loading,u.Group.Menu,u.Group.Modal,u.Group.Navigation,u.Group.Pos,u.Group.Print,u.Group.ResourcePicker,u.Group.Scanner,u.Group.SessionToken,u.Group.Share,u.Group.TitleBar,u.Group.Toast,u.Group.unstable_Picker]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ComponentType=e.Group=void 0,function(t){t.AuthCode="AuthCode",t.Button="Button",t.ButtonGroup="ButtonGroup",t.Cart="Cart",t.Client="Client",t.ContextualSaveBar="ContextualSaveBar",t.Error="Error",t.Features="Features",t.FeedbackModal="FeedbackModal",t.Fullscreen="Fullscreen",t.LeaveConfirmation="LeaveConfirmation",t.Link="Link",t.Loading="Loading",t.Menu="Menu",t.Modal="Modal",t.Navigation="Navigation",t.Performance="Performance",t.Pos="Pos",t.Print="Print",t.ResourcePicker="Resource_Picker",t.unstable_Picker="unstable_Picker",t.Scanner="Scanner",t.SessionToken="SessionToken",t.Share="Share",t.TitleBar="TitleBar",t.Toast="Toast",t.MarketingExternalActivityTopBar="MarketingExternalActivityTopBar"}(e.Group||(e.Group={})),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup"}(e.ComponentType||(e.ComponentType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=e.fromAction=e.AppBridgeError=e.invalidOriginAction=e.isErrorEventName=e.permissionAction=e.networkAction=e.persistenceAction=e.unsupportedOperationAction=e.unexpectedAction=e.invalidAction=e.invalidActionType=e.invalidPayload=e.Message=e.AppActionType=e.Action=void 0;var r,o=n(0),i=n(1);function a(t,e,n){var r=e.payload;return o.actionWrapper({type:t,group:i.Group.Error,payload:{action:e,message:n,type:t,id:r&&r.id?r.id:void 0}})}!function(t){t.INVALID_ACTION="APP::ERROR::INVALID_ACTION",t.INVALID_ACTION_TYPE="APP::ERROR::INVALID_ACTION_TYPE",t.INVALID_PAYLOAD="APP::ERROR::INVALID_PAYLOAD",t.INVALID_OPTIONS="APP::ERROR::INVALID_OPTIONS",t.UNEXPECTED_ACTION="APP::ERROR::UNEXPECTED_ACTION",t.PERSISTENCE="APP::ERROR::PERSISTENCE",t.UNSUPPORTED_OPERATION="APP::ERROR::UNSUPPORTED_OPERATION",t.NETWORK="APP::ERROR::NETWORK",t.PERMISSION="APP::ERROR::PERMISSION",t.FAILED_AUTHENTICATION="APP::ERROR::FAILED_AUTHENTICATION",t.INVALID_ORIGIN="APP::ERROR::INVALID_ORIGIN"}(r=e.Action||(e.Action={})),function(t){t.INVALID_CONFIG="APP::ERROR::INVALID_CONFIG",t.MISSING_CONFIG="APP::APP_ERROR::MISSING_CONFIG",t.MISSING_APP_BRIDGE_MIDDLEWARE="APP::APP_ERROR::MISSING_APP_BRIDGE_MIDDLEWARE",t.WINDOW_UNDEFINED="APP::APP_ERROR::WINDOW_UNDEFINED",t.REDUX_REINSTANTIATED="APP::APP_ERROR::REDUX_REINSTANTIATED",t.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN",t.MISSING_HOST_PROVIDER="APP::APP_ERROR::MISSING_HOST_PROVIDER",t.MISSING_ROUTER_CONTEXT="APP::APP_ERROR::MISSING_ROUTER_CONTEXT",t.MISSING_HISTORY_BLOCK="APP::APP_ERROR::MISSING_HISTORY_BLOCK"}(e.AppActionType||(e.AppActionType={})),function(t){t.MISSING_PAYLOAD="Missing payload",t.INVALID_PAYLOAD_ID="Id in payload is missing or invalid"}(e.Message||(e.Message={})),e.invalidPayload=function(t,e){return a(r.INVALID_PAYLOAD,t,e||"The action's payload is missing required properties or has invalid properties")},e.invalidActionType=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:r.INVALID_ACTION_TYPE},type:r.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:r.INVALID_ACTION},type:r.INVALID_ACTION})},e.unexpectedAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:r.UNEXPECTED_ACTION},type:r.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return a(r.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return a(r.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return a(r.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return a(r.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof o.findMatchInEnum(r,t)},e.invalidOriginAction=function(t){return o.actionWrapper({group:i.Group.Error,payload:{message:t,type:r.INVALID_ORIGIN},type:r.INVALID_ORIGIN})};var u=function(t){this.name="AppBridgeError",this.message=t,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(this.message).stack};function s(t,e,n){var r=new u(t?e+": "+t:e);return r.action=n,r.type=e,r}e.AppBridgeError=u,u.prototype=Object.create(Error.prototype),e.fromAction=s,e.throwError=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r,o=t[0];throw"string"==typeof t[1]?n=t[1]:(r=t[1],n=t[2]||""),s(n,o,r)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LifecycleHook=e.MessageType=e.PermissionType=e.isV1Config=void 0,e.isV1Config=function(t){return void 0!==t.shopOrigin},function(t){t.Dispatch="Dispatch",t.Subscribe="Subscribe"}(e.PermissionType||(e.PermissionType={})),function(t){t.GetState="getState",t.Dispatch="dispatch",t.Subscribe="subscribe",t.Unsubscribe="unsubscribe"}(e.MessageType||(e.MessageType={})),function(t){t.UpdateAction="UpdateAction",t.DispatchAction="DispatchAction"}(e.LifecycleHook||(e.LifecycleHook={}))},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Button=e.isValidButtonProps=e.update=e.clickButton=e.Style=e.Icon=e.Action=void 0;var a,u=n(0),s=n(6),c=n(1);function p(t,e,n){var r=e.id,o=u.getEventNameSpace(t,a.CLICK,e),i={id:r,payload:n};return u.actionWrapper({type:o,group:t,payload:i})}function l(t,e,n){var r=e.id,o=n.label,s=u.getEventNameSpace(t,a.UPDATE,e),c=i(i({},n),{id:r,label:o});return u.actionWrapper({type:s,group:t,payload:c})}!function(t){t.CLICK="CLICK",t.UPDATE="UPDATE"}(a=e.Action||(e.Action={})),function(t){t.Print="print"}(e.Icon||(e.Icon={})),function(t){t.Danger="danger"}(e.Style||(e.Style={})),e.clickButton=p,e.update=l,e.isValidButtonProps=function(t){return"string"==typeof t.id&&"string"==typeof t.label};var f=function(t){function e(e,n){var r=t.call(this,e,c.ComponentType.Button,c.Group.Button)||this;return r.disabled=!1,r.loading=!1,r.plain=!1,r.set(n,!1),r}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{disabled:this.disabled,icon:this.icon,label:this.label,style:this.style,loading:this.loading,plain:this.plain}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=u.getMergedProps(this.options,t),r=n.label,o=n.disabled,i=n.icon,s=n.style,c=n.loading,p=n.plain;return this.label=r,this.disabled=Boolean(o),this.icon=i,this.style=s,this.loading=Boolean(c),this.plain=Boolean(p),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case a.CLICK:this.app.dispatch(p(this.group,this.component,e));break;case a.UPDATE:var n=l(this.group,this.component,this.payload);this.app.dispatch(n)}return this},e}(s.ActionSet);e.Button=f,e.create=function(t,e){return new f(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SEPARATOR=e.PREFIX=void 0,e.PREFIX="APP",e.SEPARATOR="::"},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,o=t.length;n<r;n++,o++)t[o]=e[n];return t},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ActionSetWithChildren=e.ActionSet=void 0;var s=n(3),c=n(7),p=n(2),l=n(1),f=u(n(8)),d=n(0),h=function(){function t(t,e,n,r){var o=this;this.app=t,this.type=e,this.group=n,this.subgroups=[],this.subscriptions=[],t||p.throwError(p.Action.INVALID_ACTION,"Missing required `app`"),this.id=r||f.default(),this.defaultGroup=n;var i=this.set;this.set=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return o.app.hooks?(t=o.app.hooks).run.apply(t,a([s.LifecycleHook.UpdateAction,i,o],e)):i.apply(o,e)}}return t.prototype.set=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},Object.defineProperty(t.prototype,"component",{get:function(){return{id:this.id,subgroups:this.subgroups,type:this.type}},enumerable:!1,configurable:!0}),t.prototype.updateSubscription=function(t,e,n){var r,o=t.eventType,i=t.callback,a=t.component;return(r=this.subscriptions.findIndex((function(e){return e===t})))>=0?this.subscriptions[r].unsubscribe():r=void 0,this.group=e,this.subgroups=n,Object.assign(a,{subgroups:this.subgroups}),this.subscribe(o,i,a,r)},t.prototype.error=function(t){var e=this,n=[];return d.forEachInEnum(p.Action,(function(r){n.push(e.subscriptions.length),e.subscribe(r,t)})),function(){n.map((function(t){return e.subscriptions[t]})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))}},t.prototype.subscribe=function(t,e,n,r){var o,a=this,u=n||this.component,s=t.toUpperCase(),c="number"==typeof r?e:e.bind(this);o=p.isErrorEventName(t)?d.getEventNameSpace(l.Group.Error,t,i(i({},u),{type:""})):d.getEventNameSpace(this.group,t,u);var f=this.app.subscribe(o,c,n?n.id:this.id),h={eventType:s,unsubscribe:f,callback:c,component:u,updateSubscribe:function(t,e){return a.updateSubscription(h,t,e)}};return"number"==typeof r&&r>=0&&r<this.subscriptions.length?this.subscriptions[r]=h:this.subscriptions.push(h),f},t.prototype.unsubscribe=function(t){return void 0===t&&(t=!1),b(this.subscriptions,this.defaultGroup,t),this},t}();e.ActionSet=h;var y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=[],e}return o(e,t),e.prototype.unsubscribe=function(t,n){return void 0===t&&(t=!0),void 0===n&&(n=!1),b(this.subscriptions,this.defaultGroup,n),this.children.forEach((function(n){n instanceof e?n.unsubscribe(t,!t):n.unsubscribe(!t)})),this},e.prototype.getChild=function(t){var e=this.children.findIndex((function(e){return e.id===t}));return e>=0?this.children[e]:void 0},e.prototype.getChildIndex=function(t){return this.children.findIndex((function(e){return e.id===t}))},e.prototype.getChildSubscriptions=function(t,e){return this.subscriptions.filter((function(n){return n.component.id===t&&(!e||e===n.eventType)}))},e.prototype.addChild=function(t,n,r){var o=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||n===t.group&&r===t.subgroups||(i.forEach((function(t){(0,t.updateSubscribe)(n,r)})),Object.assign(t,{group:n,subgroups:r}),t instanceof e&&t.children.forEach((function(t){return o.addChild(t,n,r)}))),this},e.prototype.removeChild=function(t){var e=this;return c.removeFromCollection(this.children,this.getChild(t),(function(){e.subscriptions.filter((function(e){return e.component.id===t})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))})),this},e.prototype.subscribeToChild=function(t,e,n){var r=this,o=n.bind(this);if(e instanceof Array)return e.forEach((function(e){return r.subscribeToChild(t,e,n)})),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),a=this.getChildSubscriptions(t.id,i);if(a.length>0)a.forEach((function(e){return e.updateSubscribe(r.group,t.subgroups)}));else{var u={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,o,u)}return this},e.prototype.getUpdatedChildActions=function(t,e){if(0!==t.length){for(var n=t.filter((function(t,e,n){return e===n.indexOf(t)})),r=n.map((function(t){return t.id})),o=e.filter((function(t){return r.indexOf(t.id)<0}));o.length>0;){if(!(i=o.pop()))break;this.removeChild(i.id)}return n}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(h);function b(t,e,n){void 0===n&&(n=!1),t.forEach((function(t){n?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()})),n||(t.length=0)}e.ActionSetWithChildren=y},function(t,e,n){"use strict";function r(t,e,n){var r=t.findIndex((function(t){return t===e}));return r>=0&&(t.splice(r,1),n&&n(e),!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.removeFromCollection=e.addAndRemoveFromCollection=void 0,e.addAndRemoveFromCollection=function(t,e,n){return t.push(e),function(){return r(t,e,n)}},e.removeFromCollection=r},function(t,e,n){"use strict";function r(t){return Array.from(t).map((function(t){return("00"+t.toString(16)).slice(-2)})).join("")}function o(t){if("function"==typeof Uint8Array&&"object"==typeof window&&window.crypto){var e=new Uint8Array(t),n=window.crypto.getRandomValues(e);if(n)return n}return Array.from(new Array(t),(function(){return 255*Math.random()|0}))}function i(){var t=o(1),e=o(2);return t[0]&=191,e[0]&=79,[r(o(4)),"-",r(o(2)),"-",r(e),"-",r(t),r(o(1)),"-",r(o(6))].join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=void 0,e.generateUuid=i,e.default=i},function(t,e,n){"use strict";(function(t){var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.isUnframed=e.isDevelopmentClient=e.isProduction=e.isDevelopment=e.isClient=e.isServer=void 0,e.isServer="undefined"==typeof window,e.isClient=!e.isServer,e.isDevelopment=void 0!==t&&t.env&&!1,e.isProduction=!e.isDevelopment,e.isDevelopmentClient=e.isDevelopment&&e.isClient,e.isUnframed=e.isClient&&(null===(r=null===(n=window.navigator)||void 0===n?void 0:n.userAgent)||void 0===r?void 0:r.indexOf("Unframed"))>0}).call(this,n(22))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isShopifyPing=e.isShopifyPOS=e.isShopifyMobile=e.isShopifyEmbedded=e.isMobile=void 0;var r=n(9);function o(){return"undefined"!=typeof navigator&&navigator.userAgent.indexOf("Shopify Mobile")>=0}function i(){return"undefined"!=typeof navigator&&navigator.userAgent.indexOf("Shopify POS")>=0}function a(){return"undefined"!=typeof navigator&&navigator.userAgent.indexOf("Shopify Ping")>=0}e.isMobile=function(){return o()||i()||a()},e.isShopifyEmbedded=function(){return r.isClient&&window.top!==window.self||r.isUnframed},e.isShopifyMobile=o,e.isShopifyPOS=i,e.isShopifyPing=a},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},u=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getSessionToken=void 0;var s=i(n(24)),c=n(2);e.getSessionToken=function(t){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,new Promise((function(e,n){var r=t.subscribe(s.Action.RESPOND,(function(t){var o=t.sessionToken;o?e(o):n(c.fromAction("Failed to retrieve a session token",c.Action.FAILED_AUTHENTICATION)),r()}));t.dispatch(s.request())}))]}))}))}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},u=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.getAuthorizationCodePayload=void 0;var c=i(n(27)),p=n(2),l=s(n(8));e.getAuthorizationCodePayload=function(t){return a(this,void 0,void 0,(function(){return u(this,(function(e){return[2,new Promise((function(e,n){var r=l.default(),o=t.subscribe(c.Action.RESPOND,(function(t){switch(null==t?void 0:t.status){case"needsExchange":e(t);break;default:n(p.fromAction("Failed to retrieve an authorization code",p.Action.FAILED_AUTHENTICATION))}o()}),r);t.dispatch(c.request(r))}))]}))}))}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(14),e)},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(15),e),o(n(10),e),o(n(23),e),o(n(26),e)},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.createMutationObserver=e.setupModalAutoSizing=void 0;var i=n(16),a=n(20),u=n(10),s="app-bridge-utils-modal-auto-size",c=function(){if("undefined"==typeof document)return null;var t=document.createElement("style");return t.type="text/css",t.innerHTML="."+s+" { overflow: hidden; height: auto; min-height: auto; }",t}();function p(t,e){if("undefined"!=typeof document){var n,r=-1,o=new MutationObserver((function(){n&&window.clearTimeout(n);n=window.setTimeout(a,16)}));return o.observe(document,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),a(),o}function a(){var n=document.body.scrollHeight;n!==r&&(r=n,t.dispatch(i.updateModalSize({id:e,height:String(n)})))}}e.setupModalAutoSizing=function(t){return r(this,void 0,void 0,(function(){function e(){r&&(r(),r=void 0)}function n(n){var o=n.context,i=n.modal.id;return u.isMobile()||o!==a.Context.Modal?(e(),e):(r||(r=function(t,e){if(!c)return function(){};var n=document.getElementsByTagName("head")[0],r=document.body.classList;n.appendChild(c),r.add(s);var o=p(t,e);return function(){r.remove(s),n.contains(c)&&n.removeChild(c),o&&o.disconnect()}}(t,i)),e)}var r;return o(this,(function(r){switch(r.label){case 0:return[4,t.getState().then(n)];case 1:return r.sent(),[2,e]}}))}))},e.createMutationObserver=p},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ModalIframe=e.ModalMessage=e.Modal=e.isMessageModal=e.isIframeModal=e.data=e.update=e.clickFooterButton=e.updateModalSize=e.closeModal=e.openModal=e.Size=e.Action=void 0;var a,u,s=n(17),c=n(0),p=n(6),l=n(1),f=n(4);!function(t){t.OPEN="APP::MODAL::OPEN",t.CLOSE="APP::MODAL::CLOSE",t.UPDATE="APP::MODAL::UPDATE",t.UPDATE_CONTENT="APP::MODAL::CONTENT::UPDATE",t.FOOTER_BUTTON_CLICK="APP::MODAL::FOOTER::BUTTON::CLICK",t.FOOTER_BUTTON_UPDATE="APP::MODAL::FOOTER::BUTTON::UPDATE",t.UPDATE_SIZE="APP::MODAL::UPDATE_SIZE",t.DATA="APP::MODAL::DATA"}(a=e.Action||(e.Action={})),function(t){t.Small="small",t.Medium="medium",t.Large="large",t.Full="full",t.Auto="auto"}(u=e.Size||(e.Size={}));var d={group:l.Group.Modal,subgroups:["Footer"],type:l.ComponentType.Button};function h(t){return c.actionWrapper({group:l.Group.Modal,payload:t,type:a.OPEN})}function y(t){return c.actionWrapper({group:l.Group.Modal,payload:t,type:a.CLOSE})}function b(t){return c.actionWrapper({payload:t,group:l.Group.Modal,type:a.UPDATE})}function v(t){return c.actionWrapper({payload:t,group:l.Group.Modal,type:a.DATA})}function g(t){return"string"==typeof t.url||"string"==typeof t.path}e.openModal=h,e.closeModal=y,e.updateModalSize=function(t){return c.actionWrapper({group:l.Group.Modal,payload:t,type:a.UPDATE_SIZE})},e.clickFooterButton=function(t,e){var n=i({id:t},d);return f.clickButton(l.Group.Modal,n,e)},e.update=b,e.data=v,e.isIframeModal=g,e.isMessageModal=function(t){return"string"==typeof t.message};var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=u.Small,e}return o(e,t),Object.defineProperty(e.prototype,"footer",{get:function(){if(this.footerPrimary||this.footerSecondary)return{buttons:{primary:this.footerPrimary,secondary:this.footerSecondary}}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"footerOptions",{get:function(){if(this.footerPrimaryOptions||this.footerSecondaryOptions)return{buttons:{primary:this.footerPrimaryOptions,secondary:this.footerSecondaryOptions}}},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.app.dispatch(y({id:this.id}))},e.prototype.setFooterPrimaryButton=function(t,e){var n=this,r=d.subgroups;this.footerPrimaryOptions=this.getChildButton(t,this.footerPrimaryOptions),this.footerPrimary=this.footerPrimaryOptions?s.getSingleButton(this,this.footerPrimaryOptions,r,(function(t){n.updatePrimaryFooterButton(t,e)})):void 0},e.prototype.setFooterSecondaryButtons=function(t,e){var n=this,r=d.subgroups,o=t||[],i=this.footerOptions&&this.footerOptions.buttons.secondary||[];this.footerSecondaryOptions=this.getUpdatedChildActions(o,i),this.footerSecondary=this.footerSecondaryOptions?this.footerSecondaryOptions.map((function(t){return s.getSingleButton(n,t,r,(function(t){n.updateSecondaryFooterButton(t,e)}))})):void 0},e.prototype.getChildButton=function(t,e){var n=t?[t]:[],r=e?[e]:[],o=this.getUpdatedChildActions(n,r);return o?o[0]:void 0},e.prototype.updatePrimaryFooterButton=function(t,e){this.footer&&this.footer.buttons.primary&&c.updateActionFromPayload(this.footer.buttons.primary,t)&&e()},e.prototype.updateSecondaryFooterButton=function(t,e){if(this.footer&&this.footer.buttons&&this.footer.buttons.secondary){for(var n,r=0,o=this.footer.buttons.secondary;r<o.length;r++){var i=o[r];if(n=c.updateActionFromPayload(i,t))break}n&&e()}},e}(p.ActionSetWithChildren);e.Modal=O;var P=function(t){function e(e,n){var r=t.call(this,e,l.Group.Modal,l.Group.Modal)||this;return r.set(n,!1),r}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{footer:this.footer,id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,message:this.message,size:this.size,title:this.title}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){var n=this;void 0===e&&(e=!0);var r=c.getMergedProps(this.options,t),o=r.title,i=r.footer,u=r.message,s=r.size;return this.title=o,this.message=u,this.size=s,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,(function(){n.dispatch(a.UPDATE)})),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,(function(){n.dispatch(a.UPDATE)})),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.OPEN:this.app.dispatch(h(this.payload));break;case a.CLOSE:this.close();break;case a.UPDATE:this.app.dispatch(b(this.payload))}return this},e}(O);e.ModalMessage=P;var A=function(t){function e(e,n){var r=t.call(this,e,l.Group.Modal,l.Group.Modal)||this;return r.set(n,!1),r}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{footer:this.footer,id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,path:this.path,size:this.size,title:this.title,url:this.url,loading:this.loading}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){var n=this;void 0===e&&(e=!0);var r=c.getMergedProps(this.options,t),o=r.title,i=r.footer,u=r.path,s=r.url,p=r.size,l=r.loading;return this.title=o,this.url=s,this.path=u,this.size=p,this.loading=l,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,(function(){n.dispatch(a.UPDATE)})),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,(function(){n.dispatch(a.UPDATE)})),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case a.OPEN:this.app.dispatch(h(this.payload));break;case a.CLOSE:this.close();break;case a.UPDATE:this.app.dispatch(b(this.payload));break;case a.DATA:this.app.dispatch(v(e||{}))}return this},e}(O);e.ModalIframe=A;e.create=function(t,e){return g(e)?new A(t,e):new P(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSingleButton=void 0;var r=n(4);e.getSingleButton=function(t,e,n,o){return t.addChild(e,t.group,n),t.subscribeToChild(e,r.Action.UPDATE,o),e.payload}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,n){if(null==n)return n;if(void 0===e||!Object.prototype.isPrototypeOf.call(Object.getPrototypeOf(e),n)||"Object"!==n.constructor.name&&"Array"!==n.constructor.name)return n;var r={};return Object.keys(n).forEach((function(o){Object.prototype.hasOwnProperty.call(e,o)?"object"!=typeof e[o]||Array.isArray(e[o])?r[o]=n[o]:r[o]=t(e[o],n[o]):r[o]=n[o]})),Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(n,t)||(r[t]=e[t])})),Object.setPrototypeOf(r,Object.getPrototypeOf(e)),r}},function(t){t.exports=JSON.parse('{"name":"@shopify/app-bridge","version":"3.1.1","types":"index.d.ts","main":"index.js","unpkg":"umd/index.js","jsdelivr":"umd/index.js","files":["/actions/","/client/","/umd/","/util/","/validate/","/development.d.ts","/development.js","/index.d.ts","/index.js","/MessageTransport.d.ts","/MessageTransport.js","/production.d.ts","/production.js"],"private":false,"publishConfig":{"access":"public","@shopify:registry":"https://registry.npmjs.org"},"repository":"git@github.com:Shopify/app-bridge.git","homepage":"https://shopify.dev/tools/app-bridge","author":"Shopify Inc.","license":"MIT","scripts":{"build":"yarn build:tsc && yarn build:npm && yarn build:umd","build:tsc":"NODE_ENV=production tsc","build:umd":"NODE_ENV=production webpack -p","build:npm":"shx cp -r ./npm/index.js ./index.js","check":"tsc","clean":"cat package.json | node -pe \\"JSON.parse(require(\'fs\').readFileSync(\'/dev/stdin\').toString()).files.map(f => \'./\'+f).join(\' \')\\" | xargs rm -rf","pack":"yarn pack","size":"size-limit"},"sideEffects":false,"size-limit":[{"limit":"17 KB","path":"production.js"}],"dependencies":{"base64url":"^3.0.1"},"devDependencies":{"@types/node":"^10.12.5","shx":"^0.3.3"}}')},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createTransportListener=e.fromWindow=e.fromFrame=e.Context=void 0;var r=n(2),o=n(21),i=n(3),a=n(7),u=n(9);!function(t){t.Modal="Modal",t.Main="Main"}(e.Context||(e.Context={})),e.fromFrame=function(t,e,n){var i=[],s=t.host,c=t.window;if(!s)throw r.fromAction("App frame is undefined",r.AppActionType.WINDOW_UNDEFINED);return u.isUnframed&&window.MobileWebView&&Object.assign(window.MobileWebView,{postMessageToIframe:function(t,e){null==c||c.postMessage(t,e),function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&"dispatch"===t.type&&"object"==typeof t.payload}(t)&&s.postMessage(JSON.stringify(t.payload),location.origin)},updateIframeUrl:function(n){var r=window.location,o=(t.window||{}).location;try{new URL(n).origin===e&&o?o.replace(n):r.href=n}catch(t){}}}),s.addEventListener("message",(function(t){if(t.source!==s&&o.isAppMessage(t))if(t.origin===e)if(u.isUnframed&&window.MobileWebView){p=JSON.stringify({id:"unframed://fromClient",origin:e,data:t.data});window.MobileWebView.postMessage(p)}else for(var n=0,a=i;n<a.length;n++){(0,a[n])(t)}else{var p,l="Message origin '"+t.origin+"' does not match app origin '"+e+"'.",f={type:"dispatch",payload:p=r.invalidOriginAction(l)};null==c||c.postMessage(f,t.origin)}})),{context:n,localOrigin:e,frameWindow:c,hostFrame:s,dispatch:function(t){null==c||c.postMessage(t,e)},subscribe:function(t){return a.addAndRemoveFromCollection(i,t)}}},e.fromWindow=function(t,e){var n=[];return void 0!==typeof window&&window.addEventListener("message",(function(e){if((window!==t||u.isUnframed)&&e.source===t&&(o.isAppBridgeAction(e.data.payload)||o.isAppMessage(e)))for(var r=0,i=n;r<i.length;r++){(0,i[r])(e)}})),{localOrigin:e,hostFrame:t,dispatch:function(n){var r;if(null===(r=n.source)||void 0===r?void 0:r.host)if(u.isUnframed&&window&&window.MobileWebView){var o=JSON.stringify({id:"unframed://fromClient",origin:e,data:n});window.MobileWebView.postMessage(o)}else{var i=new URL("https://"+n.source.host).origin;t.postMessage(n,i)}},subscribe:function(t){return a.addAndRemoveFromCollection(n,t)}}},e.createTransportListener=function(){var t=[],e={};return{createSubscribeHandler:function(n){return function(){if(arguments.length<2)return a.addAndRemoveFromCollection(t,{callback:arguments[0]});var r=Array.from(arguments),o=r[0],u=r[1],s=r[2],c={callback:u,id:s},p={type:o,id:s};return Object.prototype.hasOwnProperty.call(e,o)||(e[o]=[]),n&&n(i.MessageType.Subscribe,p),a.addAndRemoveFromCollection(e[o],c,(function(){n&&n(i.MessageType.Unsubscribe,p)}))}},handleMessage:function(e){t.forEach((function(t){return t.callback(e)}))},handleActionDispatch:function(t){var n=t.type,r=t.payload,o=!1;if(Object.prototype.hasOwnProperty.call(e,n))for(var i=0,a=e[n];i<a.length;i++){var u=a[i],s=u.id,c=u.callback;!(r&&r.id===s)&&s||(c(r),o=!0)}return o}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAppMessage=e.isPermitted=e.getPermissionKey=e.isFromApp=e.isAppBridgeAction=void 0;var r=n(3),o=n(5),i=n(0);function a(t){return t.replace(new RegExp("^"+o.PREFIX+o.SEPARATOR+"\\w+"+o.SEPARATOR),"")}e.isAppBridgeAction=function(t){return t instanceof Object&&Object.prototype.hasOwnProperty.call(t,"type")&&t.type.toString().startsWith(o.PREFIX)},e.isFromApp=function(t){return"object"==typeof t&&"object"==typeof t.source&&"string"==typeof t.source.apiKey},e.getPermissionKey=a,e.isPermitted=function(t,e,n){var r=e.group,o=e.type;if(!r||!Object.prototype.hasOwnProperty.call(t,r))return!1;var i=t[r];if(!i)return!1;var u=a(o);return!!i[u]&&!0===i[u][n]},e.isAppMessage=function(t){if("object"!=typeof t||!t.data||"object"!=typeof t.data)return!1;var e=t.data;return Object.prototype.hasOwnProperty.call(e,"type")&&void 0!==i.findMatchInEnum(r.MessageType,e.type)}},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,c=[],p=!1,l=-1;function f(){p&&s&&(p=!1,s.length?c=s.concat(c):l=-1,c.length&&d())}function d(){if(!p){var t=u(f);p=!0;for(var e=c.length;e;){for(s=c,c=[];++l<e;)s&&s[l].run();l=-1,e=c.length}s=null,p=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new h(t,e)),1!==c.length||p||u(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(11),e),o(n(25),e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.respond=e.request=e.Action=void 0;var r,o=n(0),i=n(1);!function(t){t.REQUEST="APP::SESSION_TOKEN::REQUEST",t.RESPOND="APP::SESSION_TOKEN::RESPOND"}(r=e.Action||(e.Action={})),e.request=function(){return o.actionWrapper({group:i.Group.SessionToken,type:r.REQUEST})},e.respond=function(t){return o.actionWrapper({payload:t,group:i.Group.SessionToken,type:r.RESPOND})}},function(t,e,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.authenticatedFetch=void 0;var a=n(11);e.authenticatedFetch=function(t,e){var n=this;return void 0===e&&(e=fetch),function(u,s){return void 0===s&&(s={}),o(n,void 0,void 0,(function(){var n,o,c;return i(this,(function(i){switch(i.label){case 0:return[4,a.getSessionToken(t)];case 1:return n=i.sent(),(o=new Headers(s.headers)).append("Authorization","Bearer "+n),o.append("X-Requested-With","XMLHttpRequest"),c={},o.forEach((function(t,e){c[e]=t})),[2,e(u,r(r({},s),{headers:c}))]}}))}))}}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(12),e),o(n(28),e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.respond=e.request=e.Action=void 0;var r,o=n(0),i=n(1);!function(t){t.REQUEST="APP::AUTH_CODE::REQUEST",t.RESPOND="APP::AUTH_CODE::RESPOND"}(r=e.Action||(e.Action={})),e.request=function(t){return o.actionWrapper({group:i.Group.AuthCode,type:r.REQUEST,payload:{id:t}})},e.respond=function(t){return o.actionWrapper({payload:t,group:i.Group.AuthCode,type:r.RESPOND})}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.userAuthorizedFetch=void 0;var i=n(12);function a(t){var e=t.headers.get("X-Shopify-API-Request-Failure-Unauthorized");return!!e&&"true"===e.toLowerCase()}e.userAuthorizedFetch=function(t){var e=this,n=t.app,u=t.callbackUri,s=void 0===u?"auth/shopify/callback":u,c=t.isAuthorizationCodeRequired,p=void 0===c?a:c,l=t.fetchOperation;return function(t,a){return r(e,void 0,void 0,(function(){var e,r,u,c,f,d,h;return o(this,(function(o){switch(o.label){case 0:return[4,l(t,a)];case 1:return e=o.sent(),p(e)?[4,i.getAuthorizationCodePayload(n)]:[2,e];case 2:return r=o.sent(),u=r.code,c=r.hmac,f=r.shop,d=r.timestamp,h=encodeURI("https://"+window.location.hostname+"/"+s+"?code="+u+"&hmac="+c+"&shop="+f+"×tamp="+d),[4,l(h,{})];case 3:if(!o.sent().ok)throw new Error("Failed to authorize request.");return[2,l(t,a)]}}))}))}}}])}));
|
@@ -1,4 +1,5 @@
|
|
1
1
|
//= require ./app_bridge_redirect.js
|
2
|
+
//= require ./app_bridge_utils_3.1.1.js
|
2
3
|
|
3
4
|
(function () {
|
4
5
|
function redirect() {
|
@@ -10,15 +11,12 @@
|
|
10
11
|
|
11
12
|
var targetInfo = JSON.parse(redirectTargetElement.dataset.target);
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
} else {
|
17
|
-
// If the current window is the 'child' or embedded, change the parent's URL with
|
18
|
-
// App Bridge redirect. This case can happen when an app updates its access scopes,
|
19
|
-
// or the unlikely scenario where the shop thinks the app is installed, but the
|
20
|
-
// app does not have an record for the shop.
|
14
|
+
var appBridgeUtils = window['app-bridge-utils'];
|
15
|
+
|
16
|
+
if (appBridgeUtils.isShopifyEmbedded()) {
|
21
17
|
window.appBridgeRedirect(targetInfo.url);
|
18
|
+
} else {
|
19
|
+
window.top.location.href = targetInfo.url;
|
22
20
|
}
|
23
21
|
}
|
24
22
|
|
data/docs/Releasing.md
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
1. Checkout and pull from master so you have the latest version of the shopify_app
|
13
13
|
1. Tag the HEAD with the version
|
14
14
|
```bash
|
15
|
-
$ git tag -f vX.Y.Z && git push
|
15
|
+
$ git tag -f vX.Y.Z && git push origin vX.Y.Z
|
16
16
|
```
|
17
17
|
1. Check that Create Release workflow successfully runs
|
18
18
|
1. Use Shipit to build and push the gem
|
data/docs/Upgrading.md
CHANGED
@@ -87,6 +87,7 @@ Rails.application.config.after_initialize do
|
|
87
87
|
ShopifyAPI::Context.setup(
|
88
88
|
api_key: ShopifyApp.configuration.api_key,
|
89
89
|
api_secret_key: ShopifyApp.configuration.secret,
|
90
|
+
old_api_secret_key: ShopifyApp.configuration.old_secret,
|
90
91
|
api_version: ShopifyApp.configuration.api_version,
|
91
92
|
host_name: URI(ENV.fetch('HOST', '')).host || '',
|
92
93
|
scope: ShopifyApp.configuration.scope,
|
@@ -6,7 +6,7 @@ module ShopifyApp
|
|
6
6
|
ShopifyApp.configuration.webhooks_manager_queue_name
|
7
7
|
end
|
8
8
|
|
9
|
-
def perform(shop_domain:, shop_token
|
9
|
+
def perform(shop_domain:, shop_token:, **)
|
10
10
|
ShopifyAPI::Auth::Session.temp(shop: shop_domain, access_token: shop_token) do |session|
|
11
11
|
WebhooksManager.create_webhooks(session: session)
|
12
12
|
end
|
data/lib/shopify_app/version.rb
CHANGED
data/package.json
CHANGED
data/shopify_app.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.author = "Shopify"
|
11
11
|
s.summary = "This gem is used to get quickly started with the Shopify API"
|
12
12
|
|
13
|
-
s.required_ruby_version = ">= 2.
|
13
|
+
s.required_ruby_version = ">= 2.7"
|
14
14
|
|
15
15
|
s.metadata["allowed_push_host"] = "https://rubygems.org"
|
16
16
|
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_runtime_dependency("jwt", ">= 2.2.3")
|
20
20
|
s.add_runtime_dependency("rails", "> 5.2.1")
|
21
21
|
s.add_runtime_dependency("redirect_safely", "~> 1.0")
|
22
|
-
s.add_runtime_dependency("shopify_api", "~>
|
22
|
+
s.add_runtime_dependency("shopify_api", "~> 11.0")
|
23
23
|
s.add_runtime_dependency("sprockets-rails", ">= 2.0.0")
|
24
24
|
|
25
25
|
s.add_development_dependency("byebug")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 20.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '11.0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '11.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: sprockets-rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -277,8 +277,9 @@ files:
|
|
277
277
|
- Rakefile
|
278
278
|
- SECURITY.md
|
279
279
|
- app/assets/images/storage_access.svg
|
280
|
-
- app/assets/javascripts/shopify_app/
|
280
|
+
- app/assets/javascripts/shopify_app/app_bridge_3.1.1.js
|
281
281
|
- app/assets/javascripts/shopify_app/app_bridge_redirect.js
|
282
|
+
- app/assets/javascripts/shopify_app/app_bridge_utils_3.1.1.js
|
282
283
|
- app/assets/javascripts/shopify_app/enable_cookies.js
|
283
284
|
- app/assets/javascripts/shopify_app/itp_helper.js
|
284
285
|
- app/assets/javascripts/shopify_app/partition_cookies.js
|
@@ -445,7 +446,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
445
446
|
requirements:
|
446
447
|
- - ">="
|
447
448
|
- !ruby/object:Gem::Version
|
448
|
-
version: '2.
|
449
|
+
version: '2.7'
|
449
450
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
450
451
|
requirements:
|
451
452
|
- - ">="
|
@@ -1,10 +0,0 @@
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("app-bridge",[],e):"object"==typeof exports?exports["app-bridge"]=e():t["app-bridge"]=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NonSnakeCaseGroup=e.findMatchInEnum=e.forEachInEnum=e.getMergedProps=e.updateActionFromPayload=e.ActionSetWithChildren=e.ActionSet=e.isValidOptionalString=e.isValidOptionalNumber=e.getEventNameSpace=e.getVersion=e.actionWrapper=void 0;var u=r(2),c=r(7),p=r(3),f=r(12),h=s(r(13)),d=r(1),l=s(r(25)),y=r(26);function A(){return y.version}function P(t,r,n){if(r.startsWith(""+f.PREFIX+f.SEPARATOR))return r;var o=function(t){if(e.NonSnakeCaseGroup.includes(t))return t.toUpperCase();return(r=t,r.replace(/([A-Z])/g,(function(t,e,r){return(0===r?"":"_")+t[0].toLowerCase()}))).toUpperCase();var r}(t);if(n){var i=n.subgroups,a=n.type;i&&i.length>0&&(o+=o.length>0?f.SEPARATOR:"",i.forEach((function(t,e){o+=""+t.toUpperCase()+(e<i.length-1?f.SEPARATOR:"")}))),a!==t&&a&&(o+=""+(o.length>0?f.SEPARATOR:"")+a.toUpperCase())}return o&&(o+=""+(o.length>0?f.SEPARATOR:"")+r.toUpperCase()),""+f.PREFIX+f.SEPARATOR+o}e.actionWrapper=function(t){return i(i({},t),{version:A(),clientInterface:{name:y.name,version:A()}})},e.getVersion=A,e.getEventNameSpace=P,e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t};var E=function(){function t(t,e,r,n){var o=this;this.app=t,this.type=e,this.group=r,this.subgroups=[],this.subscriptions=[],t||p.throwError(p.Action.INVALID_ACTION,"Missing required `app`"),this.id=n||l.default(),this.defaultGroup=r;var i=this.set;this.set=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return o.app.hooks?(t=o.app.hooks).run.apply(t,a([u.LifecycleHook.UpdateAction,i,o],e)):i.apply(o,e)}}return t.prototype.set=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},Object.defineProperty(t.prototype,"component",{get:function(){return{id:this.id,subgroups:this.subgroups,type:this.type}},enumerable:!1,configurable:!0}),t.prototype.updateSubscription=function(t,e,r){var n,o=t.eventType,i=t.callback,a=t.component;return(n=this.subscriptions.findIndex((function(e){return e===t})))>=0?this.subscriptions[n].unsubscribe():n=void 0,this.group=e,this.subgroups=r,Object.assign(a,{subgroups:this.subgroups}),this.subscribe(o,i,a,n)},t.prototype.error=function(t){var e=this,r=[];return O(p.Action,(function(n){r.push(e.subscriptions.length),e.subscribe(n,t)})),function(){r.map((function(t){return e.subscriptions[t]})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))}},t.prototype.subscribe=function(t,e,r,n){var o,a=this,s=r||this.component,u=t.toUpperCase(),c="number"==typeof n?e:e.bind(this);o=p.isErrorEventName(t)?P(d.Group.Error,t,i(i({},s),{type:""})):P(this.group,t,s);var f=this.app.subscribe(o,c,r?r.id:this.id),h={eventType:u,unsubscribe:f,callback:c,component:s,updateSubscribe:function(t,e){return a.updateSubscription(h,t,e)}};return"number"==typeof n&&n>=0&&n<this.subscriptions.length?this.subscriptions[n]=h:this.subscriptions.push(h),f},t.prototype.unsubscribe=function(t){return void 0===t&&(t=!1),_(this.subscriptions,this.defaultGroup,t),this},t}();e.ActionSet=E;var v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=[],e}return o(e,t),e.prototype.unsubscribe=function(t,r){return void 0===t&&(t=!0),void 0===r&&(r=!1),_(this.subscriptions,this.defaultGroup,r),this.children.forEach((function(r){r instanceof e?r.unsubscribe(t,!t):r.unsubscribe(!t)})),this},e.prototype.getChild=function(t){var e=this.children.findIndex((function(e){return e.id===t}));return e>=0?this.children[e]:void 0},e.prototype.getChildIndex=function(t){return this.children.findIndex((function(e){return e.id===t}))},e.prototype.getChildSubscriptions=function(t,e){return this.subscriptions.filter((function(r){return r.component.id===t&&(!e||e===r.eventType)}))},e.prototype.addChild=function(t,r,n){var o=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||r===t.group&&n===t.subgroups||(i.forEach((function(t){(0,t.updateSubscribe)(r,n)})),Object.assign(t,{group:r,subgroups:n}),t instanceof e&&t.children.forEach((function(t){return o.addChild(t,r,n)}))),this},e.prototype.removeChild=function(t){var e=this;return c.removeFromCollection(this.children,this.getChild(t),(function(){e.subscriptions.filter((function(e){return e.component.id===t})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))})),this},e.prototype.subscribeToChild=function(t,e,r){var n=this,o=r.bind(this);if(e instanceof Array)return e.forEach((function(e){return n.subscribeToChild(t,e,r)})),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),a=this.getChildSubscriptions(t.id,i);if(a.length>0)a.forEach((function(e){return e.updateSubscribe(n.group,t.subgroups)}));else{var s={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,o,s)}return this},e.prototype.getUpdatedChildActions=function(t,e){if(0!==t.length){for(var r=t.filter((function(t,e,r){return e===r.indexOf(t)})),n=r.map((function(t){return t.id})),o=e.filter((function(t){return n.indexOf(t.id)<0}));o.length>0;){if(!(i=o.pop()))break;this.removeChild(i.id)}return r}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(E);function _(t,e,r){void 0===r&&(r=!1),t.forEach((function(t){r?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()})),r||(t.length=0)}function g(t,e){var r=h.default(t,e);return r||Object.assign(t,e)}function O(t,e){Object.keys(t).forEach((function(r){e(t[r])}))}e.ActionSetWithChildren=v,e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,g(t,e)),!0)},e.getMergedProps=g,e.forEachInEnum=O,e.findMatchInEnum=function(t,e){var r=Object.keys(t).find((function(r){return e===t[r]}));return r?t[r]:void 0},e.NonSnakeCaseGroup=[d.Group.AuthCode,d.Group.Button,d.Group.ButtonGroup,d.Group.Cart,d.Group.Error,d.Group.Features,d.Group.Fullscreen,d.Group.Link,d.Group.Loading,d.Group.Menu,d.Group.Modal,d.Group.Navigation,d.Group.Pos,d.Group.Print,d.Group.ResourcePicker,d.Group.Scanner,d.Group.SessionToken,d.Group.Share,d.Group.TitleBar,d.Group.Toast]},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ComponentType=e.Group=void 0,function(t){t.AuthCode="AuthCode",t.Button="Button",t.ButtonGroup="ButtonGroup",t.Cart="Cart",t.Client="Client",t.ContextualSaveBar="ContextualSaveBar",t.Error="Error",t.Features="Features",t.FeedbackModal="FeedbackModal",t.Fullscreen="Fullscreen",t.LeaveConfirmation="LeaveConfirmation",t.Link="Link",t.Loading="Loading",t.Menu="Menu",t.Modal="Modal",t.Navigation="Navigation",t.Performance="Performance",t.Pos="Pos",t.Print="Print",t.ResourcePicker="Resource_Picker",t.Scanner="Scanner",t.SessionToken="SessionToken",t.Share="Share",t.TitleBar="TitleBar",t.Toast="Toast",t.MarketingExternalActivityTopBar="MarketingExternalActivityTopBar"}(e.Group||(e.Group={})),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup"}(e.ComponentType||(e.ComponentType={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LifecycleHook=e.MessageType=e.PermissionType=e.isV1Config=void 0,e.isV1Config=function(t){return void 0!==t.shopOrigin},function(t){t.Dispatch="Dispatch",t.Subscribe="Subscribe"}(e.PermissionType||(e.PermissionType={})),function(t){t.GetState="getState",t.Dispatch="dispatch",t.Subscribe="subscribe",t.Unsubscribe="unsubscribe"}(e.MessageType||(e.MessageType={})),function(t){t.UpdateAction="UpdateAction",t.DispatchAction="DispatchAction"}(e.LifecycleHook||(e.LifecycleHook={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=e.fromAction=e.AppBridgeError=e.invalidOriginAction=e.isErrorEventName=e.permissionAction=e.networkAction=e.persistenceAction=e.unsupportedOperationAction=e.unexpectedAction=e.invalidAction=e.invalidActionType=e.invalidPayload=e.Message=e.AppActionType=e.Action=void 0;var n,o=r(0),i=r(1);function a(t,e,r){var n=e.payload;return o.actionWrapper({type:t,group:i.Group.Error,payload:{action:e,message:r,type:t,id:n&&n.id?n.id:void 0}})}!function(t){t.INVALID_ACTION="APP::ERROR::INVALID_ACTION",t.INVALID_ACTION_TYPE="APP::ERROR::INVALID_ACTION_TYPE",t.INVALID_PAYLOAD="APP::ERROR::INVALID_PAYLOAD",t.INVALID_OPTIONS="APP::ERROR::INVALID_OPTIONS",t.UNEXPECTED_ACTION="APP::ERROR::UNEXPECTED_ACTION",t.PERSISTENCE="APP::ERROR::PERSISTENCE",t.UNSUPPORTED_OPERATION="APP::ERROR::UNSUPPORTED_OPERATION",t.NETWORK="APP::ERROR::NETWORK",t.PERMISSION="APP::ERROR::PERMISSION",t.FAILED_AUTHENTICATION="APP::ERROR::FAILED_AUTHENTICATION",t.INVALID_ORIGIN="APP::ERROR::INVALID_ORIGIN"}(n=e.Action||(e.Action={})),function(t){t.INVALID_CONFIG="APP::ERROR::INVALID_CONFIG",t.MISSING_CONFIG="APP::APP_ERROR::MISSING_CONFIG",t.MISSING_APP_BRIDGE_MIDDLEWARE="APP::APP_ERROR::MISSING_APP_BRIDGE_MIDDLEWARE",t.WINDOW_UNDEFINED="APP::APP_ERROR::WINDOW_UNDEFINED",t.REDUX_REINSTANTIATED="APP::APP_ERROR::REDUX_REINSTANTIATED",t.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN",t.MISSING_HOST_PROVIDER="APP::APP_ERROR::MISSING_HOST_PROVIDER",t.MISSING_ROUTER_CONTEXT="APP::APP_ERROR::MISSING_ROUTER_CONTEXT",t.MISSING_HISTORY_BLOCK="APP::APP_ERROR::MISSING_HISTORY_BLOCK"}(e.AppActionType||(e.AppActionType={})),function(t){t.MISSING_PAYLOAD="Missing payload",t.INVALID_PAYLOAD_ID="Id in payload is missing or invalid"}(e.Message||(e.Message={})),e.invalidPayload=function(t,e){return a(n.INVALID_PAYLOAD,t,e||"The action's payload is missing required properties or has invalid properties")},e.invalidActionType=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:n.INVALID_ACTION_TYPE},type:n.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:n.INVALID_ACTION},type:n.INVALID_ACTION})},e.unexpectedAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:n.UNEXPECTED_ACTION},type:n.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return a(n.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return a(n.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return a(n.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return a(n.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof o.findMatchInEnum(n,t)},e.invalidOriginAction=function(t){return o.actionWrapper({group:i.Group.Error,payload:{message:t,type:n.INVALID_ORIGIN},type:n.INVALID_ORIGIN})};var s=function(t){this.name="AppBridgeError",this.message=t,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(this.message).stack};function u(t,e,r){var n=new s(t?e+": "+t:e);return n.action=r,n.type=e,n}e.AppBridgeError=s,s.prototype=Object.create(Error.prototype),e.fromAction=u,e.throwError=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r,n,o=t[0];throw"string"==typeof t[1]?r=t[1]:(n=t[1],r=t[2]||""),u(r,o,n)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Button=e.isValidButtonProps=e.update=e.clickButton=e.Style=e.Icon=e.Action=void 0;var a,s=r(0),u=r(1);function c(t,e,r){var n=e.id,o=s.getEventNameSpace(t,a.CLICK,e),i={id:n,payload:r};return s.actionWrapper({type:o,group:t,payload:i})}function p(t,e,r){var n=e.id,o=r.label,u=s.getEventNameSpace(t,a.UPDATE,e),c=i(i({},r),{id:n,label:o});return s.actionWrapper({type:u,group:t,payload:c})}!function(t){t.CLICK="CLICK",t.UPDATE="UPDATE"}(a=e.Action||(e.Action={})),function(t){t.Print="print"}(e.Icon||(e.Icon={})),function(t){t.Danger="danger"}(e.Style||(e.Style={})),e.clickButton=c,e.update=p,e.isValidButtonProps=function(t){return"string"==typeof t.id&&"string"==typeof t.label};var f=function(t){function e(e,r){var n=t.call(this,e,u.ComponentType.Button,u.Group.Button)||this;return n.disabled=!1,n.loading=!1,n.plain=!1,n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{disabled:this.disabled,icon:this.icon,label:this.label,style:this.style,loading:this.loading,plain:this.plain}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=s.getMergedProps(this.options,t),n=r.label,o=r.disabled,i=r.icon,u=r.style,c=r.loading,p=r.plain;return this.label=n,this.disabled=Boolean(o),this.icon=i,this.style=u,this.loading=Boolean(c),this.plain=Boolean(p),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case a.CLICK:this.app.dispatch(c(this.group,this.component,e));break;case a.UPDATE:var r=p(this.group,this.component,this.payload);this.app.dispatch(r)}return this},e}(s.ActionSet);e.Button=f,e.create=function(t,e){return new f(t,e)}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(11);o(r(2),e),o(r(11),e),e.default=i.createClientApp},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSingleButton=void 0;var n=r(4);e.getSingleButton=function(t,e,r,o){return t.addChild(e,t.group,r),t.subscribeToChild(e,n.Action.UPDATE,o),e.payload}},function(t,e,r){"use strict";function n(t,e,r){var n=t.findIndex((function(t){return t===e}));return n>=0&&(t.splice(n,1),r&&r(e),!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.removeFromCollection=e.addAndRemoveFromCollection=void 0,e.addAndRemoveFromCollection=function(t,e,r){return t.push(e),function(){return n(t,e,r)}},e.removeFromCollection=n},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ButtonGroup=e.isGroupedButtonPayload=e.isGroupedButton=e.update=e.Action=void 0;var a,s=r(6),u=r(0),c=r(1);function p(t,e,r){return function(t,e,r,n,o){var a=e.id,s=n.label,c=u.getEventNameSpace(t,r,e),p=i(i({},n),{id:a,label:s,payload:o});return u.actionWrapper({type:c,group:t,payload:p})}(t,e,a.UPDATE,r)}!function(t){t.UPDATE="UPDATE"}(a=e.Action||(e.Action={})),e.update=p,e.isGroupedButton=function(t){var e=t;return e.buttons&&e.buttons.length>0&&void 0!==e.label},e.isGroupedButtonPayload=function(t){var e=t;return Array.isArray(e.buttons)&&"string"==typeof e.id&&"string"==typeof e.label};var f=function(t){function e(e,r){var n=t.call(this,e,c.ComponentType.ButtonGroup,c.Group.ButtonGroup)||this;return n.disabled=!1,n.plain=!1,n.buttonsOptions=[],n.buttons=[],n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{buttons:this.buttonsOptions,disabled:this.disabled,label:this.label,plain:this.plain}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=u.getMergedProps(this.options,t),n=r.label,o=r.disabled,i=r.buttons,s=r.plain;return this.label=n,this.disabled=Boolean(o),this.buttons=this.getButtons(i),this.plain=Boolean(s),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:var e=p(this.group,this.component,this.payload);this.app.dispatch(e)}return this},e.prototype.updateButtons=function(t){if(this.buttons&&0!==this.buttons.length){for(var e,r=0,n=this.buttons;r<n.length;r++){var o=n[r];if(e=u.updateActionFromPayload(o,t))break}e&&this.dispatch(a.UPDATE)}},e.prototype.getSingleButton=function(t){return s.getSingleButton(this,t,this.subgroups,this.updateButtons)},e.prototype.getButtons=function(t){var e=this,r=[];return t?(t.forEach((function(t){var n=s.getSingleButton(e,t,e.subgroups,e.updateButtons);r.push(n)})),this.buttonsOptions=t,r):[]},e}(u.ActionSetWithChildren);e.ButtonGroup=f,e.create=function(t,e){return new f(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Toast=e.clear=e.show=e.Action=void 0;var a,s=r(0),u=r(1);function c(t){return s.actionWrapper({group:u.Group.Toast,payload:t,type:a.SHOW})}function p(t){return s.actionWrapper({payload:t,group:u.Group.Toast,type:a.CLEAR})}!function(t){t.SHOW="APP::TOAST::SHOW",t.CLEAR="APP::TOAST::CLEAR"}(a=e.Action||(e.Action={})),e.show=c,e.clear=p;var f=function(t){function e(e,r){var n=t.call(this,e,u.Group.Toast,u.Group.Toast)||this;return n.message="",n.duration=5e3,n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{duration:this.duration,isError:this.isError,message:this.message}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){var e=s.getMergedProps(this.options,t),r=e.message,n=e.duration,o=e.isError;return this.message=r,this.duration=n,this.isError=o,this},e.prototype.dispatch=function(t){switch(t){case a.SHOW:var e=c(this.payload);this.app.dispatch(e);break;case a.CLEAR:this.app.dispatch(p({id:this.id}))}return this},e}(s.ActionSet);e.Toast=f,e.create=function(t,e){return new f(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.AppLink=e.update=e.Action=void 0;var a,s=r(0),u=r(1),c=r(22);function p(t,e,r){var n=e.id,o=r.label,u=r.destination,c=i(i({},r),{id:n,label:o,destination:u});return s.actionWrapper({group:t,type:s.getEventNameSpace(t,a.UPDATE,e),payload:c})}!function(t){t.UPDATE="UPDATE"}(a=e.Action||(e.Action={})),e.update=p;var f=function(t){function e(e,r){var n=t.call(this,e,u.Group.Link,u.Group.Link)||this;return n.label="",n.destination="",n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{label:this.label,destination:this.destination,redirectType:c.Action.APP}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){var t=this.options,e=t.label,r=t.destination,n=t.redirectType,o=r;return{id:this.id,label:e,destination:{path:o},redirectType:n}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=s.getMergedProps(this.options,t),n=r.label,o=r.destination;return this.label=n,this.destination=o,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:var e=p(this.group,this.component,this.payload);this.app.dispatch(e)}return this},e}(s.ActionSet);e.AppLink=f,e.create=function(t,e){return new f(t,e)}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createApp=e.createAppWrapper=e.createClientApp=e.WINDOW_UNDEFINED_MESSAGE=void 0;var i=r(0),a=r(14),s=r(3),u=r(15),c=r(29),p=r(17),f=r(18),h=r(30),d=r(19),l=r(2),y=o(r(31));function A(t,r,n){if(void 0===n&&(n=[]),!t)throw s.fromAction(e.WINDOW_UNDEFINED_MESSAGE,s.AppActionType.WINDOW_UNDEFINED);var o=d.getLocation(),i=r||o&&o.origin;if(!i)throw s.fromAction("local origin cannot be blank",s.AppActionType.MISSING_LOCAL_ORIGIN);var a=u.fromWindow(t,i);return e.createClientApp(a,n)}function P(t){var e=d.getWindow();return e?A(e.top)(t):c.serverAppBridge}e.WINDOW_UNDEFINED_MESSAGE="window is not defined. Running an app outside a browser is not supported",e.createClientApp=function(t,e){void 0===e&&(e=[]);var r=[],o=u.createTransportListener();return t.subscribe((function(t){var e=t.data,n=e.type,a=e.payload;switch(n){case"getState":r.splice(0).forEach((function(t){return t(a)}));break;case"dispatch":if(o.handleMessage(a),o.handleActionDispatch(a))return;var u=i.findMatchInEnum(s.Action,a.type);u&&s.throwError(u,a)}})),function(u){if(!u.host)throw s.fromAction("host must be provided",s.AppActionType.INVALID_CONFIG);if(!u.apiKey)throw s.fromAction("apiKey must be provided",s.AppActionType.INVALID_CONFIG);var c;try{c=function(t){var e;return n(n({},t),{host:atob(null===(e=t.host)||void 0===e?void 0:e.replace(/_/g,"/").replace(/-/g,"+"))})}(u)}catch(t){throw s.fromAction("not a valid host, please use the value provided by Shopify",s.AppActionType.INVALID_CONFIG)}var A=function(t,e){return function(r,n){t.dispatch({payload:n,source:e,type:r})}}(t,c),P=o.createSubscribeHandler(A);function E(t){return A(l.MessageType.Dispatch,t),t}A(l.MessageType.Unsubscribe),function(t,e){var r=e.apiKey,n=e.host,o=e.forceRedirect,i=void 0===o?!p.isDevelopmentClient:o,a=d.getLocation();if(!p.isUnframed&&a&&r&&n&&i&&d.shouldRedirect(t)){var s="https://"+n+"/apps/"+r+a.pathname+(a.search||"");d.redirect(s)}}(t.hostFrame,c);for(var v=new y.default,_={localOrigin:t.localOrigin,hooks:v,dispatch:function(t){return _.hooks?_.hooks.run(l.LifecycleHook.DispatchAction,E,_,t):E(t)},featuresAvailable:function(t){return _.getState("features").then((function(e){return t?t.reduce((function(t,r){return Object.keys(e).includes(r)&&(t[r]=e[r]),t}),{}):e}))},getState:function(t){return t&&"string"!=typeof t?Promise.resolve(void 0):new Promise((function(t){r.push(t),A(l.MessageType.GetState)})).then((function(e){var r=e;if(t)for(var n=0,o=t.split(".");n<o.length;n++){var i=o[n];if(null==r||"object"!=typeof r||Array.isArray(r)||!Object.keys(r).includes(i))return;r=r[i]}return r}))},subscribe:P,error:function(t,e){var r=[];return i.forEachInEnum(s.Action,(function(n){r.push(P(n,t,e))})),function(){r.forEach((function(t){return t()}))}}},g=0,O=e;g<O.length;g++){(0,O[g])(v,_)}return function(t){t.subscribe(a.Action.APP,h.handleAppPrint),t.dispatch(f.initialize())}(_),_}},e.createAppWrapper=A,e.createApp=P,e.default=P},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SEPARATOR=e.PREFIX=void 0,e.PREFIX="APP",e.SEPARATOR="::"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,r){if(null==r)return r;if(void 0===e||!Object.prototype.isPrototypeOf.call(Object.getPrototypeOf(e),r)||"Object"!==r.constructor.name&&"Array"!==r.constructor.name)return r;var n={};return Object.keys(r).forEach((function(o){Object.prototype.hasOwnProperty.call(e,o)?"object"!=typeof e[o]||Array.isArray(e[o])?n[o]=r[o]:n[o]=t(e[o],r[o]):n[o]=r[o]})),Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(r,t)||(n[t]=e[t])})),Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.app=e.Action=void 0;var n,o=r(0),i=r(1);!function(t){t.APP="APP::PRINT::APP"}(n=e.Action||(e.Action={})),e.app=function(){return o.actionWrapper({group:i.Group.Print,type:n.APP})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createTransportListener=e.fromWindow=e.fromFrame=e.Context=void 0;var n=r(3),o=r(16),i=r(2),a=r(7),s=r(17),u=r(28);!function(t){t.Modal="Modal",t.Main="Main"}(e.Context||(e.Context={})),e.fromFrame=function(t,e,r){var i=[];if(void 0===t||!t.ownerDocument||!t.ownerDocument.defaultView)throw n.fromAction("App frame is undefined",n.AppActionType.WINDOW_UNDEFINED);var s=t.ownerDocument.defaultView;return s.addEventListener("message",(function(r){if(o.isAppMessage(r))if(r.origin===e)for(var a=0,s=i;a<s.length;a++){(0,s[a])(r)}else{var u=t.contentWindow;if(u){var c="Message origin '"+r.origin+"' does not match app origin '"+e+"'.",p={type:"dispatch",payload:n.invalidOriginAction(c)};u.postMessage(p,r.origin)}}})),{context:r,localOrigin:e,frameWindow:t.contentWindow,hostFrame:s,dispatch:function(r){var n=t.contentWindow;n&&n.postMessage(r,e)},subscribe:function(t){return a.addAndRemoveFromCollection(i,t)}}},e.fromWindow=function(t,e){var r=[];return void 0!==typeof window&&window.addEventListener("message",(function(e){if((window!==t||s.isUnframed)&&e.source===t&&(o.isAppBridgeAction(e.data.payload)||o.isAppMessage(e)))for(var n=0,i=r;n<i.length;n++){(0,i[n])(e)}})),{localOrigin:e,hostFrame:t,dispatch:function(r){var n;if(null===(n=r.source)||void 0===n?void 0:n.host)if(s.isUnframed&&window&&window.MobileWebView){var o=u.parsePayloadWithContext({id:"unframed://fromClient",origin:e,data:r});window.MobileWebView.postMessage(o)}else{var i=new URL("https://"+r.source.host).origin;t.postMessage(r,i)}},subscribe:function(t){return a.addAndRemoveFromCollection(r,t)}}},e.createTransportListener=function(){var t=[],e={};return{createSubscribeHandler:function(r){return function(){if(arguments.length<2)return a.addAndRemoveFromCollection(t,{callback:arguments[0]});var n=Array.from(arguments),o=n[0],s=n[1],u=n[2],c={callback:s,id:u},p={type:o,id:u};return Object.prototype.hasOwnProperty.call(e,o)||(e[o]=[]),r&&r(i.MessageType.Subscribe,p),a.addAndRemoveFromCollection(e[o],c,(function(){r&&r(i.MessageType.Unsubscribe,p)}))}},handleMessage:function(e){t.forEach((function(t){return t.callback(e)}))},handleActionDispatch:function(t){var r=t.type,n=t.payload,o=!1;if(Object.prototype.hasOwnProperty.call(e,r))for(var i=0,a=e[r];i<a.length;i++){var s=a[i],u=s.id,c=s.callback;!(n&&n.id===u)&&u||(c(n),o=!0)}return o}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAppMessage=e.isPermitted=e.getPermissionKey=e.isFromApp=e.isAppBridgeAction=void 0;var n=r(2),o=r(12),i=r(0);function a(t){return t.replace(new RegExp("^"+o.PREFIX+o.SEPARATOR+"\\w+"+o.SEPARATOR),"")}e.isAppBridgeAction=function(t){return t instanceof Object&&Object.prototype.hasOwnProperty.call(t,"type")&&t.type.toString().startsWith(o.PREFIX)},e.isFromApp=function(t){return"object"==typeof t&&"object"==typeof t.source&&"string"==typeof t.source.apiKey},e.getPermissionKey=a,e.isPermitted=function(t,e,r){var n=e.group,o=e.type;if(!n||!Object.prototype.hasOwnProperty.call(t,n))return!1;var i=t[n];if(!i)return!1;var s=a(o);return!!i[s]&&!0===i[s][r]},e.isAppMessage=function(t){if("object"!=typeof t||!t.data||"object"!=typeof t.data)return!1;var e=t.data;return Object.prototype.hasOwnProperty.call(e,"type")&&void 0!==i.findMatchInEnum(n.MessageType,e.type)}},function(t,e,r){"use strict";(function(t){var r,n;Object.defineProperty(e,"__esModule",{value:!0}),e.isUnframed=e.isDevelopmentClient=e.isProduction=e.isDevelopment=e.isClient=e.isServer=void 0,e.isServer="undefined"==typeof window,e.isClient=!e.isServer,e.isDevelopment=void 0!==t&&t.env&&!1,e.isProduction=!e.isDevelopment,e.isDevelopmentClient=e.isDevelopment&&e.isClient,e.isUnframed=e.isClient&&(null===(n=null===(r=window.navigator)||void 0===r?void 0:r.userAgent)||void 0===n?void 0:n.indexOf("Unframed"))>0}).call(this,r(27))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initialize=e.Action=void 0;var n,o=r(1),i=r(0);!function(t){t.INITIALIZE="APP::CLIENT::INITIALIZE"}(n=e.Action||(e.Action={})),e.initialize=function(){return i.actionWrapper({group:o.Group.Client,type:n.INITIALIZE})}},function(t,e,r){"use strict";function n(){return o()?window.location:void 0}function o(){return"undefined"!=typeof window}Object.defineProperty(e,"__esModule",{value:!0}),e.getWindow=e.getLocation=e.redirect=e.shouldRedirect=void 0,e.shouldRedirect=function(t){return t===window},e.redirect=function(t){var e=n();e&&e.assign(t)},e.getLocation=n,e.getWindow=function(){return o()?window:void 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=void 0,function(t){t.UPDATE="APP::FEATURES::UPDATE",t.REQUEST="APP::FEATURES::REQUEST",t.REQUEST_UPDATE="APP::FEATURES::REQUEST::UPDATE"}(e.Action||(e.Action={}))},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ModalIframe=e.ModalMessage=e.Modal=e.isMessageModal=e.isIframeModal=e.data=e.update=e.clickFooterButton=e.updateModalSize=e.closeModal=e.openModal=e.Size=e.Action=void 0;var a,s,u=r(6),c=r(0),p=r(1),f=r(4);!function(t){t.OPEN="APP::MODAL::OPEN",t.CLOSE="APP::MODAL::CLOSE",t.UPDATE="APP::MODAL::UPDATE",t.UPDATE_CONTENT="APP::MODAL::CONTENT::UPDATE",t.FOOTER_BUTTON_CLICK="APP::MODAL::FOOTER::BUTTON::CLICK",t.FOOTER_BUTTON_UPDATE="APP::MODAL::FOOTER::BUTTON::UPDATE",t.UPDATE_SIZE="APP::MODAL::UPDATE_SIZE",t.DATA="APP::MODAL::DATA"}(a=e.Action||(e.Action={})),function(t){t.Small="small",t.Medium="medium",t.Large="large",t.Full="full",t.Auto="auto"}(s=e.Size||(e.Size={}));var h={group:p.Group.Modal,subgroups:["Footer"],type:p.ComponentType.Button};function d(t){return c.actionWrapper({group:p.Group.Modal,payload:t,type:a.OPEN})}function l(t){return c.actionWrapper({group:p.Group.Modal,payload:t,type:a.CLOSE})}function y(t){return c.actionWrapper({payload:t,group:p.Group.Modal,type:a.UPDATE})}function A(t){return c.actionWrapper({payload:t,group:p.Group.Modal,type:a.DATA})}function P(t){return"string"==typeof t.url||"string"==typeof t.path}e.openModal=d,e.closeModal=l,e.updateModalSize=function(t){return c.actionWrapper({group:p.Group.Modal,payload:t,type:a.UPDATE_SIZE})},e.clickFooterButton=function(t,e){var r=i({id:t},h);return f.clickButton(p.Group.Modal,r,e)},e.update=y,e.data=A,e.isIframeModal=P,e.isMessageModal=function(t){return"string"==typeof t.message};var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=s.Small,e}return o(e,t),Object.defineProperty(e.prototype,"footer",{get:function(){if(this.footerPrimary||this.footerSecondary)return{buttons:{primary:this.footerPrimary,secondary:this.footerSecondary}}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"footerOptions",{get:function(){if(this.footerPrimaryOptions||this.footerSecondaryOptions)return{buttons:{primary:this.footerPrimaryOptions,secondary:this.footerSecondaryOptions}}},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.app.dispatch(l({id:this.id}))},e.prototype.setFooterPrimaryButton=function(t,e){var r=this,n=h.subgroups;this.footerPrimaryOptions=this.getChildButton(t,this.footerPrimaryOptions),this.footerPrimary=this.footerPrimaryOptions?u.getSingleButton(this,this.footerPrimaryOptions,n,(function(t){r.updatePrimaryFooterButton(t,e)})):void 0},e.prototype.setFooterSecondaryButtons=function(t,e){var r=this,n=h.subgroups,o=t||[],i=this.footerOptions&&this.footerOptions.buttons.secondary||[];this.footerSecondaryOptions=this.getUpdatedChildActions(o,i),this.footerSecondary=this.footerSecondaryOptions?this.footerSecondaryOptions.map((function(t){return u.getSingleButton(r,t,n,(function(t){r.updateSecondaryFooterButton(t,e)}))})):void 0},e.prototype.getChildButton=function(t,e){var r=t?[t]:[],n=e?[e]:[],o=this.getUpdatedChildActions(r,n);return o?o[0]:void 0},e.prototype.updatePrimaryFooterButton=function(t,e){this.footer&&this.footer.buttons.primary&&c.updateActionFromPayload(this.footer.buttons.primary,t)&&e()},e.prototype.updateSecondaryFooterButton=function(t,e){if(this.footer&&this.footer.buttons&&this.footer.buttons.secondary){for(var r,n=0,o=this.footer.buttons.secondary;n<o.length;n++){var i=o[n];if(r=c.updateActionFromPayload(i,t))break}r&&e()}},e}(c.ActionSetWithChildren);e.Modal=E;var v=function(t){function e(e,r){var n=t.call(this,e,p.Group.Modal,p.Group.Modal)||this;return n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{footer:this.footer,id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,message:this.message,size:this.size,title:this.title}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){var r=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),o=n.title,i=n.footer,s=n.message,u=n.size;return this.title=o,this.message=s,this.size=u,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,(function(){r.dispatch(a.UPDATE)})),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,(function(){r.dispatch(a.UPDATE)})),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.OPEN:this.app.dispatch(d(this.payload));break;case a.CLOSE:this.close();break;case a.UPDATE:this.app.dispatch(y(this.payload))}return this},e}(E);e.ModalMessage=v;var _=function(t){function e(e,r){var n=t.call(this,e,p.Group.Modal,p.Group.Modal)||this;return n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{footer:this.footer,id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,path:this.path,size:this.size,title:this.title,url:this.url,loading:this.loading}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){var r=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),o=n.title,i=n.footer,s=n.path,u=n.url,p=n.size,f=n.loading;return this.title=o,this.url=u,this.path=s,this.size=p,this.loading=f,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,(function(){r.dispatch(a.UPDATE)})),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,(function(){r.dispatch(a.UPDATE)})),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case a.OPEN:this.app.dispatch(d(this.payload));break;case a.CLOSE:this.close();break;case a.UPDATE:this.app.dispatch(y(this.payload));break;case a.DATA:this.app.dispatch(A(e||{}))}return this},e}(E);e.ModalIframe=_,e.create=function(t,e){return P(e)?new _(t,e):new v(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Redirect=e.isRemotePayload=e.isAdminSectionPayload=e.isAdminPathPayload=e.isAppPayload=e.toDestination=e.toApp=e.toRemote=e.toAdminSection=e.toAdminPath=e.isProductVariantCreateResourcePayload=e.isProductVariantResourcePayload=e.isCreateResourcePayload=e.isResourcePayload=e.ResourceType=e.Action=void 0;var a,s=r(0),u=r(1);function c(t){return!0===t.create}function p(t){var e=t;return void 0!==e.id&&void 0!==e.variant}function f(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.ADMIN_PATH})}function h(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.ADMIN_SECTION})}function d(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.REMOTE})}function l(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.APP})}function y(t,e,r){switch(t){case a.APP:var n=A(e)?e:{path:e};return l(i({id:r},n));case a.ADMIN_PATH:var o=P(e)?e:{path:e};return f(i({id:r},o));case a.ADMIN_SECTION:var s=E(e)?e:{section:e};return h(i({id:r},s));case a.REMOTE:var u=v(e)?e:{url:e};return d(i({id:r},u))}}function A(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"path")}function P(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"path")}function E(t){return"object"==typeof t&&"object"==typeof t.section&&Object.prototype.hasOwnProperty.call(t.section,"name")}function v(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"url")}!function(t){t.ADMIN_SECTION="APP::NAVIGATION::REDIRECT::ADMIN::SECTION",t.ADMIN_PATH="APP::NAVIGATION::REDIRECT::ADMIN::PATH",t.REMOTE="APP::NAVIGATION::REDIRECT::REMOTE",t.APP="APP::NAVIGATION::REDIRECT::APP"}(a=e.Action||(e.Action={})),function(t){t.Product="products",t.Collection="collections",t.Order="orders",t.Customer="customers",t.Discount="discounts"}(e.ResourceType||(e.ResourceType={})),e.isResourcePayload=function(t){return"string"==typeof t.id},e.isCreateResourcePayload=c,e.isProductVariantResourcePayload=p,e.isProductVariantCreateResourcePayload=function(t){return!!p(t)&&c(t.variant)},e.toAdminPath=f,e.toAdminSection=h,e.toRemote=d,e.toApp=l,e.toDestination=y,e.isAppPayload=A,e.isAdminPathPayload=P,e.isAdminSectionPayload=E,e.isRemotePayload=v;var _=function(t){function e(e){return t.call(this,e,"Redirect",u.Group.Navigation)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t,e){var r=y(t,e,this.payload.id);return this.app.dispatch(r),this},e}(s.ActionSet);e.Redirect=_,e.create=function(t){return new _(t)}},function(t,e,r){"use strict";(function(t){
|
2
|
-
/*!
|
3
|
-
* The buffer module from node.js, for the browser.
|
4
|
-
*
|
5
|
-
* @author Feross Aboukhadijeh <http://feross.org>
|
6
|
-
* @license MIT
|
7
|
-
*/
|
8
|
-
var n=r(62),o=r(63),i=r(64);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|l(e,r),o=(t=s(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|d(e.length);return 0===(t=s(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):h(t,e);if("Buffer"===e.type&&i(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function p(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(p(e),t=s(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|d(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function l(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return m(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function A(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function P(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:E(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):E(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function E(t,e,r,n,o){var i,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var p=-1;for(i=r;i<s;i++)if(c(t,i)===c(e,-1===p?0:i-p)){if(-1===p&&(p=i),i-p+1===u)return p*a}else-1!==p&&(i-=i-p),p=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var f=!0,h=0;h<u;h++)if(c(t,i+h)!==c(e,h)){f=!1;break}if(f)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function _(t,e,r,n){return x(F(e,t.length-r),t,r,n)}function g(t,e,r,n){return x(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function O(t,e,r,n){return g(t,e,r,n)}function b(t,e,r,n){return x(W(e),t,r,n)}function T(t,e,r,n){return x(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function m(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,s,u,c=t[o],p=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(p=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(p=u);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(p=u);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(p=u)}null===p?(p=65533,f=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return c(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return p(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return f(null,t)},u.allocUnsafeSlow=function(t){return f(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},u.byteLength=l,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)A(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)A(this,e,e+3),A(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)A(this,e,e+7),A(this,e+1,e+6),A(this,e+2,e+5),A(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):y.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(i,a),c=this.slice(n,o),p=t.slice(e,r),f=0;f<s;++f)if(c[f]!==p[f]){i=c[f],a=p[f];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return P(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return P(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return g(this,t,e,r);case"latin1":case"binary":return O(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function C(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=k(t[i]);return o}function w(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function D(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function U(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,i){return i||L(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,i){return i||L(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var o=e-t;r=new u(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):U(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);M(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);M(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):U(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=u.isBuffer(t)?t:F(new u(t,n).toString()),s=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%s]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function k(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function W(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function x(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(61))},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createApp=e.default=e.actions=void 0;var i=r(5),a=r(32);Object.defineProperty(e,"actions",{enumerable:!0,get:function(){return a.compatibilityActions}});var s=r(58);function u(t){return s.compatibilityCreateApp(t,i.createApp)}o(r(66),e),e.default=u,e.createApp=u},function(t,e,r){"use strict";function n(t){return Array.from(t).map((function(t){return("00"+t.toString(16)).slice(-2)})).join("")}function o(t){if("function"==typeof Uint8Array&&"object"==typeof window&&window.crypto){var e=new Uint8Array(t),r=window.crypto.getRandomValues(e);if(r)return r}return Array.from(new Array(t),(function(){return 255*Math.random()|0}))}function i(){var t=o(1),e=o(2);return t[0]&=191,e[0]&=79,[n(o(4)),"-",n(o(2)),"-",n(e),"-",n(t),n(o(1)),"-",n(o(6))].join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=void 0,e.generateUuid=i,e.default=i},function(t){t.exports=JSON.parse('{"name":"@shopify/app-bridge","version":"2.0.12","types":"index.d.ts","main":"index.js","unpkg":"umd/index.js","jsdelivr":"umd/index.js","files":["/actions/","/client/","/umd/","/util/","/validate/","/development.d.ts","/development.js","/index.d.ts","/index.js","/MessageTransport.d.ts","/MessageTransport.js","/production.d.ts","/production.js"],"private":false,"publishConfig":{"access":"public","@shopify:registry":"https://registry.npmjs.org"},"repository":"git@github.com:Shopify/app-bridge.git","homepage":"https://shopify.dev/tools/app-bridge","author":"Shopify Inc.","license":"MIT","scripts":{"build":"yarn build:tsc && yarn build:npm && yarn build:umd","build:tsc":"NODE_ENV=production tsc","build:umd":"NODE_ENV=production webpack -p","build:npm":"shx cp -r ./npm/index.js ./index.js","check":"tsc","clean":"cat package.json | node -pe \\"JSON.parse(require(\'fs\').readFileSync(\'/dev/stdin\').toString()).files.map(f => \'./\'+f).join(\' \')\\" | xargs rm -rf","pack":"yarn pack","size":"size-limit"},"sideEffects":false,"size-limit":[{"limit":"17 KB","path":"production.js"}],"dependencies":{"base64url":"^3.0.1"},"devDependencies":{"@types/node":"^10.12.5","shx":"^0.3.3"}}')},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,c=[],p=!1,f=-1;function h(){p&&u&&(p=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!p){var t=s(h);p=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,p=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function l(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new l(t,e)),1!==c.length||p||s(d)},l.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.parsePayloadWithContext=void 0;var o=n(r(13));e.parsePayloadWithContext=function(t){var e="function"==typeof window.MobileWebView.context?window.MobileWebView.context():window.__context__;if(!e)return JSON.stringify(t);var r=o.default(t,{id:t.id,context:e,data:{payload:{context:e},context:e}});return JSON.stringify(r)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.serverAppBridge=void 0;var n=r(3),o=function(){};e.serverAppBridge={dispatch:function(){return{}},error:function(){return o},featuresAvailable:function(){return Promise.reject(n.fromAction("Feature detection is only available on the client side.",n.AppActionType.WINDOW_UNDEFINED))},getState:function(){return Promise.reject(n.fromAction("State is only available on the client side.",n.AppActionType.WINDOW_UNDEFINED))},localOrigin:"",subscribe:function(){return o}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.handleAppPrint=void 0;var n=r(19);function o(){n.getWindow()&&window.print()}function i(){var t=function(){var t=n.getWindow();if(t&&t.document&&t.document.body){var e=window.document.createElement("input");return e.style.display="none",window.document.body.appendChild(e),e}}();t&&(t.select(),o(),t.remove())}e.handleAppPrint=function(){navigator.userAgent.indexOf("iOS")>=0?i():o()}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(7),o=function(){function t(){this.map={}}return t.prototype.set=function(t,e){Object.prototype.hasOwnProperty.call(this.map,t)||(this.map[t]=[]);var r={handler:e,remove:function(){}},o=n.addAndRemoveFromCollection(this.map[t],r);return r={handler:e,remove:o},o},t.prototype.get=function(t){var e=this.map[t];return e?e.map((function(t){return t.handler})):void 0},t.prototype.run=function(t,e,r){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];var i=0,a=this.get(t)||[];function s(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=a[i++];return o?o(s).apply(r,t):e.apply(r,t)}return s.apply(r,n)},t}();e.default=o},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&o(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.compatibilityActions=void 0;var s=a(r(33));e.compatibilityActions=Object.entries(s).reduce((function(t,e){var r,o,i=e[0],a=e[1];return Object.keys(s.Group).includes(i)?n(n({},t),((o={})[i]=n(n({},a),{ActionType:a.Action}),o)):n(n({},t),((r={})[i]=a,r))}),{})},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e},a=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.Performance=e.Pos=e.AppLink=e.ChannelMenu=e.NavigationMenu=e.Share=e.ContextualSaveBar=e.MarketingExternalActivityTopBar=e.TitleBar=e.SessionToken=e.ResourcePicker=e.Redirect=e.Print=e.ModalContent=e.Modal=e.Loading=e.LeaveConfirmation=e.History=e.Toast=e.Fullscreen=e.FeedbackModal=e.Features=e.Flash=e.Error=e.Client=e.Cart=e.Scanner=e.ButtonGroup=e.Button=e.AuthCode=void 0;var s=i(r(34));e.AuthCode=s;var u=i(r(4));e.Button=u;var c=i(r(8));e.ButtonGroup=c;var p=i(r(35));e.Cart=p;var f=i(r(18));e.Client=f;var h=i(r(3));e.Error=h;var d=i(r(36));e.Flash=d;var l=i(r(38));e.Features=l;var y=i(r(40));e.FeedbackModal=y;var A=i(r(41));e.Fullscreen=A;var P=i(r(42));e.LeaveConfirmation=P;var E=i(r(43));e.Loading=E;var v=i(r(21));e.Modal=v;var _=i(r(44));e.ModalContent=_;var g=i(r(45));e.History=g;var O=i(r(22));e.Redirect=O;var b=i(r(14));e.Print=b;var T=i(r(46));e.ResourcePicker=T;var m=i(r(47));e.Scanner=m;var S=i(r(48));e.SessionToken=S;var R=i(r(49));e.TitleBar=R;var I=i(r(9));e.Toast=I;var C=i(r(51));e.ContextualSaveBar=C;var w=i(r(52));e.Share=w;var D=i(r(53));e.NavigationMenu=D;var M=i(r(54));e.ChannelMenu=M;var N=i(r(10));e.AppLink=N;var U=i(r(55));e.Pos=U;var L=i(r(56));e.MarketingExternalActivityTopBar=L;var B=i(r(57));e.Performance=B;var j=r(16);Object.defineProperty(e,"isAppBridgeAction",{enumerable:!0,get:function(){return j.isAppBridgeAction}}),a(r(1),e)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.respond=e.request=e.Action=void 0;var n,o=r(0),i=r(1);!function(t){t.REQUEST="APP::AUTH_CODE::REQUEST",t.RESPOND="APP::AUTH_CODE::RESPOND"}(n=e.Action||(e.Action={})),e.request=function(t){return o.actionWrapper({group:i.Group.AuthCode,type:n.REQUEST,payload:{id:t}})},e.respond=function(t){return o.actionWrapper({payload:t,group:i.Group.AuthCode,type:n.RESPOND})}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Cart=e.setLineItemProperties=e.removeLineItemDiscount=e.setLineItemDiscount=e.removeLineItem=e.updateLineItem=e.addLineItem=e.removeProperties=e.setProperties=e.setDiscount=e.updateCustomerAddress=e.addCustomerAddress=e.setCustomer=e.update=e.fetch=e.Action=void 0;var a,s=r(0),u=r(1);function c(t,e){return void 0===e&&(e={}),s.actionWrapper({group:u.Group.Cart,type:t,payload:e})}!function(t){t.FETCH="APP::CART::FETCH",t.UPDATE="APP::CART::UPDATE",t.SET_CUSTOMER="APP::CART::SET_CUSTOMER",t.REMOVE_CUSTOMER="APP::CART::REMOVE_CUSTOMER",t.ADD_CUSTOMER_ADDRESS="APP::CART::ADD_CUSTOMER_ADDRESS",t.UPDATE_CUSTOMER_ADDRESS="APP::CART::UPDATE_CUSTOMER_ADDRESS",t.SET_DISCOUNT="APP::CART::SET_DISCOUNT",t.REMOVE_DISCOUNT="APP::CART::REMOVE_DISCOUNT",t.SET_PROPERTIES="APP::CART::SET_PROPERTIES",t.REMOVE_PROPERTIES="APP::CART::REMOVE_PROPERTIES",t.CLEAR="APP::CART::CLEAR",t.ADD_LINE_ITEM="APP::CART::ADD_LINE_ITEM",t.UPDATE_LINE_ITEM="APP::CART::UPDATE_LINE_ITEM",t.REMOVE_LINE_ITEM="APP::CART::REMOVE_LINE_ITEM",t.SET_LINE_ITEM_DISCOUNT="APP::CART::SET_LINE_ITEM_DISCOUNT",t.REMOVE_LINE_ITEM_DISCOUNT="APP::CART::REMOVE_LINE_ITEM_DISCOUNT",t.SET_LINE_ITEM_PROPERTIES="APP::CART::SET_LINE_ITEM_PROPERTIES",t.REMOVE_LINE_ITEM_PROPERTIES="APP::CART::REMOVE_LINE_ITEM_PROPERTIES"}(a=e.Action||(e.Action={})),e.fetch=function(){return c(a.FETCH)},e.update=function(t){return c(a.UPDATE,t)},e.setCustomer=function(t){return c(a.SET_CUSTOMER,t)},e.addCustomerAddress=function(t){return c(a.ADD_CUSTOMER_ADDRESS,t)},e.updateCustomerAddress=function(t){return c(a.UPDATE_CUSTOMER_ADDRESS,t)},e.setDiscount=function(t){return c(a.SET_DISCOUNT,t)},e.setProperties=function(t){return c(a.SET_PROPERTIES,t)},e.removeProperties=function(t){return c(a.REMOVE_PROPERTIES,t)},e.addLineItem=function(t){return c(a.ADD_LINE_ITEM,t)},e.updateLineItem=function(t){return c(a.UPDATE_LINE_ITEM,t)},e.removeLineItem=function(t){return c(a.REMOVE_LINE_ITEM,t)},e.setLineItemDiscount=function(t){return c(a.SET_LINE_ITEM_DISCOUNT,t)},e.removeLineItemDiscount=function(t){return c(a.REMOVE_LINE_ITEM_DISCOUNT,t)},e.setLineItemProperties=function(t){return c(a.SET_LINE_ITEM_PROPERTIES,t)};var p=function(t){function e(e,r){return t.call(this,e,u.Group.Cart,u.Group.Cart,r?r.id:void 0)||this}return o(e,t),e.prototype.dispatch=function(t,e){switch(t){case a.FETCH:this.dispatchCartAction(a.FETCH);break;case a.UPDATE:this.dispatchCartAction(a.UPDATE,e);break;case a.SET_CUSTOMER:this.dispatchCartAction(a.SET_CUSTOMER,e);break;case a.REMOVE_CUSTOMER:this.dispatchCartAction(a.REMOVE_CUSTOMER,e);break;case a.ADD_CUSTOMER_ADDRESS:this.dispatchCartAction(a.ADD_CUSTOMER_ADDRESS,e);break;case a.UPDATE_CUSTOMER_ADDRESS:this.dispatchCartAction(a.UPDATE_CUSTOMER_ADDRESS,e);break;case a.SET_DISCOUNT:this.dispatchCartAction(a.SET_DISCOUNT,e);break;case a.REMOVE_DISCOUNT:this.dispatchCartAction(a.REMOVE_DISCOUNT,e);break;case a.SET_PROPERTIES:this.dispatchCartAction(a.SET_PROPERTIES,e);break;case a.REMOVE_PROPERTIES:this.dispatchCartAction(a.REMOVE_PROPERTIES,e);break;case a.CLEAR:this.dispatchCartAction(a.CLEAR,e);break;case a.ADD_LINE_ITEM:this.dispatchCartAction(a.ADD_LINE_ITEM,e);break;case a.UPDATE_LINE_ITEM:this.dispatchCartAction(a.UPDATE_LINE_ITEM,e);break;case a.REMOVE_LINE_ITEM:this.dispatchCartAction(a.REMOVE_LINE_ITEM,e);break;case a.SET_LINE_ITEM_DISCOUNT:this.dispatchCartAction(a.SET_LINE_ITEM_DISCOUNT,e);break;case a.REMOVE_LINE_ITEM_DISCOUNT:this.dispatchCartAction(a.REMOVE_LINE_ITEM_DISCOUNT,e);break;case a.SET_LINE_ITEM_PROPERTIES:this.dispatchCartAction(a.SET_LINE_ITEM_PROPERTIES,e);break;case a.REMOVE_LINE_ITEM_PROPERTIES:this.dispatchCartAction(a.REMOVE_LINE_ITEM_PROPERTIES,e)}return this},e.prototype.dispatchCartAction=function(t,e){this.app.dispatch(c(t,i(i({},e),{id:this.id})))},e}(s.ActionSet);e.Cart=p,e.create=function(t,e){return new p(t,e)}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(37),e)},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Flash=void 0;var i=r(9),a=r(9);Object.defineProperty(e,"ActionBase",{enumerable:!0,get:function(){return a.ActionBase}}),Object.defineProperty(e,"clear",{enumerable:!0,get:function(){return a.clear}}),Object.defineProperty(e,"ClearAction",{enumerable:!0,get:function(){return a.ClearAction}}),Object.defineProperty(e,"show",{enumerable:!0,get:function(){return a.show}}),Object.defineProperty(e,"ShowAction",{enumerable:!0,get:function(){return a.ShowAction}}),Object.defineProperty(e,"FlashAction",{enumerable:!0,get:function(){return a.ToastAction}});var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i.Toast);e.Flash=s,e.create=function(t,e){return new s(t,e)}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(39),e),o(r(20),e)},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Features=void 0;var a=r(0),s=r(1),u=r(20),c=function(t){function e(e,r){return t.call(this,e,s.Group.Features,s.Group.Features,r?r.id:void 0)||this}return o(e,t),e.prototype.dispatch=function(t,e){switch(t){case u.Action.REQUEST:this.dispatchFeaturesAction(u.Action.REQUEST,e)}return this},e.prototype.dispatchFeaturesAction=function(t,e){this.app.dispatch(a.actionWrapper({group:s.Group.Features,type:t,payload:i(i({},e||{}),{id:this.id})}))},e}(a.ActionSet);e.Features=c,e.create=function(t,e){return new c(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.FeedbackModal=e.close=e.open=e.Action=void 0;var a,s=r(0),u=r(1);function c(t){return s.actionWrapper({group:u.Group.FeedbackModal,payload:t,type:a.OPEN})}function p(t){return s.actionWrapper({group:u.Group.FeedbackModal,payload:t,type:a.CLOSE})}!function(t){t.OPEN="APP::FEEDBACK_MODAL::OPEN",t.CLOSE="APP::FEEDBACK_MODAL::CLOSE"}(a=e.Action||(e.Action={})),e.open=c,e.close=p;var f=function(t){function e(e,r){var n=t.call(this,e,u.Group.FeedbackModal,u.Group.FeedbackModal)||this;return n.options=r,n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){return this.options=s.getMergedProps(this.options,t),this},e.prototype.dispatch=function(t){switch(t){case a.OPEN:var e=c(this.payload);this.app.dispatch(e);break;case a.CLOSE:var r=p(this.payload);this.app.dispatch(r)}return this},e}(s.ActionSet);e.FeedbackModal=f,e.create=function(t,e){return new f(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Fullscreen=e.exit=e.enter=e.Action=void 0;var i,a=r(0),s=r(1);!function(t){t.ENTER="APP::FULLSCREEN::ENTER",t.EXIT="APP::FULLSCREEN::EXIT"}(i=e.Action||(e.Action={})),e.enter=function(){return a.actionWrapper({group:s.Group.Fullscreen,type:i.ENTER})},e.exit=function(){return a.actionWrapper({group:s.Group.Fullscreen,type:i.EXIT})};var u=function(t){function e(e){return t.call(this,e,s.Group.Fullscreen,s.Group.Fullscreen)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t){return this.app.dispatch(a.actionWrapper({group:this.group,type:t,payload:this.payload})),this},e}(a.ActionSet);e.Fullscreen=u,e.create=function(t){return new u(t)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.LeaveConfirmation=e.confirm=e.disable=e.enable=e.Action=void 0;var a,s=r(0),u=r(1);function c(t){return void 0===t&&(t={}),s.actionWrapper({group:u.Group.LeaveConfirmation,payload:t,type:a.ENABLE})}function p(t){return void 0===t&&(t={}),s.actionWrapper({group:u.Group.LeaveConfirmation,payload:t,type:a.DISABLE})}function f(t){return void 0===t&&(t={}),s.actionWrapper({group:u.Group.LeaveConfirmation,payload:t,type:a.CONFIRM})}!function(t){t.ENABLE="APP::LEAVE_CONFIRMATION::ENABLE",t.DISABLE="APP::LEAVE_CONFIRMATION::DISABLE",t.CONFIRM="APP::LEAVE_CONFIRMATION::CONFIRM"}(a=e.Action||(e.Action={})),e.enable=c,e.disable=p,e.confirm=f;var h=function(t){function e(e,r){void 0===r&&(r={});var n=t.call(this,e,u.Group.LeaveConfirmation,u.Group.LeaveConfirmation)||this;return n.options=r,n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){return this.options=s.getMergedProps(this.options,t),this},e.prototype.dispatch=function(t){switch(t){case a.ENABLE:var e=c(this.payload);this.app.dispatch(e);break;case a.DISABLE:var r=p(this.payload);this.app.dispatch(r);break;case a.CONFIRM:var n=f(this.payload);this.app.dispatch(n)}return this},e}(s.ActionSet);e.LeaveConfirmation=h,e.create=function(t,e){return void 0===e&&(e={}),new h(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Loading=e.stop=e.start=e.Action=void 0;var i,a=r(0),s=r(1);function u(t){return a.actionWrapper({payload:t,group:s.Group.Loading,type:i.START})}function c(t){return a.actionWrapper({payload:t,group:s.Group.Loading,type:i.STOP})}!function(t){t.START="APP::LOADING::START",t.STOP="APP::LOADING::STOP"}(i=e.Action||(e.Action={})),e.start=u,e.stop=c;var p=function(t){function e(e){return t.call(this,e,s.Group.Loading,s.Group.Loading)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t){switch(t){case i.START:this.app.dispatch(u(this.payload));break;case i.STOP:this.app.dispatch(c(this.payload))}return this},e}(a.ActionSet);e.Loading=p,e.create=function(t){return new p(t)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ModalContent=e.Action=void 0;var u,c=r(0),p=r(1),f=r(21);!function(t){t.LOADING="LOADING",t.LOADED="LOADED"}(u=e.Action||(e.Action={}));var h=function(t){function e(e,r){return t.call(this,e,p.Group.Modal,p.Group.Modal,r?r.id:void 0)||this}return o(e,t),e.prototype.loaded=function(){this.dispatch(u.LOADED)},e.prototype.loading=function(){this.dispatch(u.LOADING)},e.prototype.dispatch=function(t){switch(t){case u.LOADED:this.dispatchModalAction(f.Action.UPDATE_CONTENT,{loading:!1});break;case u.LOADING:this.dispatchModalAction(f.Action.UPDATE_CONTENT,{loading:!0})}return this},e.prototype.dispatchModalAction=function(t,e){return a(this,void 0,void 0,(function(){var r;return s(this,(function(n){return r=c.actionWrapper({type:t,group:p.Group.Modal,payload:i({},e)}),this.app.dispatch(r),[2]}))}))},e}(c.ActionSet);e.ModalContent=h,e.create=function(t,e){return new h(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.History=e.replace=e.push=e.Action=void 0;var a,s=r(0),u=r(1);function c(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.PUSH})}function p(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.REPLACE})}!function(t){t.PUSH="APP::NAVIGATION::HISTORY::PUSH",t.REPLACE="APP::NAVIGATION::HISTORY::REPLACE"}(a=e.Action||(e.Action={})),e.push=c,e.replace=p;var f=function(t){function e(e){return t.call(this,e,"History",u.Group.Navigation)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t,e){var r=i(i({},this.payload),{path:e});switch(t){case a.PUSH:this.app.dispatch(c(r));break;case a.REPLACE:this.app.dispatch(p(r))}return this},e}(s.ActionSet);e.History=f,e.create=function(t){return new f(t)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ResourcePicker=e.update=e.close=e.cancel=e.open=e.select=e.ActionVerb=e.ResourceType=e.ProductStatus=e.ProductVariantInventoryManagement=e.ProductVariantInventoryPolicy=e.WeightUnit=e.FulfillmentServiceType=e.CollectionSortOrder=e.Action=void 0;var a,s,u,c=r(0),p=r(1);function f(t){return c.actionWrapper({payload:t,group:p.Group.ResourcePicker,type:a.SELECT})}function h(t){return c.actionWrapper({payload:t,group:p.Group.ResourcePicker,type:a.OPEN})}function d(t){return c.actionWrapper({payload:t,group:p.Group.ResourcePicker,type:a.CANCEL})}function l(t){return c.actionWrapper({payload:t,group:p.Group.ResourcePicker,type:a.UPDATE})}!function(t){t.OPEN="APP::RESOURCE_PICKER::OPEN",t.SELECT="APP::RESOURCE_PICKER::SELECT",t.CLOSE="APP::RESOURCE_PICKER::CLOSE",t.UPDATE="APP::RESOURCE_PICKER::UPDATE",t.CANCEL="APP::RESOURCE_PICKER::CANCEL"}(a=e.Action||(e.Action={})),function(t){t.Manual="MANUAL",t.BestSelling="BEST_SELLING",t.AlphaAsc="ALPHA_ASC",t.AlphaDesc="ALPHA_DESC",t.PriceDesc="PRICE_DESC",t.PriceAsc="PRICE_ASC",t.CreatedDesc="CREATED_DESC",t.Created="CREATED"}(e.CollectionSortOrder||(e.CollectionSortOrder={})),function(t){t.GiftCard="GIFT_CARD",t.Manual="MANUAL",t.ThirdParty="THIRD_PARTY"}(e.FulfillmentServiceType||(e.FulfillmentServiceType={})),function(t){t.Kilograms="KILOGRAMS",t.Grams="GRAMS",t.Pounds="POUNDS",t.Ounces="OUNCES"}(e.WeightUnit||(e.WeightUnit={})),function(t){t.Deny="DENY",t.Continue="CONTINUE"}(e.ProductVariantInventoryPolicy||(e.ProductVariantInventoryPolicy={})),function(t){t.Shopify="SHOPIFY",t.NotManaged="NOT_MANAGED",t.FulfillmentService="FULFILLMENT_SERVICE"}(e.ProductVariantInventoryManagement||(e.ProductVariantInventoryManagement={})),function(t){t.Active="ACTIVE",t.Archived="ARCHIVED",t.Draft="DRAFT"}(e.ProductStatus||(e.ProductStatus={})),function(t){t.Product="product",t.ProductVariant="variant",t.Collection="collection"}(s=e.ResourceType||(e.ResourceType={})),function(t){t.Add="add",t.Select="select"}(u=e.ActionVerb||(e.ActionVerb={})),e.select=f,e.open=h,e.cancel=d,e.close=function(t){return c.actionWrapper({payload:t,group:p.Group.ResourcePicker,type:a.CANCEL})},e.update=l;var y=function(t){function e(e,r,n){var o=t.call(this,e,p.Group.ResourcePicker,p.Group.ResourcePicker)||this;return o.initialSelectionIds=[],o.selection=[],o.resourceType=n,o.set(r,!1),o}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{id:this.id,resourceType:this.resourceType})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){var t={initialQuery:this.initialQuery,selectMultiple:this.selectMultiple,initialSelectionIds:this.initialSelectionIds,showHidden:this.showHidden,actionVerb:this.actionVerb};return this.resourceType===s.Product?i(i({},t),{showVariants:this.showVariants,showDraft:this.showDraft,showArchived:this.showArchived,showDraftBadge:this.showDraftBadge,showArchivedBadge:this.showArchivedBadge}):t},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=c.getMergedProps(this.options,t),n=r.initialQuery,o=r.initialSelectionIds,i=void 0===o?[]:o,a=r.showHidden,s=void 0===a||a,p=r.showVariants,f=void 0===p||p,h=r.showDraft,d=void 0===h||h,l=r.showArchived,y=void 0===l||l,A=r.showDraftBadge,P=void 0!==A&&A,E=r.showArchivedBadge,v=void 0!==E&&E,_=r.selectMultiple,g=void 0===_||_,O=r.actionVerb,b=void 0===O?u.Add:O;return this.initialQuery=n,this.initialSelectionIds=i,this.showHidden=s,this.showVariants=f,this.showDraft=d,this.showArchived=y,this.showDraftBadge=P,this.showArchivedBadge=v,this.selectMultiple=g,this.actionVerb=b,e&&this.update(),this},e.prototype.dispatch=function(t,e){return t===a.OPEN?this.open():t===a.UPDATE?this.update():t===a.CLOSE||t===a.CANCEL?this.cancel():t===a.SELECT&&(this.selection=e,this.app.dispatch(f({id:this.id,selection:this.selection}))),this},e.prototype.update=function(){this.app.dispatch(l(this.payload))},e.prototype.open=function(){this.app.dispatch(h(this.payload))},e.prototype.cancel=function(){this.app.dispatch(d({id:this.id}))},e.prototype.close=function(){this.cancel()},e}(c.ActionSet);e.ResourcePicker=y,e.create=function(t,e){var r=e.resourceType,n=e.options;return new y(t,void 0===n?{}:n,r)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.capture=e.openCamera=e.create=e.Scanner=e.Action=void 0;var i,a=r(0),s=r(1);!function(t){t.OPEN_CAMERA="APP::SCANNER::OPEN::CAMERA",t.CAPTURE="APP::SCANNER::CAPTURE"}(i=e.Action||(e.Action={}));var u=function(t){function e(e,r){return t.call(this,e,s.Group.Scanner,s.Group.Scanner,r?r.id:void 0)||this}return o(e,t),e.prototype.dispatch=function(t){switch(t){case i.OPEN_CAMERA:this.dispatchScannerAction(i.OPEN_CAMERA)}return this},e.prototype.dispatchScannerAction=function(t){this.app.dispatch(a.actionWrapper({type:t,group:s.Group.Scanner,payload:{id:this.id}}))},e}(a.ActionSet);e.Scanner=u,e.create=function(t,e){return new u(t,e)},e.openCamera=function(){return a.actionWrapper({group:s.Group.Scanner,type:i.OPEN_CAMERA})},e.capture=function(t){return a.actionWrapper({group:s.Group.Scanner,type:i.CAPTURE,payload:t})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.respond=e.request=e.Action=void 0;var n,o=r(0),i=r(1);!function(t){t.REQUEST="APP::SESSION_TOKEN::REQUEST",t.RESPOND="APP::SESSION_TOKEN::RESPOND"}(n=e.Action||(e.Action={})),e.request=function(){return o.actionWrapper({group:i.Group.SessionToken,type:n.REQUEST})},e.respond=function(t){return o.actionWrapper({payload:t,group:i.Group.SessionToken,type:n.RESPOND})}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.TitleBar=e.update=e.clickBreadcrumb=e.clickActionButton=e.Action=void 0;var a,s=r(4),u=r(8),c=r(50),p=r(6),f=r(0),h=r(1);!function(t){t.UPDATE="APP::TITLEBAR::UPDATE",t.BUTTON_CLICK="APP::TITLEBAR::BUTTONS::BUTTON::CLICK",t.BUTTON_UPDATE="APP::TITLEBAR::BUTTONS::BUTTON::UPDATE",t.BUTTON_GROUP_UPDATE="APP::TITLEBAR::BUTTONS::BUTTONGROUP::UPDATE",t.BREADCRUMBS_CLICK="APP::TITLEBAR::BREADCRUMBS::BUTTON::CLICK",t.BREADCRUMBS_UPDATE="APP::TITLEBAR::BREADCRUMBS::BUTTON::UPDATE"}(a=e.Action||(e.Action={}));var d={group:h.Group.TitleBar,subgroups:["Buttons"]},l={group:h.Group.TitleBar,subgroups:["Breadcrumbs"],type:h.ComponentType.Button};function y(t){return f.actionWrapper({payload:t,group:h.Group.TitleBar,type:a.UPDATE})}e.clickActionButton=function(t,e){var r=h.ComponentType.Button,n=i({id:t,type:r},d);return s.clickButton(h.Group.TitleBar,n,e)},e.clickBreadcrumb=function(t,e){var r=i({id:t},l);return s.clickButton(h.Group.TitleBar,r,e)},e.update=y;var A=function(t){function e(e,r){var n=t.call(this,e,h.Group.TitleBar,h.Group.TitleBar)||this;return n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{breadcrumbs:this.breadcrumbsOption,buttons:this.buttonsOptions,title:this.title}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{breadcrumbs:this.breadcrumb,buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=f.getMergedProps(this.options,t),n=r.title,o=r.buttons,i=r.breadcrumbs;return this.title=n,this.setBreadcrumbs(i),this.setPrimaryButton(o?o.primary:void 0),this.setSecondaryButton(o?o.secondary:void 0),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(y(this.payload))}return this},e.prototype.getButton=function(t,e,r){return t instanceof u.ButtonGroup?c.getGroupedButton(this,t,e,r):p.getSingleButton(this,t,e,r)},e.prototype.updatePrimaryButton=function(t){this.primary&&f.updateActionFromPayload(this.primary,t)&&this.dispatch(a.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find((function(e){return e.id===t.id}));if(e){(u.isGroupedButtonPayload(t),f.updateActionFromPayload(e,t))&&this.dispatch(a.UPDATE)}}},e.prototype.updateBreadcrumbButton=function(t){this.breadcrumb&&f.updateActionFromPayload(this.breadcrumb,t)&&this.dispatch(a.UPDATE)},e.prototype.setPrimaryButton=function(t){this.primaryOptions=this.getChildButton(t,this.primaryOptions),this.primary=this.primaryOptions?this.getButton(this.primaryOptions,d.subgroups,this.updatePrimaryButton):void 0},e.prototype.setSecondaryButton=function(t){var e=this,r=t||[],n=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(r,n),this.secondary=this.secondaryOptions?this.secondaryOptions.map((function(t){return e.getButton(t,d.subgroups,e.updateSecondaryButtons)})):void 0},e.prototype.setBreadcrumbs=function(t){this.breadcrumbsOption=this.getChildButton(t,this.breadcrumbsOption),this.breadcrumb=this.breadcrumbsOption?this.getButton(this.breadcrumbsOption,l.subgroups,this.updateBreadcrumbButton):void 0},e.prototype.getChildButton=function(t,e){var r=t?[t]:[],n=e?[e]:[],o=this.getUpdatedChildActions(r,n);return o?o[0]:void 0},e}(f.ActionSetWithChildren);e.TitleBar=A,e.create=function(t,e){return new A(t,e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getGroupedButton=void 0;var n=r(8);e.getGroupedButton=function(t,e,r,o){t.addChild(e,t.group,r);var i=e.id,a=e.label,s=e.disabled,u=e.buttons,c=e.plain;return t.subscribeToChild(e,n.Action.UPDATE,o),{id:i,label:a,buttons:u,disabled:s,plain:c}}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ContextualSaveBar=e.discard=e.save=e.hide=e.show=e.Action=void 0;var a,s=r(0),u=r(1);function c(t,e){return s.actionWrapper({group:u.Group.ContextualSaveBar,type:t,payload:e})}!function(t){t.DISCARD="APP::CONTEXTUAL_SAVE_BAR::DISCARD",t.SAVE="APP::CONTEXTUAL_SAVE_BAR::SAVE",t.SHOW="APP::CONTEXTUAL_SAVE_BAR::SHOW",t.HIDE="APP::CONTEXTUAL_SAVE_BAR::HIDE",t.UPDATE="APP::CONTEXTUAL_SAVE_BAR::UPDATE"}(a=e.Action||(e.Action={})),e.show=function(t){return c(a.SHOW,t)},e.hide=function(t){return c(a.HIDE,t)},e.save=function(t){return c(a.SAVE,t)},e.discard=function(t){return c(a.DISCARD,t)};var p=function(t){function e(e,r){void 0===r&&(r={});var n=t.call(this,e,u.Group.ContextualSaveBar,u.Group.ContextualSaveBar)||this;return n.options=r,n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=s.getMergedProps(this.options,t);return this.options=r,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){return this.app.dispatch(c(t,this.payload)),this},e}(s.ActionSet);e.ContextualSaveBar=p,e.create=function(t,e){return new p(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.close=e.show=e.create=e.Share=e.Action=void 0;var a,s=r(1),u=r(0);!function(t){t.SHOW="APP::SHARE::SHOW",t.CLOSE="APP::SHARE::CLOSE"}(a=e.Action||(e.Action={}));var c=function(t){function e(e){return t.call(this,e,s.Group.Share,s.Group.Share)||this}return o(e,t),e.prototype.dispatch=function(t,e){switch(t){case a.SHOW:this.dispatchShareAction(a.SHOW,e);break;default:throw new Error("Action: "+t+" not supported")}return this},e.prototype.dispatchShareAction=function(t,e){this.app.dispatch(u.actionWrapper({type:t,group:s.Group.Share,payload:i({id:this.id},e)}))},e}(u.ActionSet);e.Share=c,e.create=function(t){return new c(t)},e.show=function(){return u.actionWrapper({group:s.Group.Share,type:a.SHOW})},e.close=function(){return u.actionWrapper({group:s.Group.Share,type:a.CLOSE})}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.NavigationMenu=e.update=e.Action=void 0;var a,s=r(10),u=r(0),c=r(1),p=["Navigation_Menu"];function f(t){return u.actionWrapper({payload:t,group:c.Group.Menu,type:a.UPDATE})}!function(t){t.UPDATE="APP::MENU::NAVIGATION_MENU::UPDATE",t.LINK_UPDATE="APP::MENU::NAVIGATION_MENU::LINK::UPDATE"}(a=e.Action||(e.Action={})),e.update=f;var h=function(t){function e(e,r){var n=t.call(this,e,"Navigation_Menu",c.Group.Menu)||this;return n.items=[],n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{items:this.itemsOptions,active:this.activeOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{active:this.active,items:this.items,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=u.getMergedProps(this.options,t),n=r.items,o=r.active;return this.setItems(n),this.activeOptions=o,this.active=o&&o.id,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(f(this.payload))}return this},e.prototype.updateItem=function(t){if(this.items){var e=this.items.find((function(e){return e.id===t.id}));e&&u.updateActionFromPayload(e,t)&&this.dispatch(a.UPDATE)}},e.prototype.setItems=function(t){var e=this,r=t||[],n=this.itemsOptions||[];this.itemsOptions=this.getUpdatedChildActions(r,n),this.items=this.itemsOptions?this.itemsOptions.map((function(t){return e.addChild(t,e.group,p),e.subscribeToChild(t,s.Action.UPDATE,e.updateItem),t.payload})):[]},e}(u.ActionSetWithChildren);e.NavigationMenu=h,e.create=function(t,e){return new h(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ChannelMenu=e.update=e.Action=void 0;var a,s=r(10),u=r(0),c=r(1),p=["Channel_Menu"];function f(t){return u.actionWrapper({payload:t,group:c.Group.Menu,type:a.UPDATE})}!function(t){t.UPDATE="APP::MENU::CHANNEL_MENU::UPDATE",t.LINK_UPDATE="APP::MENU::CHANNEL_MENU::LINK::UPDATE"}(a=e.Action||(e.Action={})),e.update=f;var h=function(t){function e(e,r){var n=t.call(this,e,"Channel_Menu",c.Group.Menu)||this;return n.items=[],n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{items:this.itemsOptions,active:this.activeOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{active:this.active,items:this.items,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=u.getMergedProps(this.options,t),n=r.items,o=r.active;return this.setItems(n),this.activeOptions=o,this.active=o&&o.id,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(f(this.payload))}return this},e.prototype.updateItem=function(t){if(this.items){var e=this.items.find((function(e){return e.id===t.id}));e&&u.updateActionFromPayload(e,t)&&this.dispatch(a.UPDATE)}},e.prototype.setItems=function(t){var e=this,r=t||[],n=this.itemsOptions||[];this.itemsOptions=this.getUpdatedChildActions(r,n),this.items=this.itemsOptions?this.itemsOptions.map((function(t){return e.addChild(t,e.group,p),e.subscribeToChild(t,s.Action.UPDATE,e.updateItem),t.payload})):[]},e}(u.ActionSetWithChildren);e.ChannelMenu=h,e.create=function(t,e){return new h(t,e)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Pos=e.close=e.Action=void 0;var i,a=r(0),s=r(1);function u(){return a.actionWrapper({group:s.Group.Pos,type:i.CLOSE})}!function(t){t.CLOSE="APP::POS::CLOSE",t.LOCATION_UPDATE="APP::POS::LOCATION::UPDATE",t.USER_UPDATE="APP::POS::USER::UPDATE",t.DEVICE_UPDATE="APP::POS::DEVICE::UPDATE"}(i=e.Action||(e.Action={})),e.close=u;var c=function(t){function e(e){return t.call(this,e,s.Group.Pos,s.Group.Pos)||this}return o(e,t),e.prototype.dispatch=function(t){switch(t){case i.CLOSE:this.app.dispatch(u())}return this},e}(a.ActionSet);e.Pos=c,e.create=function(t){return new c(t)}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.MarketingExternalActivityTopBar=e.update=e.clickActionButton=e.MarketingActivityStatusBadgeType=e.Action=void 0;var a,s=r(4),u=r(6),c=r(0),p=r(1);!function(t){t.UPDATE="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::UPDATE",t.BUTTON_CLICK="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::BUTTONS::BUTTON::CLICK",t.BUTTON_UPDATE="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::BUTTONS::BUTTON::UPDATE"}(a=e.Action||(e.Action={})),function(t){t.Default="DEFAULT",t.Success="SUCCESS",t.Attention="ATTENTION",t.Warning="WARNING",t.Info="INFO"}(e.MarketingActivityStatusBadgeType||(e.MarketingActivityStatusBadgeType={}));var f={group:p.Group.MarketingExternalActivityTopBar,subgroups:["Buttons"]};function h(t){return c.actionWrapper({payload:t,group:p.Group.MarketingExternalActivityTopBar,type:a.UPDATE})}e.clickActionButton=function(t,e){var r=p.ComponentType.Button,n=i({id:t,type:r},f);return s.clickButton(p.Group.MarketingExternalActivityTopBar,n,e)},e.update=h;var d=function(t){function e(e,r){var n=t.call(this,e,p.Group.MarketingExternalActivityTopBar,p.Group.MarketingExternalActivityTopBar)||this;return n.set(r),n}return o(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{title:this.title,status:this.status,saving:this.saving,saved:this.saved,buttons:this.buttonsOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=c.getMergedProps(this.options,t),n=r.title,o=r.buttons,i=r.saved,s=r.saving,u=r.status;return this.title=n,this.saving=s,this.saved=i,this.status=u,this.setPrimaryButton(o?o.primary:void 0),this.setSecondaryButtons(o?o.secondary:void 0),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(h(this.payload))}return this},e.prototype.getButton=function(t,e,r){return u.getSingleButton(this,t,e,r)},e.prototype.updatePrimaryButton=function(t){this.primary&&c.updateActionFromPayload(this.primary,t)&&this.dispatch(a.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find((function(e){return e.id===t.id}));if(e)c.updateActionFromPayload(e,t)&&this.dispatch(a.UPDATE)}},e.prototype.setPrimaryButton=function(t){this.primaryOptions=this.getChildButton(t,this.primaryOptions),this.primary=this.primaryOptions?this.getButton(this.primaryOptions,f.subgroups,this.updatePrimaryButton):void 0},e.prototype.setSecondaryButtons=function(t){var e=this,r=t||[],n=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(r,n),this.secondary=this.secondaryOptions?this.secondaryOptions.map((function(t){return e.getButton(t,f.subgroups,e.updateSecondaryButtons)})):void 0},e.prototype.updateSaving=function(t){this.saving=t,this.dispatch(a.UPDATE)},e.prototype.updateSaved=function(t){this.saved=t,this.dispatch(a.UPDATE)},e.prototype.updateStatus=function(t){this.status=t,this.dispatch(a.UPDATE)},e.prototype.getChildButton=function(t,e){var r=t?[t]:[],n=e?[e]:[],o=this.getUpdatedChildActions(r,n);return o?o[0]:void 0},e}(c.ActionSetWithChildren);e.MarketingExternalActivityTopBar=d,e.create=function(t,e){return new d(t,e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fullPageLoad=e.skeletonPageLoad=e.Action=void 0;var n,o=r(1),i=r(0);!function(t){t.SKELETON_PAGE_LOAD="APP::PERFORMANCE::SKELETON_PAGE_LOAD",t.FULL_PAGE_LOAD="APP::PERFORMANCE::FULL_PAGE_LOAD"}(n=e.Action||(e.Action={})),e.skeletonPageLoad=function(){return i.actionWrapper({group:o.Group.Performance,type:n.SKELETON_PAGE_LOAD})},e.fullPageLoad=function(){return i.actionWrapper({group:o.Group.Performance,type:n.FULL_PAGE_LOAD})}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.compatibilityCreateApp=e.setClientInterfaceHook=void 0;var i=o(r(59)),a=r(5);e.setClientInterfaceHook=function(t){return function(e){return e.clientInterface.name="@shopify/app-bridge [CDN Compatibility]",t(e)}},e.compatibilityCreateApp=function(t,r){var o=r(a.isV1Config(t)?function(t){var e=t.shopOrigin+"/admin",r=i.default(e),o=n(n({},t),{host:r});return delete o.shopOrigin,o}(t):t);return a.isV1Config(t)&&o.hooks.set(a.LifecycleHook.DispatchAction,e.setClientInterfaceHook),o}},function(t,e,r){t.exports=r(60).default,t.exports.default=t.exports},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(65);function o(e,r){return void 0===r&&(r="utf8"),t.isBuffer(e)?a(e.toString("base64")):a(t.from(e,r).toString("base64"))}function i(t){return t=t.toString(),n.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function a(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=o;s.encode=o,s.decode=function(e,r){return void 0===r&&(r="utf8"),t.from(i(e),"base64").toString(r)},s.toBase64=i,s.fromBase64=a,s.toBuffer=function(e){return t.from(i(e),"base64")},e.default=s}).call(this,r(23).Buffer)},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),a=n[0],s=n[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),p=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],u[p++]=e>>16&255,u[p++]=e>>8&255,u[p++]=255&e;2===s&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,u[p++]=255&e);1===s&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,u[p++]=e>>8&255,u[p++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,s=r-o;a<s;a+=16383)i.push(p(t,a,a+16383>s?s:a+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],o[a.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function p(t,e,r){for(var o,i,a=[],s=e;s<r;s+=3)o=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
9
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
10
|
-
e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,p=-7,f=r?o-1:0,h=r?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-p)-1,d>>=-p,p+=s;p>0;i=256*i+t[e+f],f+=h,p-=8);for(a=i&(1<<-p)-1,i>>=-p,p+=n;p>0;a=256*a+t[e+f],f+=h,p-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,u,c=8*i-o-1,p=(1<<c)-1,f=p>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,l=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=p?(s=0,a=p):a+f>=1?(s=(e*u-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&s,d+=l,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;t[r+d]=255&a,d+=l,a/=256,c-=8);t[r+d-l]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var r=e.length,n=r%4;if(!n)return e;var o=r,i=4-n,a=r+i,s=t.alloc(a);for(s.write(e);i--;)s.write("=",o++);return s.toString()}}).call(this,r(23).Buffer)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(5);Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i.createApp}}),o(r(15),e),o(r(5),e)}])}));
|