Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/app-bridge

Package Overview
Dependencies
Maintainers
11
Versions
322
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/app-bridge - npm Package Compare versions

Comparing version 1.0.0-4 to 1.0.0

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

<a name="1.0.0"></a>
# [1.0.0](https://github.com/Shopify/app-bridge/compare/v1.0.0-4...v1.0.0) (2018-12-20)
**Note:** Version bump only for package @shopify/app-bridge
<a name="1.0.0-4"></a>

@@ -8,0 +16,0 @@ # [1.0.0-4](https://github.com/Shopify/app-bridge/compare/v1.0.0-3...v1.0.0-4) (2018-12-20)

2

package.json
{
"name": "@shopify/app-bridge",
"version": "1.0.0-4",
"version": "1.0.0",
"types": "index.d.ts",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("actions",[],e):"object"==typeof exports?exports.actions=e():(t["app-bridge"]=t["app-bridge"]||{},t["app-bridge"].actions=e())}(window,function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=28)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup",t.Cart="Cart",t.Error="Error",t.Features="Features",t.Toast="Toast",t.Loading="Loading",t.Modal="Modal",t.Navigation="Navigation",t.Print="Print",t.TitleBar="TitleBar",t.ResourcePicker="Resource_Picker"}(e.Group||(e.Group={})),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup"}(e.ComponentType||(e.ComponentType={}))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var c=o(2),u=o(31),a=o(4),p=o(15),f=s(o(36)),d=o(0),l=s(o(37)),h=o(38),y="::";function A(){return h.version}function E(t,e,o){var n=t.toUpperCase();if(o){var r=o.subgroups,i=o.type;r&&r.length>0&&(n+=n.length>0?y:"",r.forEach(function(t,e){n+=""+t.toUpperCase()+(e<r.length-1?y:"")})),i!==t&&i&&(n+=""+(n.length>0?y:"")+i.toUpperCase())}return n&&(n+=""+(n.length>0?y:"")+e.toUpperCase()),""+p.PREFIX+y+n}e.actionWrapper=function(t){return i({},t,{version:A()})},e.getVersion=A,e.getEventNameSpace=E,e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t};var P=function(){function t(t,e,o,n){var r=this;this.app=t,this.type=e,this.group=o,this.subgroups=[],this.subscriptions=[],t||c.throwError(c.ActionType.INVALID_OPTIONS,"Missing required `app`"),this.id=n||l.default(),this.defaultGroup=o;var i=this.set;this.set=function(){for(var t,e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return r.app.hooks?(t=r.app.hooks).run.apply(t,[u.LifecycleHook.UpdateAction,i,r].concat(e)):i.apply(r,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:!0,configurable:!0}),t.prototype.updateSubscription=function(t,e,o){var n,r=t.eventType,i=t.callback,s=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=o,Object.assign(s,{subgroups:this.subgroups}),this.subscribe(r,i,s,n)},t.prototype.error=function(t){var e=this,o=[];return b(c.Action,function(n){o.push(e.subscriptions.length),e.subscribe(n,t)}),function(){o.map(function(t){return e.subscriptions[t]}).forEach(function(t){a.removeFromCollection(e.subscriptions,t,function(t){t.unsubscribe()})})}},t.prototype.subscribe=function(t,e,o,n){var r,s=this,u=o||this.component,a=t.toUpperCase(),p="number"==typeof n?e:e.bind(this);r=c.isErrorEventName(t)?E(d.Group.Error,t,i({},u,{type:""})):E(this.group,t,u);var f=this.app.subscribe(r,p,o?o.id:this.id),l={eventType:a,unsubscribe:f,callback:p,component:u,updateSubscribe:function(t,e){return s.updateSubscription.call(s,l,t,e)}};return"number"==typeof n&&n>=0&&n<this.subscriptions.length?this.subscriptions[n]=l:this.subscriptions.push(l),f},t.prototype.unsubscribe=function(t){return void 0===t&&(t=!1),T(this.subscriptions,this.defaultGroup,t),this},t}();e.ActionSet=P;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=[],e}return r(e,t),e.prototype.unsubscribe=function(t,o){return void 0===t&&(t=!0),void 0===o&&(o=!1),T(this.subscriptions,this.defaultGroup,o),this.children.forEach(function(o){e.prototype.isPrototypeOf(o)?o.unsubscribe(t,!t):o.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(o){return o.component.id===t&&(!e||e===o.eventType)})},e.prototype.addChild=function(t,o,n){var r=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||o===t.group&&n===t.subgroups?this:(i.forEach(function(t){(0,t.updateSubscribe)(o,n)}),Object.assign(t,{group:o,subgroups:n}),e.prototype.isPrototypeOf(t)&&t.children.forEach(function(t){return r.addChild(t,o,n)}),this)},e.prototype.removeChild=function(t){var e=this;return a.removeFromCollection(this.children,this.getChild(t),function(){e.subscriptions.filter(function(e){return e.component.id===t}).forEach(function(t){a.removeFromCollection(e.subscriptions,t,function(t){t.unsubscribe()})})}),this},e.prototype.subscribeToChild=function(t,e,o){var n=this,r=o.bind(this);if(e instanceof Array)return e.forEach(function(e){return n.subscribeToChild(t,e,o)}),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),s=this.getChildSubscriptions(t.id,i);if(s.length>0)s.forEach(function(e){return e.updateSubscribe(n.group,t.subgroups)});else{var c={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,r,c)}return this},e.prototype.getUpdatedChildActions=function(t,e){if(0!==t.length){for(var o=t.filter(function(t,e,o){return e===o.indexOf(t)}),n=o.map(function(t){return t.id}),r=e.filter(function(t){return n.indexOf(t.id)<0});r.length>0;){if(!(i=r.pop()))break;this.removeChild(i.id)}return o}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(P);function T(t,e,o){void 0===o&&(o=!1),t.forEach(function(t){o?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()}),o||(t.length=0)}function _(t,e){var o=f.default(t,e);return o||Object.assign(t,e)}function b(t,e){Object.keys(t).forEach(function(o){e(t[o])})}e.ActionSetWithChildren=O,e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,_(t,e)),!0)},e.getMergedProps=_,e.forEachInEnum=b,e.findMatchInEnum=function(t,e){var o=Object.keys(t).find(function(o){return e===t[o]});return o?t[o]:void 0}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(30)),n(o(9))},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(29)),n(o(18))},function(t,e,o){"use strict";function n(t,e,o){var n=t.findIndex(function(t){return t===e});return n>=0&&(t.splice(n,1),o&&o(e),!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.addAndRemoveFromCollection=function(t,e,o){return t.push(e),function(){return n(t,e,o)}},e.removeFromCollection=n},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(39)),n(o(19))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(3);e.getSingleButton=function(t,e,o,r){return t.addChild(e,t.group,o),t.subscribeToChild(e,n.Action.UPDATE,r),e.payload}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(44)),n(o(8))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.SHOW="APP::TOAST::SHOW",t.CLEAR="APP::TOAST::CLEAR"}(e.ActionType||(e.ActionType={})),function(t){t.SHOW="SHOW",t.CLEAR="CLEAR"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.INVALID_ACTION="INVALID_ACTION",t.INVALID_ACTION_TYPE="INVALID_ACTION_TYPE",t.INVALID_OPTIONS="INVALID_OPTIONS",t.INVALID_PAYLOAD="INVALID_PAYLOAD",t.UNEXPECTED_ACTION="UNEXPECTED_ACTION",t.PERSISTENCE="PERSISTENCE",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK="NETWORK",t.PERMISSION="PERMISSION"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),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.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN"}(e.AppActionType||(e.AppActionType={}))},function(t,e,o){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),s=o(2),c=o(11),u=o(13),a=o(4),p=o(33),f=o(34),d=o(16),l=o(17),h=r(o(35)),y="window is not defined. Running an app outside a browser is not supported";function A(){var t={},e=d.getLocation();return e?e.search.slice(e.search.indexOf("?")+1).split("&").reduce(function(t,e){var o,r=e.split("="),i=r[0],s=r[1];return n({},t,((o={})[decodeURIComponent(i)]=decodeURIComponent(s),o))},t):t}function E(t,o,n){if(void 0===n&&(n=[]),!t)throw s.fromAction(y,s.AppActionType.WINDOW_UNDEFINED);var r=d.getLocation(),i=o||r&&r.origin;if(!i)throw s.fromAction("local origin cannot be blank",s.AppActionType.MISSING_LOCAL_ORIGIN);var c=u.fromWindow(t,i);return e.createClientApp(c,n)}e.getUrlParams=A,e.getShopOrigin=function(){return A().shop},e.createClientApp=function(t,e){void 0===e&&(e=[]);var o=[],n=[],r={},u=function(t){var e=t.data;switch(e.type){case"getState":o.splice(0).forEach(function(t){return t(e.payload)});break;case"dispatch":var c=e.payload;!function(t,e){var o=!1;if(r.hasOwnProperty(t))for(var n=0,c=r[t];n<c.length;n++){var u=c[n],a=u.id,p=u.callback;(!e||e.id!==a)&&a||(p(e),o=!0)}if(!o){var f=i.findMatchInEnum(s.ActionType,t);f&&s.throwError(f,e)}}(c.type,c.payload),n.forEach(function(t){return t.callback(c)})}};return t.subscribe(u),function(y){if(!y.shopOrigin)throw s.fromAction("shopOrigin must be provided",s.AppActionType.INVALID_CONFIG);if(!y.apiKey)throw s.fromAction("apiKey must be provided",s.AppActionType.INVALID_CONFIG);!function(t,e){var o=e.apiKey,n=e.shopOrigin,r=e.forceRedirect,i=void 0===r?!p.isDevelopmentClient:r,s=d.getLocation();if(s&&i&&d.shouldRedirect(t)&&o&&n){var c="https://"+n+"/admin/apps/"+o+s.pathname+(s.search||"");d.redirect(c)}}(t.hostFrame,y);for(var A=function(e){var o={payload:e,source:y,type:"dispatch"};return u({data:o}),t.dispatch(o),e},E=new h.default,P={localOrigin:t.localOrigin,hooks:E,dispatch:function(t){return P.hooks?P.hooks.run(l.LifecycleHook.DispatchAction,A,P,t):A(t)},featuresAvailable:function(t){return P.getState("features").then(function(e){return t&&Object.keys(e).forEach(function(o){t.includes(o)||delete e[o]}),e})},getState:function(e){return new Promise(function(e){o.push(e),t.dispatch({payload:void 0,source:y,type:"getState"})}).then(function(t){return e?e.split(".").reduce(function(e,o){if("object"==typeof t&&!Array.isArray(t))return e=t[o],t=e,e},void 0):t})},subscribe:function(){if(arguments.length<2)return a.addAndRemoveFromCollection(n,{callback:arguments[0]});var t=arguments[0],e={callback:arguments[1],id:arguments[2]};return r.hasOwnProperty(t)||(r[t]=[]),a.addAndRemoveFromCollection(r[t],e)},error:function(t,e){var o=this,n=[];return i.forEachInEnum(s.ActionType,function(r){n.push(o.subscribe(r,t,e))}),function(){n.forEach(function(t){return t()})}}},O=0,T=e;O<T.length;O++){(0,T[O])(E,P)}return function(t){t.subscribe(c.ActionType.APP,f.handleAppPrint)}(P),P}},e.createAppWrapper=E,e.default=function(t){var e=d.getWindow();if(!e)throw s.fromAction(y,s.AppActionType.WINDOW_UNDEFINED);return E(e.top)(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(32)),n(o(12))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.APP="APP::PRINT::APP"}(e.ActionType||(e.ActionType={})),function(t){t.APP="APP"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=o(14),i=o(4);e.fromFrame=function(t,e){var o=[];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(t){if(t.origin===e&&r.isAppMessage(t))for(var n=0,i=o;n<i.length;n++)(0,i[n])(t)}),{localOrigin:e,hostFrame:s,dispatch:function(e){var o=t.contentWindow;o&&o.postMessage(e,"*")},subscribe:function(t){return i.addAndRemoveFromCollection(o,t)}}},e.fromWindow=function(t,e){var o=[];return void 0!==typeof window&&t!==window&&window.addEventListener("message",function(e){if(e.source===t&&(r.isAppBridgeAction(e.data.payload)||r.isAppMessage(e)))for(var n=0,i=o;n<i.length;n++)(0,i[n])(e)}),{localOrigin:e,hostFrame:t,dispatch:function(e){if(e.source&&e.source.shopOrigin){var o="https://"+e.source.shopOrigin;t.postMessage(e,o)}},subscribe:function(t){return i.addAndRemoveFromCollection(o,t)}}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(15);e.isAppBridgeAction=function(t){return t instanceof Object&&t.hasOwnProperty("type")&&t.type.toString().startsWith(n.PREFIX)},e.isFromApp=function(t){return"object"==typeof t&&"object"==typeof t.source&&"string"==typeof t.source.apiKey},e.isAppMessage=function(t){if("object"!=typeof t||!t.data||"object"!=typeof t.data)return!1;var e=t.data;return e.hasOwnProperty("type")&&("getState"===e.type||"dispatch"===e.type)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PREFIX="APP"},function(t,e,o){"use strict";function n(){return r()?window.location:void 0}function r(){return"undefined"!=typeof window}Object.defineProperty(e,"__esModule",{value:!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 r()?window:void 0}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(0);e.AnyAction=n.AnyAction,e.Dispatch=n.Dispatch,e.Unsubscribe=n.Unsubscribe;var r=o(13);e.Handler=r.Handler,e.HandlerData=r.HandlerData,function(t){t.UpdateAction="UpdateAction",t.DispatchAction="DispatchAction"}(e.LifecycleHook||(e.LifecycleHook={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.CLICK="CLICK",t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.CLICK="APP::BUTTON::CLICK",t.UPDATE="APP::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.Print="print"}(e.Icon||(e.Icon={})),function(t){t.Danger="danger"}(e.Style||(e.Style={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.UPDATE="APP::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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"}(e.ActionType||(e.ActionType={})),function(t){t.FETCH="FETCH",t.UPDATE="UPDATE",t.SET_CUSTOMER="SET_CUSTOMER",t.REMOVE_CUSTOMER="REMOVE_CUSTOMER",t.ADD_CUSTOMER_ADDRESS="ADD_CUSTOMER_ADDRESS",t.UPDATE_CUSTOMER_ADDRESS="UPDATE_CUSTOMER_ADDRESS",t.SET_DISCOUNT="SET_DISCOUNT",t.REMOVE_DISCOUNT="REMOVE_DISCOUNT",t.SET_PROPERTIES="SET_PROPERTIES",t.REMOVE_PROPERTIES="REMOVE_PROPERTIES",t.CLEAR="CLEAR",t.ADD_LINE_ITEM="ADD_LINE_ITEM",t.UPDATE_LINE_ITEM="UPDATE_LINE_ITEM",t.REMOVE_LINE_ITEM="REMOVE_LINE_ITEM",t.SET_LINE_ITEM_DISCOUNT="SET_LINE_ITEM_DISCOUNT",t.REMOVE_LINE_ITEM_DISCOUNT="REMOVE_LINE_ITEM_DISCOUNT",t.SET_LINE_ITEM_PROPERTIES="SET_LINE_ITEM_PROPERTIES",t.REMOVE_LINE_ITEM_PROPERTIES="REMOVE_LINE_ITEM_PROPERTIES"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="APP::FEATURES::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.START="APP::LOADING::START",t.STOP="APP::LOADING::STOP"}(e.ActionType||(e.ActionType={})),function(t){t.START="START",t.STOP="STOP"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.OPEN="OPEN",t.CLOSE="CLOSE",t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.OPEN="APP::MODAL::OPEN",t.CLOSE="APP::MODAL::CLOSE",t.UPDATE="APP::MODAL::UPDATE",t.FOOTER_BUTTON_CLICK="APP::MODAL::FOOTER::BUTTON::CLICK",t.FOOTER_BUTTON_UPDATE="APP::MODAL::FOOTER::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.Small="small",t.Medium="medium",t.Large="large",t.Full="full"}(e.Size||(e.Size={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.PUSH="APP::NAVIGATION::HISTORY::PUSH",t.REPLACE="APP::NAVIGATION::HISTORY::REPLACE"}(e.ActionType||(e.ActionType={})),function(t){t.PUSH="PUSH",t.REPLACE="REPLACE"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ADMIN_PATH="ADMIN::PATH",t.ADMIN_SECTION="ADMIN::SECTION",t.REMOTE="REMOTE",t.APP="APP"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),function(t){t.Product="products",t.Collection="collections",t.Order="orders",t.Customer="customers",t.Discount="discounts"}(e.ResourceType||(e.ResourceType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.OPEN="OPEN",t.SELECT="SELECT",t.CLOSE="CLOSE",t.UPDATE="UPDATE",t.CANCEL="CANCEL"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),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.Product="product",t.ProductVariant="variant",t.Collection="collection"}(e.ResourceType||(e.ResourceType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={}))},function(t,e,o){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}(o(0));var r=n(o(3));e.Button=r;var i=n(o(5));e.ButtonGroup=i;var s=n(o(40));e.Cart=s;var c=n(o(2));e.Error=c;var u=n(o(42));e.Flash=u;var a=n(o(45));e.Features=a;var p=n(o(47));e.Loading=p;var f=n(o(49));e.Modal=f;var d=n(o(51));e.History=d;var l=n(o(53));e.Redirect=l;var h=n(o(11));e.Print=h;var y=n(o(55));e.ResourcePicker=y;var A=n(o(57));e.TitleBar=A;var E=n(o(7));e.Toast=E;var P=o(14);e.isAppBridgeAction=P.isAppBridgeAction},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(18);function a(t,e,o){var n=e.id,r=s.getEventNameSpace(t,u.Action.CLICK,e),i={id:n,payload:o};return s.actionWrapper({type:r,group:t,payload:i})}function p(t,e,o){var n=e.id,r=o.label,c=s.getEventNameSpace(t,u.Action.UPDATE,e),a=i({id:n,label:r},o);return s.actionWrapper({type:c,group:t,payload:a})}e.clickButton=a,e.update=p,e.isValidButtonProps=function(t){return"string"==typeof t.id&&"string"==typeof t.label};var f=function(t){function e(e,o){var n=t.call(this,e,c.ComponentType.Button,c.Group.Button)||this;return n.disabled=!1,n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{disabled:this.disabled,icon:this.icon,label:this.label,style:this.style}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=s.getMergedProps(this.options,t),n=o.label,r=o.disabled,i=o.icon,c=o.style;return this.label=n,this.disabled=!!r,this.icon=i,this.style=c,e&&this.dispatch(u.Action.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case u.Action.CLICK:this.app.dispatch(a(this.group,this.component,e));break;case u.Action.UPDATE:var o=p(this.group,this.component,this.payload);this.app.dispatch(o)}return this},e}(s.ActionSet);e.Button=f,e.create=function(t,e){return new f(t,e)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(9);function s(t,e,o){var i=e.payload;return n.actionWrapper({type:t,group:r.Group.Error,payload:{action:e,message:o,type:t,id:i&&i.id?i.id:void 0}})}!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 s(i.ActionType.INVALID_PAYLOAD,t,e||"The action's payload is missing required properties or has invalid properties")},e.invalidActionType=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:i.ActionType.INVALID_ACTION_TYPE},type:i.ActionType.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:i.ActionType.INVALID_ACTION},type:i.ActionType.INVALID_ACTION})},e.unexpectedAction=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:i.ActionType.UNEXPECTED_ACTION},type:i.ActionType.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return s(i.ActionType.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return s(i.ActionType.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return s(i.ActionType.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return s(i.ActionType.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof n.findMatchInEnum(i.Action,t)};var c=function(){return 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,o){var n=new c(t?e+": "+t:e);return n.action=o,n.type=e,n}e.AppBridgeError=c,c.prototype=Object.create(Error.prototype),e.fromAction=u,e.throwError=function(){var t,e,o=arguments[0];throw"string"==typeof arguments[1]?t=arguments[1]:(e=arguments[1],t=arguments[2]||""),u(t,o,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(o(10));n(o(17)),e.default=i.default,n(o(10))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(12);e.app=function(){return n.actionWrapper({group:r.Group.Print,type:i.ActionType.APP})}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isServer="undefined"==typeof window,e.isClient=!e.isServer,e.isProduction=!0,e.isDevelopment=!e.isProduction,e.isDevelopmentClient=e.isDevelopment&&e.isClient},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(16);function r(){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(),r(),t.remove())}e.handleAppPrint=function(){navigator.userAgent.indexOf("iOS")>=0?i():r()}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(4),r=function(){function t(){this.map={}}return t.prototype.set=function(t,e){this.map.hasOwnProperty(t)||(this.map[t]=[]);var o={handler:e,remove:function(){}},r=n.addAndRemoveFromCollection(this.map[t],o);return o={handler:e,remove:r},r},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,o){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];var i=0,s=this.get(t)||[];return function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var c=s[i++];return c?c(t).apply(o,n):e.apply(o,n)}.apply(o,n)},t}();e.default=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,o){if(void 0!==o){if(!Object.getPrototypeOf(e).isPrototypeOf(o)||"Object"!==o.constructor.name&&"Array"!==o.constructor.name)return o;var n={};return Object.keys(o).forEach(function(r){e.hasOwnProperty(r)?"object"!=typeof e[r]||Array.isArray(e[r])?n[r]=o[r]:n[r]=t(e[r],o[r]):n[r]=o[r]}),Object.keys(e).forEach(function(t){o.hasOwnProperty(t)||(n[t]=e[t])}),Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}}},function(t,e,o){"use strict";function n(t){return Array.from(t).map(function(t){return("00"+t.toString(16)).slice(-2)}).join("")}function r(t){if("function"==typeof Uint8Array&&window.crypto){var e=new Uint8Array(t),o=window.crypto.getRandomValues(e);if(o)return o}return Array.from(new Array(t),function(){return 255*Math.random()|0})}function i(){var t=r(1),e=r(2);return t[0]&=191,e[0]&=79,[n(r(4)),"-",n(r(2)),"-",n(e),"-",n(t),n(r(1)),"-",n(r(6))].join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=i,e.default=i},function(t){t.exports={name:"@shopify/app-bridge",version:"1.0.0-4",types:"index.d.ts",main:"index.js",browser:"umd/index.js",files:["MessageTransport.d.ts","MessageTransport.js","MessageTransport.js.map","actions/","client/","index.d.ts","index.js","index.js.map","umd/","util/"],private:!1,publishConfig:{access:"public","@shopify:registry":"https://registry.npmjs.org"},repository:"git@github.com:Shopify/app-bridge.git",author:"Shopify Inc.",license:"MIT",scripts:{build:"yarn build:tsc && yarn build:umd","build:tsc":"NODE_ENV=production tsc","build:umd":"NODE_ENV=production webpack -p",check:"tsc --pretty --noEmit",clean:"cat package.json | node -pe \"JSON.parse(require('fs').readFileSync('/dev/stdin').toString()).files.join(' ')\" | xargs rm -rf",pack:"yarn pack",size:"size-limit"},sideEffects:!1,"size-limit":[{limit:"14 KB",path:"index.js"}],devDependencies:{"@types/node":"^10.12.5",typescript:"3.2.1"},resolutions:{sqlite3:"4.0.1"}}},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(6),c=o(1),u=o(0),a=o(19);function p(t,e,o){return function(t,e,o,n,r){var s=e.id,u=n.label,a=c.getEventNameSpace(t,o,e),p=i({id:s,label:u},n,{payload:r});return c.actionWrapper({type:a,group:t,payload:p})}(t,e,a.Action.UPDATE,o)}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,o){var n=t.call(this,e,u.ComponentType.ButtonGroup,u.Group.ButtonGroup)||this;return n.disabled=!1,n.buttonsOptions=[],n.buttons=[],n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{buttons:this.buttonsOptions,disabled:this.disabled,label:this.label}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{buttons:this.buttons,id:this.id})},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=c.getMergedProps(this.options,t),n=o.label,r=o.disabled,i=o.buttons;return this.label=n,this.disabled=!!r,this.buttons=this.getButtons(i),e&&this.dispatch(a.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.Action.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,o=0,n=this.buttons;o<n.length;o++){var r=n[o];if(e=c.updateActionFromPayload(r,t))break}e&&this.dispatch(a.Action.UPDATE)}},e.prototype.getSingleButton=function(t){return s.getSingleButton(this,t,this.subgroups,this.updateButtons)},e.prototype.getButtons=function(t){var e=this,o=[];return t?(t.forEach(function(t){var n=s.getSingleButton(e,t,e.subgroups,e.updateButtons);o.push(n)}),this.buttonsOptions=t,o):[]},e}(c.ActionSetWithChildren);e.ButtonGroup=f,e.create=function(t,e){return new f(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(41)),n(o(20))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(20),a=function(t){function e(e,o){return t.call(this,e,c.Group.Cart,c.Group.Cart,o?o.id:void 0)||this}return r(e,t),e.prototype.dispatch=function(t,e){switch(t){case u.Action.FETCH:this.dispatchCartAction(u.ActionType.FETCH);break;case u.Action.UPDATE:this.dispatchCartAction(u.ActionType.UPDATE,e);break;case u.Action.SET_CUSTOMER:this.dispatchCartAction(u.ActionType.SET_CUSTOMER,e);break;case u.Action.REMOVE_CUSTOMER:this.dispatchCartAction(u.ActionType.REMOVE_CUSTOMER,e);break;case u.Action.ADD_CUSTOMER_ADDRESS:this.dispatchCartAction(u.ActionType.ADD_CUSTOMER_ADDRESS,e);break;case u.Action.UPDATE_CUSTOMER_ADDRESS:this.dispatchCartAction(u.ActionType.UPDATE_CUSTOMER_ADDRESS,e);break;case u.Action.SET_DISCOUNT:this.dispatchCartAction(u.ActionType.SET_DISCOUNT,e);break;case u.Action.REMOVE_DISCOUNT:this.dispatchCartAction(u.ActionType.REMOVE_DISCOUNT,e);break;case u.Action.SET_PROPERTIES:this.dispatchCartAction(u.ActionType.SET_PROPERTIES,e);break;case u.Action.REMOVE_PROPERTIES:this.dispatchCartAction(u.ActionType.REMOVE_PROPERTIES,e);break;case u.Action.CLEAR:this.dispatchCartAction(u.ActionType.CLEAR,e);break;case u.Action.ADD_LINE_ITEM:this.dispatchCartAction(u.ActionType.ADD_LINE_ITEM,e);break;case u.Action.UPDATE_LINE_ITEM:this.dispatchCartAction(u.ActionType.UPDATE_LINE_ITEM,e);break;case u.Action.REMOVE_LINE_ITEM:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM,e);break;case u.Action.SET_LINE_ITEM_DISCOUNT:this.dispatchCartAction(u.ActionType.SET_LINE_ITEM_DISCOUNT,e);break;case u.Action.REMOVE_LINE_ITEM_DISCOUNT:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM_DISCOUNT,e);break;case u.Action.SET_LINE_ITEM_PROPERTIES:this.dispatchCartAction(u.ActionType.SET_LINE_ITEM_PROPERTIES,e);break;case u.Action.REMOVE_LINE_ITEM_PROPERTIES:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM_PROPERTIES,e)}return this},e.prototype.dispatchCartAction=function(t,e){this.app.dispatch(s.actionWrapper({type:t,group:c.Group.Cart,payload:i({},e||{},{id:this.id})}))},e}(s.ActionSet);e.Cart=a,e.create=function(t,e){return new a(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(43)),n(o(8))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0});var i=o(7),s=o(7);e.ActionBase=s.ActionBase,e.clear=s.clear,e.ClearAction=s.ClearAction,e.show=s.show,e.ShowAction=s.ShowAction,e.FlashAction=s.ToastAction;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(i.Toast);e.Flash=c,e.create=function(t,e){return new c(t,e)}},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(8);function a(t){return s.actionWrapper({group:c.Group.Toast,payload:t,type:u.ActionType.SHOW})}function p(t){return s.actionWrapper({payload:t,group:c.Group.Toast,type:u.ActionType.CLEAR})}e.show=a,e.clear=p;var f=function(t){function e(e,o){var n=t.call(this,e,c.Group.Toast,c.Group.Toast)||this;return n.message="",n.duration=3e3,n.set(o),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{duration:this.duration,isError:this.isError,message:this.message}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!0,configurable:!0}),e.prototype.set=function(t){var e=s.getMergedProps(this.options,t),o=e.message,n=e.duration,r=e.isError;return this.message=o,this.duration=n,this.isError=r,this},e.prototype.dispatch=function(t){switch(t){case u.Action.SHOW:var e=a(this.payload);this.app.dispatch(e);break;case u.Action.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,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(46)),n(o(21))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(2),s=o(21);e.update=function(){return n.actionWrapper({group:r.Group.Features,type:s.ActionType.UPDATE})},e.validationError=function(t){switch(t.type){case s.ActionType.UPDATE:return;default:return i.invalidActionType(t)}}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(48)),n(o(22))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),s=o(0),c=o(22);function u(t){return i.actionWrapper({payload:t,group:s.Group.Loading,type:c.ActionType.START})}function a(t){return i.actionWrapper({payload:t,group:s.Group.Loading,type:c.ActionType.STOP})}e.start=u,e.stop=a;var p=function(t){function e(e){return t.call(this,e,s.Group.Loading,s.Group.Loading)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t){switch(t){case c.Action.START:this.app.dispatch(u(this.payload));break;case c.Action.STOP:this.app.dispatch(a(this.payload))}return this},e}(i.ActionSet);e.Loading=p,e.create=function(t){return new p(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(50)),n(o(23))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(6),c=o(1),u=o(0),a=o(3),p=o(23),f={group:u.Group.Modal,subgroups:["Footer"],type:u.ComponentType.Button};function d(t){return c.actionWrapper({group:u.Group.Modal,payload:t,type:p.ActionType.OPEN})}function l(t){return c.actionWrapper({group:u.Group.Modal,payload:t,type:p.ActionType.CLOSE})}function h(t){return c.actionWrapper({payload:t,group:u.Group.Modal,type:p.ActionType.UPDATE})}function y(t){return"string"==typeof t.url||"string"==typeof t.path}e.openModal=d,e.closeModal=l,e.clickFooterButton=function(t,e){var o=i({id:t},f);return a.clickButton(u.Group.Modal,o,e)},e.update=h,e.isIframeModal=y,e.isMessageModal=function(t){return"string"==typeof t.message};var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=p.Size.Small,e}return r(e,t),Object.defineProperty(e.prototype,"footer",{get:function(){if(this.footerPrimary||this.footerSecondary)return{buttons:{primary:this.footerPrimary,secondary:this.footerSecondary}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footerOptions",{get:function(){if(this.footerPrimaryOptions||this.footerSecondaryOptions)return{buttons:{primary:this.footerPrimaryOptions,secondary:this.footerSecondaryOptions}}},enumerable:!0,configurable:!0}),e.prototype.close=function(){this.app.dispatch(l({id:this.id}))},e.prototype.setFooterPrimaryButton=function(t,e){var o=this,n=f.subgroups;this.footerPrimaryOptions=this.getChildButton(t,this.footerPrimaryOptions),this.footerPrimary=this.footerPrimaryOptions?s.getSingleButton(this,this.footerPrimaryOptions,n,function(t){o.updatePrimaryFooterButton(t,e)}):void 0},e.prototype.setFooterSecondaryButtons=function(t,e){var o=this,n=f.subgroups,r=t||[],i=this.footerOptions&&this.footerOptions.buttons.secondary||[];this.footerSecondaryOptions=this.getUpdatedChildActions(r,i),this.footerSecondary=this.footerSecondaryOptions?this.footerSecondaryOptions.map(function(t){return s.getSingleButton(o,t,n,function(t){o.updateSecondaryFooterButton(t,e)})}):void 0},e.prototype.getChildButton=function(t,e){var o=t?[t]:[],n=e?[e]:[],r=this.getUpdatedChildActions(o,n);return r?r[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 o,n=0,r=this.footer.buttons.secondary;n<r.length;n++){var i=r[n];if(o=c.updateActionFromPayload(i,t))break}o&&e()}},e}(c.ActionSetWithChildren);e.Modal=A;var E=function(t){function e(e,o){var n=t.call(this,e,u.Group.Modal,u.Group.Modal)||this;return n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{footer:this.footer,id:this.id})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,message:this.message,size:this.size,title:this.title}},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){var o=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),r=n.title,i=n.footer,s=n.message,u=n.size;return this.title=r,this.message=s,this.size=u,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,function(){o.dispatch(p.Action.UPDATE)}),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,function(){o.dispatch(p.Action.UPDATE)}),e&&this.dispatch(p.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case p.Action.OPEN:this.app.dispatch(d(this.payload));break;case p.Action.CLOSE:this.close();break;case p.Action.UPDATE:this.app.dispatch(h(this.payload))}return this},e}(A);e.ModalMessage=E;var P=function(t){function e(e,o){var n=t.call(this,e,u.Group.Modal,u.Group.Modal)||this;return n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{footer:this.footer,id:this.id})},enumerable:!0,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}},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){var o=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),r=n.title,i=n.footer,s=n.path,u=n.url,a=n.size;return this.title=r,this.url=u,this.path=s,this.size=a,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,function(){o.dispatch(p.Action.UPDATE)}),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,function(){o.dispatch(p.Action.UPDATE)}),e&&this.dispatch(p.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case p.Action.OPEN:this.app.dispatch(d(this.payload));break;case p.Action.CLOSE:this.close();break;case p.Action.UPDATE:this.app.dispatch(h(this.payload))}return this},e}(A);e.ModalIframe=P,e.create=function(t,e){return y(e)?new P(t,e):new E(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(52)),n(o(24))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(24);function a(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.PUSH})}function p(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.REPLACE})}e.push=a,e.replace=p;var f=function(t){function e(e){return t.call(this,e,"History",c.Group.Navigation)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t,e){var o=i({},this.payload,{path:e});switch(t){case u.Action.PUSH:this.app.dispatch(a(o));break;case u.Action.REPLACE:this.app.dispatch(p(o))}return this},e}(s.ActionSet);e.History=f,e.create=function(t){return new f(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(54)),n(o(25))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(25);function a(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:c.Group.Navigation,type:u.ActionType.ADMIN_PATH})}function d(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.ADMIN_SECTION})}function l(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.REMOTE})}function h(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.APP})}e.isResourcePayload=function(t){return"string"==typeof t.id},e.isCreateResourcePayload=a,e.isProductVariantResourcePayload=p,e.isProductVariantCreateResourcePayload=function(t){return!!p(t)&&a(t.variant)},e.toAdminPath=f,e.toAdminSection=d,e.toRemote=l,e.toApp=h;var y=function(t){function e(e){return t.call(this,e,"Redirect",c.Group.Navigation)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t,e){switch(t){case u.Action.ADMIN_PATH:var o=function(t){return"object"==typeof t&&t.hasOwnProperty("path")}(e)?e:{path:e};this.app.dispatch(f(i({},this.payload,o)));break;case u.Action.ADMIN_SECTION:var n=function(t){return"object"==typeof t&&"object"==typeof t.section&&t.section.hasOwnProperty("name")}(e)?e:{section:e};this.app.dispatch(d(i({},this.payload,n)));break;case u.Action.APP:this.app.dispatch(h(i({},this.payload,{path:e})));break;case u.Action.REMOTE:var r=function(t){return"object"==typeof t&&t.hasOwnProperty("url")}(e)?e:{url:e};this.app.dispatch(l(i({},this.payload,r)))}return this},e}(s.ActionSet);e.Redirect=y,e.create=function(t){return new y(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(56)),n(o(26))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(26);function a(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.SELECT})}function p(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.OPEN})}function f(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.CANCEL})}function d(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.UPDATE})}e.select=a,e.open=p,e.cancel=f,e.close=function(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.CANCEL})},e.update=d;var l=function(t){function e(e,o,n){var r=t.call(this,e,c.Group.ResourcePicker,c.Group.ResourcePicker)||this;return r.selection=[],r.resourceType=n,r.set(o,!1),r}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{id:this.id,resourceType:this.resourceType})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){var t={initialQuery:this.initialQuery,selectMultiple:this.selectMultiple,showHidden:this.showHidden};return this.resourceType===u.ResourceType.Product?i({},t,{showVariants:this.showVariants}):t},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=s.getMergedProps(this.options,t),n=o.initialQuery,r=o.showHidden,i=void 0!==r&&r,c=o.showVariants,u=void 0===c||c,a=o.selectMultiple,p=void 0===a||a;return this.initialQuery=n,this.showHidden=Boolean(i),this.showVariants=Boolean(u),this.selectMultiple=Boolean(p),e&&this.update(),this},e.prototype.dispatch=function(t,e){return t===u.Action.OPEN?this.open():t===u.Action.UPDATE?this.update():t===u.Action.CLOSE||t===u.Action.CANCEL?this.cancel():t===u.Action.SELECT&&(this.selection=e,this.app.dispatch(a({id:this.id,selection:this.selection}))),this},e.prototype.update=function(){this.app.dispatch(d(this.payload))},e.prototype.open=function(){this.app.dispatch(p(this.payload))},e.prototype.cancel=function(){this.app.dispatch(f({id:this.id}))},e.prototype.close=function(){this.cancel()},e}(s.ActionSet);e.ResourcePicker=l,e.create=function(t,e){var o=e.resourceType,n=e.options;return new l(t,void 0===n?{}:n,o)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(58)),n(o(27))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(3),c=o(5),u=o(59),a=o(6),p=o(1),f=o(0),d=o(27),l={group:f.Group.TitleBar,subgroups:["Buttons"]},h={group:f.Group.TitleBar,subgroups:["Breadcrumbs"],type:f.ComponentType.Button};function y(t){return p.actionWrapper({payload:t,group:f.Group.TitleBar,type:d.ActionType.UPDATE})}e.clickActionButton=function(t,e){var o=f.ComponentType.Button,n=i({id:t,type:o},l);return s.clickButton(f.Group.TitleBar,n,e)},e.clickBreadcrumb=function(t,e){var o=i({id:t},h);return s.clickButton(f.Group.TitleBar,o,e)},e.update=y;var A=function(t){function e(e,o){var n=t.call(this,e,f.Group.TitleBar,f.Group.TitleBar)||this;return n.set(o),n}return r(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{breadcrumbs:this.breadcrumbsOption,buttons:this.buttonsOptions,title:this.title}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{breadcrumbs:this.breadcrumb,buttons:this.buttons,id:this.id})},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=p.getMergedProps(this.options,t),n=o.title,r=o.buttons,i=o.breadcrumbs;return this.title=n,this.setBreadcrumbs(i),this.setPrimaryButton(r?r.primary:void 0),this.setSecondaryButton(r?r.secondary:void 0),e&&this.dispatch(d.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case d.Action.UPDATE:this.app.dispatch(y(this.payload))}return this},e.prototype.getButton=function(t,e,o){return t instanceof c.ButtonGroup?u.getGroupedButton(this,t,e,o):a.getSingleButton(this,t,e,o)},e.prototype.updatePrimaryButton=function(t){this.primary&&p.updateActionFromPayload(this.primary,t)&&this.dispatch(d.Action.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find(function(e){return e.id===t.id});if(e){(c.isGroupedButtonPayload(t),p.updateActionFromPayload(e,t))&&this.dispatch(d.Action.UPDATE)}}},e.prototype.updateBreadcrumbButton=function(t){this.breadcrumb&&p.updateActionFromPayload(this.breadcrumb,t)&&this.dispatch(d.Action.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.setSecondaryButton=function(t){var e=this,o=t||[],n=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(o,n),this.secondary=this.secondaryOptions?this.secondaryOptions.map(function(t){return e.getButton(t,l.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,h.subgroups,this.updateBreadcrumbButton):void 0},e.prototype.getChildButton=function(t,e){var o=t?[t]:[],n=e?[e]:[],r=this.getUpdatedChildActions(o,n);return r?r[0]:void 0},e}(p.ActionSetWithChildren);e.TitleBar=A,e.create=function(t,e){return new A(t,e)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(5);e.getGroupedButton=function(t,e,o,r){t.addChild(e,t.group,o);var i=e.id,s=e.label,c=e.disabled,u=e.buttons;return t.subscribeToChild(e,n.Action.UPDATE,r),{id:i,label:s,buttons:u,disabled:c}}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("actions",[],e):"object"==typeof exports?exports.actions=e():(t["app-bridge"]=t["app-bridge"]||{},t["app-bridge"].actions=e())}(window,function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=28)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup",t.Cart="Cart",t.Error="Error",t.Features="Features",t.Toast="Toast",t.Loading="Loading",t.Modal="Modal",t.Navigation="Navigation",t.Print="Print",t.TitleBar="TitleBar",t.ResourcePicker="Resource_Picker"}(e.Group||(e.Group={})),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup"}(e.ComponentType||(e.ComponentType={}))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var c=o(2),u=o(31),a=o(4),p=o(15),f=s(o(36)),d=o(0),l=s(o(37)),h=o(38),y="::";function A(){return h.version}function E(t,e,o){var n=t.toUpperCase();if(o){var r=o.subgroups,i=o.type;r&&r.length>0&&(n+=n.length>0?y:"",r.forEach(function(t,e){n+=""+t.toUpperCase()+(e<r.length-1?y:"")})),i!==t&&i&&(n+=""+(n.length>0?y:"")+i.toUpperCase())}return n&&(n+=""+(n.length>0?y:"")+e.toUpperCase()),""+p.PREFIX+y+n}e.actionWrapper=function(t){return i({},t,{version:A()})},e.getVersion=A,e.getEventNameSpace=E,e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t};var P=function(){function t(t,e,o,n){var r=this;this.app=t,this.type=e,this.group=o,this.subgroups=[],this.subscriptions=[],t||c.throwError(c.ActionType.INVALID_OPTIONS,"Missing required `app`"),this.id=n||l.default(),this.defaultGroup=o;var i=this.set;this.set=function(){for(var t,e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return r.app.hooks?(t=r.app.hooks).run.apply(t,[u.LifecycleHook.UpdateAction,i,r].concat(e)):i.apply(r,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:!0,configurable:!0}),t.prototype.updateSubscription=function(t,e,o){var n,r=t.eventType,i=t.callback,s=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=o,Object.assign(s,{subgroups:this.subgroups}),this.subscribe(r,i,s,n)},t.prototype.error=function(t){var e=this,o=[];return b(c.Action,function(n){o.push(e.subscriptions.length),e.subscribe(n,t)}),function(){o.map(function(t){return e.subscriptions[t]}).forEach(function(t){a.removeFromCollection(e.subscriptions,t,function(t){t.unsubscribe()})})}},t.prototype.subscribe=function(t,e,o,n){var r,s=this,u=o||this.component,a=t.toUpperCase(),p="number"==typeof n?e:e.bind(this);r=c.isErrorEventName(t)?E(d.Group.Error,t,i({},u,{type:""})):E(this.group,t,u);var f=this.app.subscribe(r,p,o?o.id:this.id),l={eventType:a,unsubscribe:f,callback:p,component:u,updateSubscribe:function(t,e){return s.updateSubscription.call(s,l,t,e)}};return"number"==typeof n&&n>=0&&n<this.subscriptions.length?this.subscriptions[n]=l:this.subscriptions.push(l),f},t.prototype.unsubscribe=function(t){return void 0===t&&(t=!1),T(this.subscriptions,this.defaultGroup,t),this},t}();e.ActionSet=P;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=[],e}return r(e,t),e.prototype.unsubscribe=function(t,o){return void 0===t&&(t=!0),void 0===o&&(o=!1),T(this.subscriptions,this.defaultGroup,o),this.children.forEach(function(o){e.prototype.isPrototypeOf(o)?o.unsubscribe(t,!t):o.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(o){return o.component.id===t&&(!e||e===o.eventType)})},e.prototype.addChild=function(t,o,n){var r=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||o===t.group&&n===t.subgroups?this:(i.forEach(function(t){(0,t.updateSubscribe)(o,n)}),Object.assign(t,{group:o,subgroups:n}),e.prototype.isPrototypeOf(t)&&t.children.forEach(function(t){return r.addChild(t,o,n)}),this)},e.prototype.removeChild=function(t){var e=this;return a.removeFromCollection(this.children,this.getChild(t),function(){e.subscriptions.filter(function(e){return e.component.id===t}).forEach(function(t){a.removeFromCollection(e.subscriptions,t,function(t){t.unsubscribe()})})}),this},e.prototype.subscribeToChild=function(t,e,o){var n=this,r=o.bind(this);if(e instanceof Array)return e.forEach(function(e){return n.subscribeToChild(t,e,o)}),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),s=this.getChildSubscriptions(t.id,i);if(s.length>0)s.forEach(function(e){return e.updateSubscribe(n.group,t.subgroups)});else{var c={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,r,c)}return this},e.prototype.getUpdatedChildActions=function(t,e){if(0!==t.length){for(var o=t.filter(function(t,e,o){return e===o.indexOf(t)}),n=o.map(function(t){return t.id}),r=e.filter(function(t){return n.indexOf(t.id)<0});r.length>0;){if(!(i=r.pop()))break;this.removeChild(i.id)}return o}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(P);function T(t,e,o){void 0===o&&(o=!1),t.forEach(function(t){o?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()}),o||(t.length=0)}function _(t,e){var o=f.default(t,e);return o||Object.assign(t,e)}function b(t,e){Object.keys(t).forEach(function(o){e(t[o])})}e.ActionSetWithChildren=O,e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,_(t,e)),!0)},e.getMergedProps=_,e.forEachInEnum=b,e.findMatchInEnum=function(t,e){var o=Object.keys(t).find(function(o){return e===t[o]});return o?t[o]:void 0}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(30)),n(o(9))},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(29)),n(o(18))},function(t,e,o){"use strict";function n(t,e,o){var n=t.findIndex(function(t){return t===e});return n>=0&&(t.splice(n,1),o&&o(e),!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.addAndRemoveFromCollection=function(t,e,o){return t.push(e),function(){return n(t,e,o)}},e.removeFromCollection=n},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(39)),n(o(19))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(3);e.getSingleButton=function(t,e,o,r){return t.addChild(e,t.group,o),t.subscribeToChild(e,n.Action.UPDATE,r),e.payload}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(44)),n(o(8))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.SHOW="APP::TOAST::SHOW",t.CLEAR="APP::TOAST::CLEAR"}(e.ActionType||(e.ActionType={})),function(t){t.SHOW="SHOW",t.CLEAR="CLEAR"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.INVALID_ACTION="INVALID_ACTION",t.INVALID_ACTION_TYPE="INVALID_ACTION_TYPE",t.INVALID_OPTIONS="INVALID_OPTIONS",t.INVALID_PAYLOAD="INVALID_PAYLOAD",t.UNEXPECTED_ACTION="UNEXPECTED_ACTION",t.PERSISTENCE="PERSISTENCE",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK="NETWORK",t.PERMISSION="PERMISSION"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),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.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN"}(e.AppActionType||(e.AppActionType={}))},function(t,e,o){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),s=o(2),c=o(11),u=o(13),a=o(4),p=o(33),f=o(34),d=o(16),l=o(17),h=r(o(35)),y="window is not defined. Running an app outside a browser is not supported";function A(){var t={},e=d.getLocation();return e?e.search.slice(e.search.indexOf("?")+1).split("&").reduce(function(t,e){var o,r=e.split("="),i=r[0],s=r[1];return n({},t,((o={})[decodeURIComponent(i)]=decodeURIComponent(s),o))},t):t}function E(t,o,n){if(void 0===n&&(n=[]),!t)throw s.fromAction(y,s.AppActionType.WINDOW_UNDEFINED);var r=d.getLocation(),i=o||r&&r.origin;if(!i)throw s.fromAction("local origin cannot be blank",s.AppActionType.MISSING_LOCAL_ORIGIN);var c=u.fromWindow(t,i);return e.createClientApp(c,n)}e.getUrlParams=A,e.getShopOrigin=function(){return A().shop},e.createClientApp=function(t,e){void 0===e&&(e=[]);var o=[],n=[],r={},u=function(t){var e=t.data;switch(e.type){case"getState":o.splice(0).forEach(function(t){return t(e.payload)});break;case"dispatch":var c=e.payload;!function(t,e){var o=!1;if(r.hasOwnProperty(t))for(var n=0,c=r[t];n<c.length;n++){var u=c[n],a=u.id,p=u.callback;(!e||e.id!==a)&&a||(p(e),o=!0)}if(!o){var f=i.findMatchInEnum(s.ActionType,t);f&&s.throwError(f,e)}}(c.type,c.payload),n.forEach(function(t){return t.callback(c)})}};return t.subscribe(u),function(y){if(!y.shopOrigin)throw s.fromAction("shopOrigin must be provided",s.AppActionType.INVALID_CONFIG);if(!y.apiKey)throw s.fromAction("apiKey must be provided",s.AppActionType.INVALID_CONFIG);!function(t,e){var o=e.apiKey,n=e.shopOrigin,r=e.forceRedirect,i=void 0===r?!p.isDevelopmentClient:r,s=d.getLocation();if(s&&i&&d.shouldRedirect(t)&&o&&n){var c="https://"+n+"/admin/apps/"+o+s.pathname+(s.search||"");d.redirect(c)}}(t.hostFrame,y);for(var A=function(e){var o={payload:e,source:y,type:"dispatch"};return u({data:o}),t.dispatch(o),e},E=new h.default,P={localOrigin:t.localOrigin,hooks:E,dispatch:function(t){return P.hooks?P.hooks.run(l.LifecycleHook.DispatchAction,A,P,t):A(t)},featuresAvailable:function(t){return P.getState("features").then(function(e){return t&&Object.keys(e).forEach(function(o){t.includes(o)||delete e[o]}),e})},getState:function(e){return new Promise(function(e){o.push(e),t.dispatch({payload:void 0,source:y,type:"getState"})}).then(function(t){return e?e.split(".").reduce(function(e,o){if("object"==typeof t&&!Array.isArray(t))return e=t[o],t=e,e},void 0):t})},subscribe:function(){if(arguments.length<2)return a.addAndRemoveFromCollection(n,{callback:arguments[0]});var t=arguments[0],e={callback:arguments[1],id:arguments[2]};return r.hasOwnProperty(t)||(r[t]=[]),a.addAndRemoveFromCollection(r[t],e)},error:function(t,e){var o=this,n=[];return i.forEachInEnum(s.ActionType,function(r){n.push(o.subscribe(r,t,e))}),function(){n.forEach(function(t){return t()})}}},O=0,T=e;O<T.length;O++){(0,T[O])(E,P)}return function(t){t.subscribe(c.ActionType.APP,f.handleAppPrint)}(P),P}},e.createAppWrapper=E,e.default=function(t){var e=d.getWindow();if(!e)throw s.fromAction(y,s.AppActionType.WINDOW_UNDEFINED);return E(e.top)(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(32)),n(o(12))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.APP="APP::PRINT::APP"}(e.ActionType||(e.ActionType={})),function(t){t.APP="APP"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=o(14),i=o(4);e.fromFrame=function(t,e){var o=[];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(t){if(t.origin===e&&r.isAppMessage(t))for(var n=0,i=o;n<i.length;n++)(0,i[n])(t)}),{localOrigin:e,hostFrame:s,dispatch:function(e){var o=t.contentWindow;o&&o.postMessage(e,"*")},subscribe:function(t){return i.addAndRemoveFromCollection(o,t)}}},e.fromWindow=function(t,e){var o=[];return void 0!==typeof window&&t!==window&&window.addEventListener("message",function(e){if(e.source===t&&(r.isAppBridgeAction(e.data.payload)||r.isAppMessage(e)))for(var n=0,i=o;n<i.length;n++)(0,i[n])(e)}),{localOrigin:e,hostFrame:t,dispatch:function(e){if(e.source&&e.source.shopOrigin){var o="https://"+e.source.shopOrigin;t.postMessage(e,o)}},subscribe:function(t){return i.addAndRemoveFromCollection(o,t)}}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(15);e.isAppBridgeAction=function(t){return t instanceof Object&&t.hasOwnProperty("type")&&t.type.toString().startsWith(n.PREFIX)},e.isFromApp=function(t){return"object"==typeof t&&"object"==typeof t.source&&"string"==typeof t.source.apiKey},e.isAppMessage=function(t){if("object"!=typeof t||!t.data||"object"!=typeof t.data)return!1;var e=t.data;return e.hasOwnProperty("type")&&("getState"===e.type||"dispatch"===e.type)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PREFIX="APP"},function(t,e,o){"use strict";function n(){return r()?window.location:void 0}function r(){return"undefined"!=typeof window}Object.defineProperty(e,"__esModule",{value:!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 r()?window:void 0}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(0);e.AnyAction=n.AnyAction,e.Dispatch=n.Dispatch,e.Unsubscribe=n.Unsubscribe;var r=o(13);e.Handler=r.Handler,e.HandlerData=r.HandlerData,function(t){t.UpdateAction="UpdateAction",t.DispatchAction="DispatchAction"}(e.LifecycleHook||(e.LifecycleHook={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.CLICK="CLICK",t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.CLICK="APP::BUTTON::CLICK",t.UPDATE="APP::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.Print="print"}(e.Icon||(e.Icon={})),function(t){t.Danger="danger"}(e.Style||(e.Style={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.UPDATE="APP::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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"}(e.ActionType||(e.ActionType={})),function(t){t.FETCH="FETCH",t.UPDATE="UPDATE",t.SET_CUSTOMER="SET_CUSTOMER",t.REMOVE_CUSTOMER="REMOVE_CUSTOMER",t.ADD_CUSTOMER_ADDRESS="ADD_CUSTOMER_ADDRESS",t.UPDATE_CUSTOMER_ADDRESS="UPDATE_CUSTOMER_ADDRESS",t.SET_DISCOUNT="SET_DISCOUNT",t.REMOVE_DISCOUNT="REMOVE_DISCOUNT",t.SET_PROPERTIES="SET_PROPERTIES",t.REMOVE_PROPERTIES="REMOVE_PROPERTIES",t.CLEAR="CLEAR",t.ADD_LINE_ITEM="ADD_LINE_ITEM",t.UPDATE_LINE_ITEM="UPDATE_LINE_ITEM",t.REMOVE_LINE_ITEM="REMOVE_LINE_ITEM",t.SET_LINE_ITEM_DISCOUNT="SET_LINE_ITEM_DISCOUNT",t.REMOVE_LINE_ITEM_DISCOUNT="REMOVE_LINE_ITEM_DISCOUNT",t.SET_LINE_ITEM_PROPERTIES="SET_LINE_ITEM_PROPERTIES",t.REMOVE_LINE_ITEM_PROPERTIES="REMOVE_LINE_ITEM_PROPERTIES"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="APP::FEATURES::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.START="APP::LOADING::START",t.STOP="APP::LOADING::STOP"}(e.ActionType||(e.ActionType={})),function(t){t.START="START",t.STOP="STOP"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.OPEN="OPEN",t.CLOSE="CLOSE",t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.OPEN="APP::MODAL::OPEN",t.CLOSE="APP::MODAL::CLOSE",t.UPDATE="APP::MODAL::UPDATE",t.FOOTER_BUTTON_CLICK="APP::MODAL::FOOTER::BUTTON::CLICK",t.FOOTER_BUTTON_UPDATE="APP::MODAL::FOOTER::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.Small="small",t.Medium="medium",t.Large="large",t.Full="full"}(e.Size||(e.Size={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.PUSH="APP::NAVIGATION::HISTORY::PUSH",t.REPLACE="APP::NAVIGATION::HISTORY::REPLACE"}(e.ActionType||(e.ActionType={})),function(t){t.PUSH="PUSH",t.REPLACE="REPLACE"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ADMIN_PATH="ADMIN::PATH",t.ADMIN_SECTION="ADMIN::SECTION",t.REMOTE="REMOTE",t.APP="APP"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),function(t){t.Product="products",t.Collection="collections",t.Order="orders",t.Customer="customers",t.Discount="discounts"}(e.ResourceType||(e.ResourceType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.OPEN="OPEN",t.SELECT="SELECT",t.CLOSE="CLOSE",t.UPDATE="UPDATE",t.CANCEL="CANCEL"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),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.Product="product",t.ProductVariant="variant",t.Collection="collection"}(e.ResourceType||(e.ResourceType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={}))},function(t,e,o){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}(o(0));var r=n(o(3));e.Button=r;var i=n(o(5));e.ButtonGroup=i;var s=n(o(40));e.Cart=s;var c=n(o(2));e.Error=c;var u=n(o(42));e.Flash=u;var a=n(o(45));e.Features=a;var p=n(o(47));e.Loading=p;var f=n(o(49));e.Modal=f;var d=n(o(51));e.History=d;var l=n(o(53));e.Redirect=l;var h=n(o(11));e.Print=h;var y=n(o(55));e.ResourcePicker=y;var A=n(o(57));e.TitleBar=A;var E=n(o(7));e.Toast=E;var P=o(14);e.isAppBridgeAction=P.isAppBridgeAction},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(18);function a(t,e,o){var n=e.id,r=s.getEventNameSpace(t,u.Action.CLICK,e),i={id:n,payload:o};return s.actionWrapper({type:r,group:t,payload:i})}function p(t,e,o){var n=e.id,r=o.label,c=s.getEventNameSpace(t,u.Action.UPDATE,e),a=i({id:n,label:r},o);return s.actionWrapper({type:c,group:t,payload:a})}e.clickButton=a,e.update=p,e.isValidButtonProps=function(t){return"string"==typeof t.id&&"string"==typeof t.label};var f=function(t){function e(e,o){var n=t.call(this,e,c.ComponentType.Button,c.Group.Button)||this;return n.disabled=!1,n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{disabled:this.disabled,icon:this.icon,label:this.label,style:this.style}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=s.getMergedProps(this.options,t),n=o.label,r=o.disabled,i=o.icon,c=o.style;return this.label=n,this.disabled=!!r,this.icon=i,this.style=c,e&&this.dispatch(u.Action.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case u.Action.CLICK:this.app.dispatch(a(this.group,this.component,e));break;case u.Action.UPDATE:var o=p(this.group,this.component,this.payload);this.app.dispatch(o)}return this},e}(s.ActionSet);e.Button=f,e.create=function(t,e){return new f(t,e)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(9);function s(t,e,o){var i=e.payload;return n.actionWrapper({type:t,group:r.Group.Error,payload:{action:e,message:o,type:t,id:i&&i.id?i.id:void 0}})}!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 s(i.ActionType.INVALID_PAYLOAD,t,e||"The action's payload is missing required properties or has invalid properties")},e.invalidActionType=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:i.ActionType.INVALID_ACTION_TYPE},type:i.ActionType.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:i.ActionType.INVALID_ACTION},type:i.ActionType.INVALID_ACTION})},e.unexpectedAction=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:i.ActionType.UNEXPECTED_ACTION},type:i.ActionType.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return s(i.ActionType.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return s(i.ActionType.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return s(i.ActionType.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return s(i.ActionType.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof n.findMatchInEnum(i.Action,t)};var c=function(){return 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,o){var n=new c(t?e+": "+t:e);return n.action=o,n.type=e,n}e.AppBridgeError=c,c.prototype=Object.create(Error.prototype),e.fromAction=u,e.throwError=function(){var t,e,o=arguments[0];throw"string"==typeof arguments[1]?t=arguments[1]:(e=arguments[1],t=arguments[2]||""),u(t,o,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(o(10));n(o(17)),e.default=i.default,n(o(10))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(12);e.app=function(){return n.actionWrapper({group:r.Group.Print,type:i.ActionType.APP})}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isServer="undefined"==typeof window,e.isClient=!e.isServer,e.isProduction=!0,e.isDevelopment=!e.isProduction,e.isDevelopmentClient=e.isDevelopment&&e.isClient},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(16);function r(){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(),r(),t.remove())}e.handleAppPrint=function(){navigator.userAgent.indexOf("iOS")>=0?i():r()}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(4),r=function(){function t(){this.map={}}return t.prototype.set=function(t,e){this.map.hasOwnProperty(t)||(this.map[t]=[]);var o={handler:e,remove:function(){}},r=n.addAndRemoveFromCollection(this.map[t],o);return o={handler:e,remove:r},r},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,o){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];var i=0,s=this.get(t)||[];return function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var c=s[i++];return c?c(t).apply(o,n):e.apply(o,n)}.apply(o,n)},t}();e.default=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,o){if(void 0!==o){if(!Object.getPrototypeOf(e).isPrototypeOf(o)||"Object"!==o.constructor.name&&"Array"!==o.constructor.name)return o;var n={};return Object.keys(o).forEach(function(r){e.hasOwnProperty(r)?"object"!=typeof e[r]||Array.isArray(e[r])?n[r]=o[r]:n[r]=t(e[r],o[r]):n[r]=o[r]}),Object.keys(e).forEach(function(t){o.hasOwnProperty(t)||(n[t]=e[t])}),Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}}},function(t,e,o){"use strict";function n(t){return Array.from(t).map(function(t){return("00"+t.toString(16)).slice(-2)}).join("")}function r(t){if("function"==typeof Uint8Array&&window.crypto){var e=new Uint8Array(t),o=window.crypto.getRandomValues(e);if(o)return o}return Array.from(new Array(t),function(){return 255*Math.random()|0})}function i(){var t=r(1),e=r(2);return t[0]&=191,e[0]&=79,[n(r(4)),"-",n(r(2)),"-",n(e),"-",n(t),n(r(1)),"-",n(r(6))].join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=i,e.default=i},function(t){t.exports={name:"@shopify/app-bridge",version:"1.0.0",types:"index.d.ts",main:"index.js",browser:"umd/index.js",files:["MessageTransport.d.ts","MessageTransport.js","MessageTransport.js.map","actions/","client/","index.d.ts","index.js","index.js.map","umd/","util/"],private:!1,publishConfig:{access:"public","@shopify:registry":"https://registry.npmjs.org"},repository:"git@github.com:Shopify/app-bridge.git",author:"Shopify Inc.",license:"MIT",scripts:{build:"yarn build:tsc && yarn build:umd","build:tsc":"NODE_ENV=production tsc","build:umd":"NODE_ENV=production webpack -p",check:"tsc --pretty --noEmit",clean:"cat package.json | node -pe \"JSON.parse(require('fs').readFileSync('/dev/stdin').toString()).files.join(' ')\" | xargs rm -rf",pack:"yarn pack",size:"size-limit"},sideEffects:!1,"size-limit":[{limit:"14 KB",path:"index.js"}],devDependencies:{"@types/node":"^10.12.5",typescript:"3.2.1"},resolutions:{sqlite3:"4.0.1"}}},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(6),c=o(1),u=o(0),a=o(19);function p(t,e,o){return function(t,e,o,n,r){var s=e.id,u=n.label,a=c.getEventNameSpace(t,o,e),p=i({id:s,label:u},n,{payload:r});return c.actionWrapper({type:a,group:t,payload:p})}(t,e,a.Action.UPDATE,o)}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,o){var n=t.call(this,e,u.ComponentType.ButtonGroup,u.Group.ButtonGroup)||this;return n.disabled=!1,n.buttonsOptions=[],n.buttons=[],n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{buttons:this.buttonsOptions,disabled:this.disabled,label:this.label}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{buttons:this.buttons,id:this.id})},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=c.getMergedProps(this.options,t),n=o.label,r=o.disabled,i=o.buttons;return this.label=n,this.disabled=!!r,this.buttons=this.getButtons(i),e&&this.dispatch(a.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.Action.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,o=0,n=this.buttons;o<n.length;o++){var r=n[o];if(e=c.updateActionFromPayload(r,t))break}e&&this.dispatch(a.Action.UPDATE)}},e.prototype.getSingleButton=function(t){return s.getSingleButton(this,t,this.subgroups,this.updateButtons)},e.prototype.getButtons=function(t){var e=this,o=[];return t?(t.forEach(function(t){var n=s.getSingleButton(e,t,e.subgroups,e.updateButtons);o.push(n)}),this.buttonsOptions=t,o):[]},e}(c.ActionSetWithChildren);e.ButtonGroup=f,e.create=function(t,e){return new f(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(41)),n(o(20))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(20),a=function(t){function e(e,o){return t.call(this,e,c.Group.Cart,c.Group.Cart,o?o.id:void 0)||this}return r(e,t),e.prototype.dispatch=function(t,e){switch(t){case u.Action.FETCH:this.dispatchCartAction(u.ActionType.FETCH);break;case u.Action.UPDATE:this.dispatchCartAction(u.ActionType.UPDATE,e);break;case u.Action.SET_CUSTOMER:this.dispatchCartAction(u.ActionType.SET_CUSTOMER,e);break;case u.Action.REMOVE_CUSTOMER:this.dispatchCartAction(u.ActionType.REMOVE_CUSTOMER,e);break;case u.Action.ADD_CUSTOMER_ADDRESS:this.dispatchCartAction(u.ActionType.ADD_CUSTOMER_ADDRESS,e);break;case u.Action.UPDATE_CUSTOMER_ADDRESS:this.dispatchCartAction(u.ActionType.UPDATE_CUSTOMER_ADDRESS,e);break;case u.Action.SET_DISCOUNT:this.dispatchCartAction(u.ActionType.SET_DISCOUNT,e);break;case u.Action.REMOVE_DISCOUNT:this.dispatchCartAction(u.ActionType.REMOVE_DISCOUNT,e);break;case u.Action.SET_PROPERTIES:this.dispatchCartAction(u.ActionType.SET_PROPERTIES,e);break;case u.Action.REMOVE_PROPERTIES:this.dispatchCartAction(u.ActionType.REMOVE_PROPERTIES,e);break;case u.Action.CLEAR:this.dispatchCartAction(u.ActionType.CLEAR,e);break;case u.Action.ADD_LINE_ITEM:this.dispatchCartAction(u.ActionType.ADD_LINE_ITEM,e);break;case u.Action.UPDATE_LINE_ITEM:this.dispatchCartAction(u.ActionType.UPDATE_LINE_ITEM,e);break;case u.Action.REMOVE_LINE_ITEM:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM,e);break;case u.Action.SET_LINE_ITEM_DISCOUNT:this.dispatchCartAction(u.ActionType.SET_LINE_ITEM_DISCOUNT,e);break;case u.Action.REMOVE_LINE_ITEM_DISCOUNT:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM_DISCOUNT,e);break;case u.Action.SET_LINE_ITEM_PROPERTIES:this.dispatchCartAction(u.ActionType.SET_LINE_ITEM_PROPERTIES,e);break;case u.Action.REMOVE_LINE_ITEM_PROPERTIES:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM_PROPERTIES,e)}return this},e.prototype.dispatchCartAction=function(t,e){this.app.dispatch(s.actionWrapper({type:t,group:c.Group.Cart,payload:i({},e||{},{id:this.id})}))},e}(s.ActionSet);e.Cart=a,e.create=function(t,e){return new a(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(43)),n(o(8))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0});var i=o(7),s=o(7);e.ActionBase=s.ActionBase,e.clear=s.clear,e.ClearAction=s.ClearAction,e.show=s.show,e.ShowAction=s.ShowAction,e.FlashAction=s.ToastAction;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(i.Toast);e.Flash=c,e.create=function(t,e){return new c(t,e)}},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(8);function a(t){return s.actionWrapper({group:c.Group.Toast,payload:t,type:u.ActionType.SHOW})}function p(t){return s.actionWrapper({payload:t,group:c.Group.Toast,type:u.ActionType.CLEAR})}e.show=a,e.clear=p;var f=function(t){function e(e,o){var n=t.call(this,e,c.Group.Toast,c.Group.Toast)||this;return n.message="",n.duration=3e3,n.set(o),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{duration:this.duration,isError:this.isError,message:this.message}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!0,configurable:!0}),e.prototype.set=function(t){var e=s.getMergedProps(this.options,t),o=e.message,n=e.duration,r=e.isError;return this.message=o,this.duration=n,this.isError=r,this},e.prototype.dispatch=function(t){switch(t){case u.Action.SHOW:var e=a(this.payload);this.app.dispatch(e);break;case u.Action.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,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(46)),n(o(21))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(2),s=o(21);e.update=function(){return n.actionWrapper({group:r.Group.Features,type:s.ActionType.UPDATE})},e.validationError=function(t){switch(t.type){case s.ActionType.UPDATE:return;default:return i.invalidActionType(t)}}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(48)),n(o(22))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),s=o(0),c=o(22);function u(t){return i.actionWrapper({payload:t,group:s.Group.Loading,type:c.ActionType.START})}function a(t){return i.actionWrapper({payload:t,group:s.Group.Loading,type:c.ActionType.STOP})}e.start=u,e.stop=a;var p=function(t){function e(e){return t.call(this,e,s.Group.Loading,s.Group.Loading)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t){switch(t){case c.Action.START:this.app.dispatch(u(this.payload));break;case c.Action.STOP:this.app.dispatch(a(this.payload))}return this},e}(i.ActionSet);e.Loading=p,e.create=function(t){return new p(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(50)),n(o(23))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(6),c=o(1),u=o(0),a=o(3),p=o(23),f={group:u.Group.Modal,subgroups:["Footer"],type:u.ComponentType.Button};function d(t){return c.actionWrapper({group:u.Group.Modal,payload:t,type:p.ActionType.OPEN})}function l(t){return c.actionWrapper({group:u.Group.Modal,payload:t,type:p.ActionType.CLOSE})}function h(t){return c.actionWrapper({payload:t,group:u.Group.Modal,type:p.ActionType.UPDATE})}function y(t){return"string"==typeof t.url||"string"==typeof t.path}e.openModal=d,e.closeModal=l,e.clickFooterButton=function(t,e){var o=i({id:t},f);return a.clickButton(u.Group.Modal,o,e)},e.update=h,e.isIframeModal=y,e.isMessageModal=function(t){return"string"==typeof t.message};var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=p.Size.Small,e}return r(e,t),Object.defineProperty(e.prototype,"footer",{get:function(){if(this.footerPrimary||this.footerSecondary)return{buttons:{primary:this.footerPrimary,secondary:this.footerSecondary}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footerOptions",{get:function(){if(this.footerPrimaryOptions||this.footerSecondaryOptions)return{buttons:{primary:this.footerPrimaryOptions,secondary:this.footerSecondaryOptions}}},enumerable:!0,configurable:!0}),e.prototype.close=function(){this.app.dispatch(l({id:this.id}))},e.prototype.setFooterPrimaryButton=function(t,e){var o=this,n=f.subgroups;this.footerPrimaryOptions=this.getChildButton(t,this.footerPrimaryOptions),this.footerPrimary=this.footerPrimaryOptions?s.getSingleButton(this,this.footerPrimaryOptions,n,function(t){o.updatePrimaryFooterButton(t,e)}):void 0},e.prototype.setFooterSecondaryButtons=function(t,e){var o=this,n=f.subgroups,r=t||[],i=this.footerOptions&&this.footerOptions.buttons.secondary||[];this.footerSecondaryOptions=this.getUpdatedChildActions(r,i),this.footerSecondary=this.footerSecondaryOptions?this.footerSecondaryOptions.map(function(t){return s.getSingleButton(o,t,n,function(t){o.updateSecondaryFooterButton(t,e)})}):void 0},e.prototype.getChildButton=function(t,e){var o=t?[t]:[],n=e?[e]:[],r=this.getUpdatedChildActions(o,n);return r?r[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 o,n=0,r=this.footer.buttons.secondary;n<r.length;n++){var i=r[n];if(o=c.updateActionFromPayload(i,t))break}o&&e()}},e}(c.ActionSetWithChildren);e.Modal=A;var E=function(t){function e(e,o){var n=t.call(this,e,u.Group.Modal,u.Group.Modal)||this;return n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{footer:this.footer,id:this.id})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,message:this.message,size:this.size,title:this.title}},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){var o=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),r=n.title,i=n.footer,s=n.message,u=n.size;return this.title=r,this.message=s,this.size=u,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,function(){o.dispatch(p.Action.UPDATE)}),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,function(){o.dispatch(p.Action.UPDATE)}),e&&this.dispatch(p.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case p.Action.OPEN:this.app.dispatch(d(this.payload));break;case p.Action.CLOSE:this.close();break;case p.Action.UPDATE:this.app.dispatch(h(this.payload))}return this},e}(A);e.ModalMessage=E;var P=function(t){function e(e,o){var n=t.call(this,e,u.Group.Modal,u.Group.Modal)||this;return n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{footer:this.footer,id:this.id})},enumerable:!0,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}},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){var o=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),r=n.title,i=n.footer,s=n.path,u=n.url,a=n.size;return this.title=r,this.url=u,this.path=s,this.size=a,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,function(){o.dispatch(p.Action.UPDATE)}),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,function(){o.dispatch(p.Action.UPDATE)}),e&&this.dispatch(p.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case p.Action.OPEN:this.app.dispatch(d(this.payload));break;case p.Action.CLOSE:this.close();break;case p.Action.UPDATE:this.app.dispatch(h(this.payload))}return this},e}(A);e.ModalIframe=P,e.create=function(t,e){return y(e)?new P(t,e):new E(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(52)),n(o(24))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(24);function a(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.PUSH})}function p(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.REPLACE})}e.push=a,e.replace=p;var f=function(t){function e(e){return t.call(this,e,"History",c.Group.Navigation)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t,e){var o=i({},this.payload,{path:e});switch(t){case u.Action.PUSH:this.app.dispatch(a(o));break;case u.Action.REPLACE:this.app.dispatch(p(o))}return this},e}(s.ActionSet);e.History=f,e.create=function(t){return new f(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(54)),n(o(25))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(25);function a(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:c.Group.Navigation,type:u.ActionType.ADMIN_PATH})}function d(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.ADMIN_SECTION})}function l(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.REMOTE})}function h(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.APP})}e.isResourcePayload=function(t){return"string"==typeof t.id},e.isCreateResourcePayload=a,e.isProductVariantResourcePayload=p,e.isProductVariantCreateResourcePayload=function(t){return!!p(t)&&a(t.variant)},e.toAdminPath=f,e.toAdminSection=d,e.toRemote=l,e.toApp=h;var y=function(t){function e(e){return t.call(this,e,"Redirect",c.Group.Navigation)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t,e){switch(t){case u.Action.ADMIN_PATH:var o=function(t){return"object"==typeof t&&t.hasOwnProperty("path")}(e)?e:{path:e};this.app.dispatch(f(i({},this.payload,o)));break;case u.Action.ADMIN_SECTION:var n=function(t){return"object"==typeof t&&"object"==typeof t.section&&t.section.hasOwnProperty("name")}(e)?e:{section:e};this.app.dispatch(d(i({},this.payload,n)));break;case u.Action.APP:this.app.dispatch(h(i({},this.payload,{path:e})));break;case u.Action.REMOTE:var r=function(t){return"object"==typeof t&&t.hasOwnProperty("url")}(e)?e:{url:e};this.app.dispatch(l(i({},this.payload,r)))}return this},e}(s.ActionSet);e.Redirect=y,e.create=function(t){return new y(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(56)),n(o(26))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(26);function a(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.SELECT})}function p(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.OPEN})}function f(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.CANCEL})}function d(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.UPDATE})}e.select=a,e.open=p,e.cancel=f,e.close=function(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.CANCEL})},e.update=d;var l=function(t){function e(e,o,n){var r=t.call(this,e,c.Group.ResourcePicker,c.Group.ResourcePicker)||this;return r.selection=[],r.resourceType=n,r.set(o,!1),r}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{id:this.id,resourceType:this.resourceType})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){var t={initialQuery:this.initialQuery,selectMultiple:this.selectMultiple,showHidden:this.showHidden};return this.resourceType===u.ResourceType.Product?i({},t,{showVariants:this.showVariants}):t},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=s.getMergedProps(this.options,t),n=o.initialQuery,r=o.showHidden,i=void 0!==r&&r,c=o.showVariants,u=void 0===c||c,a=o.selectMultiple,p=void 0===a||a;return this.initialQuery=n,this.showHidden=Boolean(i),this.showVariants=Boolean(u),this.selectMultiple=Boolean(p),e&&this.update(),this},e.prototype.dispatch=function(t,e){return t===u.Action.OPEN?this.open():t===u.Action.UPDATE?this.update():t===u.Action.CLOSE||t===u.Action.CANCEL?this.cancel():t===u.Action.SELECT&&(this.selection=e,this.app.dispatch(a({id:this.id,selection:this.selection}))),this},e.prototype.update=function(){this.app.dispatch(d(this.payload))},e.prototype.open=function(){this.app.dispatch(p(this.payload))},e.prototype.cancel=function(){this.app.dispatch(f({id:this.id}))},e.prototype.close=function(){this.cancel()},e}(s.ActionSet);e.ResourcePicker=l,e.create=function(t,e){var o=e.resourceType,n=e.options;return new l(t,void 0===n?{}:n,o)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(58)),n(o(27))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(3),c=o(5),u=o(59),a=o(6),p=o(1),f=o(0),d=o(27),l={group:f.Group.TitleBar,subgroups:["Buttons"]},h={group:f.Group.TitleBar,subgroups:["Breadcrumbs"],type:f.ComponentType.Button};function y(t){return p.actionWrapper({payload:t,group:f.Group.TitleBar,type:d.ActionType.UPDATE})}e.clickActionButton=function(t,e){var o=f.ComponentType.Button,n=i({id:t,type:o},l);return s.clickButton(f.Group.TitleBar,n,e)},e.clickBreadcrumb=function(t,e){var o=i({id:t},h);return s.clickButton(f.Group.TitleBar,o,e)},e.update=y;var A=function(t){function e(e,o){var n=t.call(this,e,f.Group.TitleBar,f.Group.TitleBar)||this;return n.set(o),n}return r(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{breadcrumbs:this.breadcrumbsOption,buttons:this.buttonsOptions,title:this.title}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{breadcrumbs:this.breadcrumb,buttons:this.buttons,id:this.id})},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=p.getMergedProps(this.options,t),n=o.title,r=o.buttons,i=o.breadcrumbs;return this.title=n,this.setBreadcrumbs(i),this.setPrimaryButton(r?r.primary:void 0),this.setSecondaryButton(r?r.secondary:void 0),e&&this.dispatch(d.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case d.Action.UPDATE:this.app.dispatch(y(this.payload))}return this},e.prototype.getButton=function(t,e,o){return t instanceof c.ButtonGroup?u.getGroupedButton(this,t,e,o):a.getSingleButton(this,t,e,o)},e.prototype.updatePrimaryButton=function(t){this.primary&&p.updateActionFromPayload(this.primary,t)&&this.dispatch(d.Action.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find(function(e){return e.id===t.id});if(e){(c.isGroupedButtonPayload(t),p.updateActionFromPayload(e,t))&&this.dispatch(d.Action.UPDATE)}}},e.prototype.updateBreadcrumbButton=function(t){this.breadcrumb&&p.updateActionFromPayload(this.breadcrumb,t)&&this.dispatch(d.Action.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.setSecondaryButton=function(t){var e=this,o=t||[],n=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(o,n),this.secondary=this.secondaryOptions?this.secondaryOptions.map(function(t){return e.getButton(t,l.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,h.subgroups,this.updateBreadcrumbButton):void 0},e.prototype.getChildButton=function(t,e){var o=t?[t]:[],n=e?[e]:[],r=this.getUpdatedChildActions(o,n);return r?r[0]:void 0},e}(p.ActionSetWithChildren);e.TitleBar=A,e.create=function(t,e){return new A(t,e)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(5);e.getGroupedButton=function(t,e,o,r){t.addChild(e,t.group,o);var i=e.id,s=e.label,c=e.disabled,u=e.buttons;return t.subscribeToChild(e,n.Action.UPDATE,r),{id:i,label:s,buttons:u,disabled:c}}}])});

@@ -1,1 +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 o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=29)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup",t.Cart="Cart",t.Error="Error",t.Features="Features",t.Toast="Toast",t.Loading="Loading",t.Modal="Modal",t.Navigation="Navigation",t.Print="Print",t.TitleBar="TitleBar",t.ResourcePicker="Resource_Picker"}(e.Group||(e.Group={})),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup"}(e.ComponentType||(e.ComponentType={}))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var c=o(2),u=o(5),a=o(4),p=o(16),f=s(o(37)),d=o(0),l=s(o(38)),h=o(39),y="::";function A(){return h.version}function E(t,e,o){var n=t.toUpperCase();if(o){var r=o.subgroups,i=o.type;r&&r.length>0&&(n+=n.length>0?y:"",r.forEach(function(t,e){n+=""+t.toUpperCase()+(e<r.length-1?y:"")})),i!==t&&i&&(n+=""+(n.length>0?y:"")+i.toUpperCase())}return n&&(n+=""+(n.length>0?y:"")+e.toUpperCase()),""+p.PREFIX+y+n}e.actionWrapper=function(t){return i({},t,{version:A()})},e.getVersion=A,e.getEventNameSpace=E,e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t};var P=function(){function t(t,e,o,n){var r=this;this.app=t,this.type=e,this.group=o,this.subgroups=[],this.subscriptions=[],t||c.throwError(c.ActionType.INVALID_OPTIONS,"Missing required `app`"),this.id=n||l.default(),this.defaultGroup=o;var i=this.set;this.set=function(){for(var t,e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return r.app.hooks?(t=r.app.hooks).run.apply(t,[u.LifecycleHook.UpdateAction,i,r].concat(e)):i.apply(r,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:!0,configurable:!0}),t.prototype.updateSubscription=function(t,e,o){var n,r=t.eventType,i=t.callback,s=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=o,Object.assign(s,{subgroups:this.subgroups}),this.subscribe(r,i,s,n)},t.prototype.error=function(t){var e=this,o=[];return b(c.Action,function(n){o.push(e.subscriptions.length),e.subscribe(n,t)}),function(){o.map(function(t){return e.subscriptions[t]}).forEach(function(t){a.removeFromCollection(e.subscriptions,t,function(t){t.unsubscribe()})})}},t.prototype.subscribe=function(t,e,o,n){var r,s=this,u=o||this.component,a=t.toUpperCase(),p="number"==typeof n?e:e.bind(this);r=c.isErrorEventName(t)?E(d.Group.Error,t,i({},u,{type:""})):E(this.group,t,u);var f=this.app.subscribe(r,p,o?o.id:this.id),l={eventType:a,unsubscribe:f,callback:p,component:u,updateSubscribe:function(t,e){return s.updateSubscription.call(s,l,t,e)}};return"number"==typeof n&&n>=0&&n<this.subscriptions.length?this.subscriptions[n]=l:this.subscriptions.push(l),f},t.prototype.unsubscribe=function(t){return void 0===t&&(t=!1),T(this.subscriptions,this.defaultGroup,t),this},t}();e.ActionSet=P;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=[],e}return r(e,t),e.prototype.unsubscribe=function(t,o){return void 0===t&&(t=!0),void 0===o&&(o=!1),T(this.subscriptions,this.defaultGroup,o),this.children.forEach(function(o){e.prototype.isPrototypeOf(o)?o.unsubscribe(t,!t):o.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(o){return o.component.id===t&&(!e||e===o.eventType)})},e.prototype.addChild=function(t,o,n){var r=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||o===t.group&&n===t.subgroups?this:(i.forEach(function(t){(0,t.updateSubscribe)(o,n)}),Object.assign(t,{group:o,subgroups:n}),e.prototype.isPrototypeOf(t)&&t.children.forEach(function(t){return r.addChild(t,o,n)}),this)},e.prototype.removeChild=function(t){var e=this;return a.removeFromCollection(this.children,this.getChild(t),function(){e.subscriptions.filter(function(e){return e.component.id===t}).forEach(function(t){a.removeFromCollection(e.subscriptions,t,function(t){t.unsubscribe()})})}),this},e.prototype.subscribeToChild=function(t,e,o){var n=this,r=o.bind(this);if(e instanceof Array)return e.forEach(function(e){return n.subscribeToChild(t,e,o)}),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),s=this.getChildSubscriptions(t.id,i);if(s.length>0)s.forEach(function(e){return e.updateSubscribe(n.group,t.subgroups)});else{var c={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,r,c)}return this},e.prototype.getUpdatedChildActions=function(t,e){if(0!==t.length){for(var o=t.filter(function(t,e,o){return e===o.indexOf(t)}),n=o.map(function(t){return t.id}),r=e.filter(function(t){return n.indexOf(t.id)<0});r.length>0;){if(!(i=r.pop()))break;this.removeChild(i.id)}return o}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(P);function T(t,e,o){void 0===o&&(o=!1),t.forEach(function(t){o?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()}),o||(t.length=0)}function _(t,e){var o=f.default(t,e);return o||Object.assign(t,e)}function b(t,e){Object.keys(t).forEach(function(o){e(t[o])})}e.ActionSetWithChildren=O,e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,_(t,e)),!0)},e.getMergedProps=_,e.forEachInEnum=b,e.findMatchInEnum=function(t,e){var o=Object.keys(t).find(function(o){return e===t[o]});return o?t[o]:void 0}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(32)),n(o(11))},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(31)),n(o(19))},function(t,e,o){"use strict";function n(t,e,o){var n=t.findIndex(function(t){return t===e});return n>=0&&(t.splice(n,1),o&&o(e),!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.addAndRemoveFromCollection=function(t,e,o){return t.push(e),function(){return n(t,e,o)}},e.removeFromCollection=n},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(o(12));n(o(18)),e.default=i.default,n(o(12))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=o(15),i=o(4);e.fromFrame=function(t,e){var o=[];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(t){if(t.origin===e&&r.isAppMessage(t))for(var n=0,i=o;n<i.length;n++)(0,i[n])(t)}),{localOrigin:e,hostFrame:s,dispatch:function(e){var o=t.contentWindow;o&&o.postMessage(e,"*")},subscribe:function(t){return i.addAndRemoveFromCollection(o,t)}}},e.fromWindow=function(t,e){var o=[];return void 0!==typeof window&&t!==window&&window.addEventListener("message",function(e){if(e.source===t&&(r.isAppBridgeAction(e.data.payload)||r.isAppMessage(e)))for(var n=0,i=o;n<i.length;n++)(0,i[n])(e)}),{localOrigin:e,hostFrame:t,dispatch:function(e){if(e.source&&e.source.shopOrigin){var o="https://"+e.source.shopOrigin;t.postMessage(e,o)}},subscribe:function(t){return i.addAndRemoveFromCollection(o,t)}}}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(40)),n(o(20))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(3);e.getSingleButton=function(t,e,o,r){return t.addChild(e,t.group,o),t.subscribeToChild(e,n.Action.UPDATE,r),e.payload}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(45)),n(o(10))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.SHOW="APP::TOAST::SHOW",t.CLEAR="APP::TOAST::CLEAR"}(e.ActionType||(e.ActionType={})),function(t){t.SHOW="SHOW",t.CLEAR="CLEAR"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.INVALID_ACTION="INVALID_ACTION",t.INVALID_ACTION_TYPE="INVALID_ACTION_TYPE",t.INVALID_OPTIONS="INVALID_OPTIONS",t.INVALID_PAYLOAD="INVALID_PAYLOAD",t.UNEXPECTED_ACTION="UNEXPECTED_ACTION",t.PERSISTENCE="PERSISTENCE",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK="NETWORK",t.PERMISSION="PERMISSION"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),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.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN"}(e.AppActionType||(e.AppActionType={}))},function(t,e,o){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),s=o(2),c=o(13),u=o(6),a=o(4),p=o(34),f=o(35),d=o(17),l=o(18),h=r(o(36)),y="window is not defined. Running an app outside a browser is not supported";function A(){var t={},e=d.getLocation();return e?e.search.slice(e.search.indexOf("?")+1).split("&").reduce(function(t,e){var o,r=e.split("="),i=r[0],s=r[1];return n({},t,((o={})[decodeURIComponent(i)]=decodeURIComponent(s),o))},t):t}function E(t,o,n){if(void 0===n&&(n=[]),!t)throw s.fromAction(y,s.AppActionType.WINDOW_UNDEFINED);var r=d.getLocation(),i=o||r&&r.origin;if(!i)throw s.fromAction("local origin cannot be blank",s.AppActionType.MISSING_LOCAL_ORIGIN);var c=u.fromWindow(t,i);return e.createClientApp(c,n)}e.getUrlParams=A,e.getShopOrigin=function(){return A().shop},e.createClientApp=function(t,e){void 0===e&&(e=[]);var o=[],n=[],r={},u=function(t){var e=t.data;switch(e.type){case"getState":o.splice(0).forEach(function(t){return t(e.payload)});break;case"dispatch":var c=e.payload;!function(t,e){var o=!1;if(r.hasOwnProperty(t))for(var n=0,c=r[t];n<c.length;n++){var u=c[n],a=u.id,p=u.callback;(!e||e.id!==a)&&a||(p(e),o=!0)}if(!o){var f=i.findMatchInEnum(s.ActionType,t);f&&s.throwError(f,e)}}(c.type,c.payload),n.forEach(function(t){return t.callback(c)})}};return t.subscribe(u),function(y){if(!y.shopOrigin)throw s.fromAction("shopOrigin must be provided",s.AppActionType.INVALID_CONFIG);if(!y.apiKey)throw s.fromAction("apiKey must be provided",s.AppActionType.INVALID_CONFIG);!function(t,e){var o=e.apiKey,n=e.shopOrigin,r=e.forceRedirect,i=void 0===r?!p.isDevelopmentClient:r,s=d.getLocation();if(s&&i&&d.shouldRedirect(t)&&o&&n){var c="https://"+n+"/admin/apps/"+o+s.pathname+(s.search||"");d.redirect(c)}}(t.hostFrame,y);for(var A=function(e){var o={payload:e,source:y,type:"dispatch"};return u({data:o}),t.dispatch(o),e},E=new h.default,P={localOrigin:t.localOrigin,hooks:E,dispatch:function(t){return P.hooks?P.hooks.run(l.LifecycleHook.DispatchAction,A,P,t):A(t)},featuresAvailable:function(t){return P.getState("features").then(function(e){return t&&Object.keys(e).forEach(function(o){t.includes(o)||delete e[o]}),e})},getState:function(e){return new Promise(function(e){o.push(e),t.dispatch({payload:void 0,source:y,type:"getState"})}).then(function(t){return e?e.split(".").reduce(function(e,o){if("object"==typeof t&&!Array.isArray(t))return e=t[o],t=e,e},void 0):t})},subscribe:function(){if(arguments.length<2)return a.addAndRemoveFromCollection(n,{callback:arguments[0]});var t=arguments[0],e={callback:arguments[1],id:arguments[2]};return r.hasOwnProperty(t)||(r[t]=[]),a.addAndRemoveFromCollection(r[t],e)},error:function(t,e){var o=this,n=[];return i.forEachInEnum(s.ActionType,function(r){n.push(o.subscribe(r,t,e))}),function(){n.forEach(function(t){return t()})}}},O=0,T=e;O<T.length;O++){(0,T[O])(E,P)}return function(t){t.subscribe(c.ActionType.APP,f.handleAppPrint)}(P),P}},e.createAppWrapper=E,e.default=function(t){var e=d.getWindow();if(!e)throw s.fromAction(y,s.AppActionType.WINDOW_UNDEFINED);return E(e.top)(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(33)),n(o(14))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.APP="APP::PRINT::APP"}(e.ActionType||(e.ActionType={})),function(t){t.APP="APP"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(16);e.isAppBridgeAction=function(t){return t instanceof Object&&t.hasOwnProperty("type")&&t.type.toString().startsWith(n.PREFIX)},e.isFromApp=function(t){return"object"==typeof t&&"object"==typeof t.source&&"string"==typeof t.source.apiKey},e.isAppMessage=function(t){if("object"!=typeof t||!t.data||"object"!=typeof t.data)return!1;var e=t.data;return e.hasOwnProperty("type")&&("getState"===e.type||"dispatch"===e.type)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PREFIX="APP"},function(t,e,o){"use strict";function n(){return r()?window.location:void 0}function r(){return"undefined"!=typeof window}Object.defineProperty(e,"__esModule",{value:!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 r()?window:void 0}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(0);e.AnyAction=n.AnyAction,e.Dispatch=n.Dispatch,e.Unsubscribe=n.Unsubscribe;var r=o(6);e.Handler=r.Handler,e.HandlerData=r.HandlerData,function(t){t.UpdateAction="UpdateAction",t.DispatchAction="DispatchAction"}(e.LifecycleHook||(e.LifecycleHook={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.CLICK="CLICK",t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.CLICK="APP::BUTTON::CLICK",t.UPDATE="APP::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.Print="print"}(e.Icon||(e.Icon={})),function(t){t.Danger="danger"}(e.Style||(e.Style={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.UPDATE="APP::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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"}(e.ActionType||(e.ActionType={})),function(t){t.FETCH="FETCH",t.UPDATE="UPDATE",t.SET_CUSTOMER="SET_CUSTOMER",t.REMOVE_CUSTOMER="REMOVE_CUSTOMER",t.ADD_CUSTOMER_ADDRESS="ADD_CUSTOMER_ADDRESS",t.UPDATE_CUSTOMER_ADDRESS="UPDATE_CUSTOMER_ADDRESS",t.SET_DISCOUNT="SET_DISCOUNT",t.REMOVE_DISCOUNT="REMOVE_DISCOUNT",t.SET_PROPERTIES="SET_PROPERTIES",t.REMOVE_PROPERTIES="REMOVE_PROPERTIES",t.CLEAR="CLEAR",t.ADD_LINE_ITEM="ADD_LINE_ITEM",t.UPDATE_LINE_ITEM="UPDATE_LINE_ITEM",t.REMOVE_LINE_ITEM="REMOVE_LINE_ITEM",t.SET_LINE_ITEM_DISCOUNT="SET_LINE_ITEM_DISCOUNT",t.REMOVE_LINE_ITEM_DISCOUNT="REMOVE_LINE_ITEM_DISCOUNT",t.SET_LINE_ITEM_PROPERTIES="SET_LINE_ITEM_PROPERTIES",t.REMOVE_LINE_ITEM_PROPERTIES="REMOVE_LINE_ITEM_PROPERTIES"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="APP::FEATURES::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.START="APP::LOADING::START",t.STOP="APP::LOADING::STOP"}(e.ActionType||(e.ActionType={})),function(t){t.START="START",t.STOP="STOP"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.OPEN="OPEN",t.CLOSE="CLOSE",t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.OPEN="APP::MODAL::OPEN",t.CLOSE="APP::MODAL::CLOSE",t.UPDATE="APP::MODAL::UPDATE",t.FOOTER_BUTTON_CLICK="APP::MODAL::FOOTER::BUTTON::CLICK",t.FOOTER_BUTTON_UPDATE="APP::MODAL::FOOTER::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.Small="small",t.Medium="medium",t.Large="large",t.Full="full"}(e.Size||(e.Size={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.PUSH="APP::NAVIGATION::HISTORY::PUSH",t.REPLACE="APP::NAVIGATION::HISTORY::REPLACE"}(e.ActionType||(e.ActionType={})),function(t){t.PUSH="PUSH",t.REPLACE="REPLACE"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ADMIN_PATH="ADMIN::PATH",t.ADMIN_SECTION="ADMIN::SECTION",t.REMOTE="REMOTE",t.APP="APP"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),function(t){t.Product="products",t.Collection="collections",t.Order="orders",t.Customer="customers",t.Discount="discounts"}(e.ResourceType||(e.ResourceType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.OPEN="OPEN",t.SELECT="SELECT",t.CLOSE="CLOSE",t.UPDATE="UPDATE",t.CANCEL="CANCEL"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),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.Product="product",t.ProductVariant="variant",t.Collection="collection"}(e.ResourceType||(e.ResourceType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={}))},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=r(o(30));e.actions=s;var c=i(o(5));e.default=c.default,n(o(6)),n(o(5))},function(t,e,o){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}(o(0));var r=n(o(3));e.Button=r;var i=n(o(7));e.ButtonGroup=i;var s=n(o(41));e.Cart=s;var c=n(o(2));e.Error=c;var u=n(o(43));e.Flash=u;var a=n(o(46));e.Features=a;var p=n(o(48));e.Loading=p;var f=n(o(50));e.Modal=f;var d=n(o(52));e.History=d;var l=n(o(54));e.Redirect=l;var h=n(o(13));e.Print=h;var y=n(o(56));e.ResourcePicker=y;var A=n(o(58));e.TitleBar=A;var E=n(o(9));e.Toast=E;var P=o(15);e.isAppBridgeAction=P.isAppBridgeAction},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(19);function a(t,e,o){var n=e.id,r=s.getEventNameSpace(t,u.Action.CLICK,e),i={id:n,payload:o};return s.actionWrapper({type:r,group:t,payload:i})}function p(t,e,o){var n=e.id,r=o.label,c=s.getEventNameSpace(t,u.Action.UPDATE,e),a=i({id:n,label:r},o);return s.actionWrapper({type:c,group:t,payload:a})}e.clickButton=a,e.update=p,e.isValidButtonProps=function(t){return"string"==typeof t.id&&"string"==typeof t.label};var f=function(t){function e(e,o){var n=t.call(this,e,c.ComponentType.Button,c.Group.Button)||this;return n.disabled=!1,n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{disabled:this.disabled,icon:this.icon,label:this.label,style:this.style}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=s.getMergedProps(this.options,t),n=o.label,r=o.disabled,i=o.icon,c=o.style;return this.label=n,this.disabled=!!r,this.icon=i,this.style=c,e&&this.dispatch(u.Action.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case u.Action.CLICK:this.app.dispatch(a(this.group,this.component,e));break;case u.Action.UPDATE:var o=p(this.group,this.component,this.payload);this.app.dispatch(o)}return this},e}(s.ActionSet);e.Button=f,e.create=function(t,e){return new f(t,e)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(11);function s(t,e,o){var i=e.payload;return n.actionWrapper({type:t,group:r.Group.Error,payload:{action:e,message:o,type:t,id:i&&i.id?i.id:void 0}})}!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 s(i.ActionType.INVALID_PAYLOAD,t,e||"The action's payload is missing required properties or has invalid properties")},e.invalidActionType=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:i.ActionType.INVALID_ACTION_TYPE},type:i.ActionType.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:i.ActionType.INVALID_ACTION},type:i.ActionType.INVALID_ACTION})},e.unexpectedAction=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:i.ActionType.UNEXPECTED_ACTION},type:i.ActionType.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return s(i.ActionType.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return s(i.ActionType.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return s(i.ActionType.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return s(i.ActionType.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof n.findMatchInEnum(i.Action,t)};var c=function(){return 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,o){var n=new c(t?e+": "+t:e);return n.action=o,n.type=e,n}e.AppBridgeError=c,c.prototype=Object.create(Error.prototype),e.fromAction=u,e.throwError=function(){var t,e,o=arguments[0];throw"string"==typeof arguments[1]?t=arguments[1]:(e=arguments[1],t=arguments[2]||""),u(t,o,e)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(14);e.app=function(){return n.actionWrapper({group:r.Group.Print,type:i.ActionType.APP})}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isServer="undefined"==typeof window,e.isClient=!e.isServer,e.isProduction=!0,e.isDevelopment=!e.isProduction,e.isDevelopmentClient=e.isDevelopment&&e.isClient},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(17);function r(){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(),r(),t.remove())}e.handleAppPrint=function(){navigator.userAgent.indexOf("iOS")>=0?i():r()}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(4),r=function(){function t(){this.map={}}return t.prototype.set=function(t,e){this.map.hasOwnProperty(t)||(this.map[t]=[]);var o={handler:e,remove:function(){}},r=n.addAndRemoveFromCollection(this.map[t],o);return o={handler:e,remove:r},r},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,o){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];var i=0,s=this.get(t)||[];return function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var c=s[i++];return c?c(t).apply(o,n):e.apply(o,n)}.apply(o,n)},t}();e.default=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,o){if(void 0!==o){if(!Object.getPrototypeOf(e).isPrototypeOf(o)||"Object"!==o.constructor.name&&"Array"!==o.constructor.name)return o;var n={};return Object.keys(o).forEach(function(r){e.hasOwnProperty(r)?"object"!=typeof e[r]||Array.isArray(e[r])?n[r]=o[r]:n[r]=t(e[r],o[r]):n[r]=o[r]}),Object.keys(e).forEach(function(t){o.hasOwnProperty(t)||(n[t]=e[t])}),Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}}},function(t,e,o){"use strict";function n(t){return Array.from(t).map(function(t){return("00"+t.toString(16)).slice(-2)}).join("")}function r(t){if("function"==typeof Uint8Array&&window.crypto){var e=new Uint8Array(t),o=window.crypto.getRandomValues(e);if(o)return o}return Array.from(new Array(t),function(){return 255*Math.random()|0})}function i(){var t=r(1),e=r(2);return t[0]&=191,e[0]&=79,[n(r(4)),"-",n(r(2)),"-",n(e),"-",n(t),n(r(1)),"-",n(r(6))].join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=i,e.default=i},function(t){t.exports={name:"@shopify/app-bridge",version:"1.0.0-4",types:"index.d.ts",main:"index.js",browser:"umd/index.js",files:["MessageTransport.d.ts","MessageTransport.js","MessageTransport.js.map","actions/","client/","index.d.ts","index.js","index.js.map","umd/","util/"],private:!1,publishConfig:{access:"public","@shopify:registry":"https://registry.npmjs.org"},repository:"git@github.com:Shopify/app-bridge.git",author:"Shopify Inc.",license:"MIT",scripts:{build:"yarn build:tsc && yarn build:umd","build:tsc":"NODE_ENV=production tsc","build:umd":"NODE_ENV=production webpack -p",check:"tsc --pretty --noEmit",clean:"cat package.json | node -pe \"JSON.parse(require('fs').readFileSync('/dev/stdin').toString()).files.join(' ')\" | xargs rm -rf",pack:"yarn pack",size:"size-limit"},sideEffects:!1,"size-limit":[{limit:"14 KB",path:"index.js"}],devDependencies:{"@types/node":"^10.12.5",typescript:"3.2.1"},resolutions:{sqlite3:"4.0.1"}}},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(8),c=o(1),u=o(0),a=o(20);function p(t,e,o){return function(t,e,o,n,r){var s=e.id,u=n.label,a=c.getEventNameSpace(t,o,e),p=i({id:s,label:u},n,{payload:r});return c.actionWrapper({type:a,group:t,payload:p})}(t,e,a.Action.UPDATE,o)}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,o){var n=t.call(this,e,u.ComponentType.ButtonGroup,u.Group.ButtonGroup)||this;return n.disabled=!1,n.buttonsOptions=[],n.buttons=[],n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{buttons:this.buttonsOptions,disabled:this.disabled,label:this.label}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{buttons:this.buttons,id:this.id})},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=c.getMergedProps(this.options,t),n=o.label,r=o.disabled,i=o.buttons;return this.label=n,this.disabled=!!r,this.buttons=this.getButtons(i),e&&this.dispatch(a.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.Action.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,o=0,n=this.buttons;o<n.length;o++){var r=n[o];if(e=c.updateActionFromPayload(r,t))break}e&&this.dispatch(a.Action.UPDATE)}},e.prototype.getSingleButton=function(t){return s.getSingleButton(this,t,this.subgroups,this.updateButtons)},e.prototype.getButtons=function(t){var e=this,o=[];return t?(t.forEach(function(t){var n=s.getSingleButton(e,t,e.subgroups,e.updateButtons);o.push(n)}),this.buttonsOptions=t,o):[]},e}(c.ActionSetWithChildren);e.ButtonGroup=f,e.create=function(t,e){return new f(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(42)),n(o(21))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(21),a=function(t){function e(e,o){return t.call(this,e,c.Group.Cart,c.Group.Cart,o?o.id:void 0)||this}return r(e,t),e.prototype.dispatch=function(t,e){switch(t){case u.Action.FETCH:this.dispatchCartAction(u.ActionType.FETCH);break;case u.Action.UPDATE:this.dispatchCartAction(u.ActionType.UPDATE,e);break;case u.Action.SET_CUSTOMER:this.dispatchCartAction(u.ActionType.SET_CUSTOMER,e);break;case u.Action.REMOVE_CUSTOMER:this.dispatchCartAction(u.ActionType.REMOVE_CUSTOMER,e);break;case u.Action.ADD_CUSTOMER_ADDRESS:this.dispatchCartAction(u.ActionType.ADD_CUSTOMER_ADDRESS,e);break;case u.Action.UPDATE_CUSTOMER_ADDRESS:this.dispatchCartAction(u.ActionType.UPDATE_CUSTOMER_ADDRESS,e);break;case u.Action.SET_DISCOUNT:this.dispatchCartAction(u.ActionType.SET_DISCOUNT,e);break;case u.Action.REMOVE_DISCOUNT:this.dispatchCartAction(u.ActionType.REMOVE_DISCOUNT,e);break;case u.Action.SET_PROPERTIES:this.dispatchCartAction(u.ActionType.SET_PROPERTIES,e);break;case u.Action.REMOVE_PROPERTIES:this.dispatchCartAction(u.ActionType.REMOVE_PROPERTIES,e);break;case u.Action.CLEAR:this.dispatchCartAction(u.ActionType.CLEAR,e);break;case u.Action.ADD_LINE_ITEM:this.dispatchCartAction(u.ActionType.ADD_LINE_ITEM,e);break;case u.Action.UPDATE_LINE_ITEM:this.dispatchCartAction(u.ActionType.UPDATE_LINE_ITEM,e);break;case u.Action.REMOVE_LINE_ITEM:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM,e);break;case u.Action.SET_LINE_ITEM_DISCOUNT:this.dispatchCartAction(u.ActionType.SET_LINE_ITEM_DISCOUNT,e);break;case u.Action.REMOVE_LINE_ITEM_DISCOUNT:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM_DISCOUNT,e);break;case u.Action.SET_LINE_ITEM_PROPERTIES:this.dispatchCartAction(u.ActionType.SET_LINE_ITEM_PROPERTIES,e);break;case u.Action.REMOVE_LINE_ITEM_PROPERTIES:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM_PROPERTIES,e)}return this},e.prototype.dispatchCartAction=function(t,e){this.app.dispatch(s.actionWrapper({type:t,group:c.Group.Cart,payload:i({},e||{},{id:this.id})}))},e}(s.ActionSet);e.Cart=a,e.create=function(t,e){return new a(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(44)),n(o(10))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0});var i=o(9),s=o(9);e.ActionBase=s.ActionBase,e.clear=s.clear,e.ClearAction=s.ClearAction,e.show=s.show,e.ShowAction=s.ShowAction,e.FlashAction=s.ToastAction;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(i.Toast);e.Flash=c,e.create=function(t,e){return new c(t,e)}},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(10);function a(t){return s.actionWrapper({group:c.Group.Toast,payload:t,type:u.ActionType.SHOW})}function p(t){return s.actionWrapper({payload:t,group:c.Group.Toast,type:u.ActionType.CLEAR})}e.show=a,e.clear=p;var f=function(t){function e(e,o){var n=t.call(this,e,c.Group.Toast,c.Group.Toast)||this;return n.message="",n.duration=3e3,n.set(o),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{duration:this.duration,isError:this.isError,message:this.message}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!0,configurable:!0}),e.prototype.set=function(t){var e=s.getMergedProps(this.options,t),o=e.message,n=e.duration,r=e.isError;return this.message=o,this.duration=n,this.isError=r,this},e.prototype.dispatch=function(t){switch(t){case u.Action.SHOW:var e=a(this.payload);this.app.dispatch(e);break;case u.Action.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,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(47)),n(o(22))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(2),s=o(22);e.update=function(){return n.actionWrapper({group:r.Group.Features,type:s.ActionType.UPDATE})},e.validationError=function(t){switch(t.type){case s.ActionType.UPDATE:return;default:return i.invalidActionType(t)}}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(49)),n(o(23))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),s=o(0),c=o(23);function u(t){return i.actionWrapper({payload:t,group:s.Group.Loading,type:c.ActionType.START})}function a(t){return i.actionWrapper({payload:t,group:s.Group.Loading,type:c.ActionType.STOP})}e.start=u,e.stop=a;var p=function(t){function e(e){return t.call(this,e,s.Group.Loading,s.Group.Loading)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t){switch(t){case c.Action.START:this.app.dispatch(u(this.payload));break;case c.Action.STOP:this.app.dispatch(a(this.payload))}return this},e}(i.ActionSet);e.Loading=p,e.create=function(t){return new p(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(51)),n(o(24))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(8),c=o(1),u=o(0),a=o(3),p=o(24),f={group:u.Group.Modal,subgroups:["Footer"],type:u.ComponentType.Button};function d(t){return c.actionWrapper({group:u.Group.Modal,payload:t,type:p.ActionType.OPEN})}function l(t){return c.actionWrapper({group:u.Group.Modal,payload:t,type:p.ActionType.CLOSE})}function h(t){return c.actionWrapper({payload:t,group:u.Group.Modal,type:p.ActionType.UPDATE})}function y(t){return"string"==typeof t.url||"string"==typeof t.path}e.openModal=d,e.closeModal=l,e.clickFooterButton=function(t,e){var o=i({id:t},f);return a.clickButton(u.Group.Modal,o,e)},e.update=h,e.isIframeModal=y,e.isMessageModal=function(t){return"string"==typeof t.message};var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=p.Size.Small,e}return r(e,t),Object.defineProperty(e.prototype,"footer",{get:function(){if(this.footerPrimary||this.footerSecondary)return{buttons:{primary:this.footerPrimary,secondary:this.footerSecondary}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footerOptions",{get:function(){if(this.footerPrimaryOptions||this.footerSecondaryOptions)return{buttons:{primary:this.footerPrimaryOptions,secondary:this.footerSecondaryOptions}}},enumerable:!0,configurable:!0}),e.prototype.close=function(){this.app.dispatch(l({id:this.id}))},e.prototype.setFooterPrimaryButton=function(t,e){var o=this,n=f.subgroups;this.footerPrimaryOptions=this.getChildButton(t,this.footerPrimaryOptions),this.footerPrimary=this.footerPrimaryOptions?s.getSingleButton(this,this.footerPrimaryOptions,n,function(t){o.updatePrimaryFooterButton(t,e)}):void 0},e.prototype.setFooterSecondaryButtons=function(t,e){var o=this,n=f.subgroups,r=t||[],i=this.footerOptions&&this.footerOptions.buttons.secondary||[];this.footerSecondaryOptions=this.getUpdatedChildActions(r,i),this.footerSecondary=this.footerSecondaryOptions?this.footerSecondaryOptions.map(function(t){return s.getSingleButton(o,t,n,function(t){o.updateSecondaryFooterButton(t,e)})}):void 0},e.prototype.getChildButton=function(t,e){var o=t?[t]:[],n=e?[e]:[],r=this.getUpdatedChildActions(o,n);return r?r[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 o,n=0,r=this.footer.buttons.secondary;n<r.length;n++){var i=r[n];if(o=c.updateActionFromPayload(i,t))break}o&&e()}},e}(c.ActionSetWithChildren);e.Modal=A;var E=function(t){function e(e,o){var n=t.call(this,e,u.Group.Modal,u.Group.Modal)||this;return n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{footer:this.footer,id:this.id})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,message:this.message,size:this.size,title:this.title}},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){var o=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),r=n.title,i=n.footer,s=n.message,u=n.size;return this.title=r,this.message=s,this.size=u,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,function(){o.dispatch(p.Action.UPDATE)}),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,function(){o.dispatch(p.Action.UPDATE)}),e&&this.dispatch(p.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case p.Action.OPEN:this.app.dispatch(d(this.payload));break;case p.Action.CLOSE:this.close();break;case p.Action.UPDATE:this.app.dispatch(h(this.payload))}return this},e}(A);e.ModalMessage=E;var P=function(t){function e(e,o){var n=t.call(this,e,u.Group.Modal,u.Group.Modal)||this;return n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{footer:this.footer,id:this.id})},enumerable:!0,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}},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){var o=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),r=n.title,i=n.footer,s=n.path,u=n.url,a=n.size;return this.title=r,this.url=u,this.path=s,this.size=a,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,function(){o.dispatch(p.Action.UPDATE)}),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,function(){o.dispatch(p.Action.UPDATE)}),e&&this.dispatch(p.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case p.Action.OPEN:this.app.dispatch(d(this.payload));break;case p.Action.CLOSE:this.close();break;case p.Action.UPDATE:this.app.dispatch(h(this.payload))}return this},e}(A);e.ModalIframe=P,e.create=function(t,e){return y(e)?new P(t,e):new E(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(53)),n(o(25))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(25);function a(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.PUSH})}function p(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.REPLACE})}e.push=a,e.replace=p;var f=function(t){function e(e){return t.call(this,e,"History",c.Group.Navigation)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t,e){var o=i({},this.payload,{path:e});switch(t){case u.Action.PUSH:this.app.dispatch(a(o));break;case u.Action.REPLACE:this.app.dispatch(p(o))}return this},e}(s.ActionSet);e.History=f,e.create=function(t){return new f(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(55)),n(o(26))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(26);function a(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:c.Group.Navigation,type:u.ActionType.ADMIN_PATH})}function d(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.ADMIN_SECTION})}function l(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.REMOTE})}function h(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.APP})}e.isResourcePayload=function(t){return"string"==typeof t.id},e.isCreateResourcePayload=a,e.isProductVariantResourcePayload=p,e.isProductVariantCreateResourcePayload=function(t){return!!p(t)&&a(t.variant)},e.toAdminPath=f,e.toAdminSection=d,e.toRemote=l,e.toApp=h;var y=function(t){function e(e){return t.call(this,e,"Redirect",c.Group.Navigation)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t,e){switch(t){case u.Action.ADMIN_PATH:var o=function(t){return"object"==typeof t&&t.hasOwnProperty("path")}(e)?e:{path:e};this.app.dispatch(f(i({},this.payload,o)));break;case u.Action.ADMIN_SECTION:var n=function(t){return"object"==typeof t&&"object"==typeof t.section&&t.section.hasOwnProperty("name")}(e)?e:{section:e};this.app.dispatch(d(i({},this.payload,n)));break;case u.Action.APP:this.app.dispatch(h(i({},this.payload,{path:e})));break;case u.Action.REMOTE:var r=function(t){return"object"==typeof t&&t.hasOwnProperty("url")}(e)?e:{url:e};this.app.dispatch(l(i({},this.payload,r)))}return this},e}(s.ActionSet);e.Redirect=y,e.create=function(t){return new y(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(57)),n(o(27))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(27);function a(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.SELECT})}function p(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.OPEN})}function f(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.CANCEL})}function d(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.UPDATE})}e.select=a,e.open=p,e.cancel=f,e.close=function(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.CANCEL})},e.update=d;var l=function(t){function e(e,o,n){var r=t.call(this,e,c.Group.ResourcePicker,c.Group.ResourcePicker)||this;return r.selection=[],r.resourceType=n,r.set(o,!1),r}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{id:this.id,resourceType:this.resourceType})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){var t={initialQuery:this.initialQuery,selectMultiple:this.selectMultiple,showHidden:this.showHidden};return this.resourceType===u.ResourceType.Product?i({},t,{showVariants:this.showVariants}):t},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=s.getMergedProps(this.options,t),n=o.initialQuery,r=o.showHidden,i=void 0!==r&&r,c=o.showVariants,u=void 0===c||c,a=o.selectMultiple,p=void 0===a||a;return this.initialQuery=n,this.showHidden=Boolean(i),this.showVariants=Boolean(u),this.selectMultiple=Boolean(p),e&&this.update(),this},e.prototype.dispatch=function(t,e){return t===u.Action.OPEN?this.open():t===u.Action.UPDATE?this.update():t===u.Action.CLOSE||t===u.Action.CANCEL?this.cancel():t===u.Action.SELECT&&(this.selection=e,this.app.dispatch(a({id:this.id,selection:this.selection}))),this},e.prototype.update=function(){this.app.dispatch(d(this.payload))},e.prototype.open=function(){this.app.dispatch(p(this.payload))},e.prototype.cancel=function(){this.app.dispatch(f({id:this.id}))},e.prototype.close=function(){this.cancel()},e}(s.ActionSet);e.ResourcePicker=l,e.create=function(t,e){var o=e.resourceType,n=e.options;return new l(t,void 0===n?{}:n,o)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(59)),n(o(28))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(3),c=o(7),u=o(60),a=o(8),p=o(1),f=o(0),d=o(28),l={group:f.Group.TitleBar,subgroups:["Buttons"]},h={group:f.Group.TitleBar,subgroups:["Breadcrumbs"],type:f.ComponentType.Button};function y(t){return p.actionWrapper({payload:t,group:f.Group.TitleBar,type:d.ActionType.UPDATE})}e.clickActionButton=function(t,e){var o=f.ComponentType.Button,n=i({id:t,type:o},l);return s.clickButton(f.Group.TitleBar,n,e)},e.clickBreadcrumb=function(t,e){var o=i({id:t},h);return s.clickButton(f.Group.TitleBar,o,e)},e.update=y;var A=function(t){function e(e,o){var n=t.call(this,e,f.Group.TitleBar,f.Group.TitleBar)||this;return n.set(o),n}return r(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{breadcrumbs:this.breadcrumbsOption,buttons:this.buttonsOptions,title:this.title}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{breadcrumbs:this.breadcrumb,buttons:this.buttons,id:this.id})},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=p.getMergedProps(this.options,t),n=o.title,r=o.buttons,i=o.breadcrumbs;return this.title=n,this.setBreadcrumbs(i),this.setPrimaryButton(r?r.primary:void 0),this.setSecondaryButton(r?r.secondary:void 0),e&&this.dispatch(d.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case d.Action.UPDATE:this.app.dispatch(y(this.payload))}return this},e.prototype.getButton=function(t,e,o){return t instanceof c.ButtonGroup?u.getGroupedButton(this,t,e,o):a.getSingleButton(this,t,e,o)},e.prototype.updatePrimaryButton=function(t){this.primary&&p.updateActionFromPayload(this.primary,t)&&this.dispatch(d.Action.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find(function(e){return e.id===t.id});if(e){(c.isGroupedButtonPayload(t),p.updateActionFromPayload(e,t))&&this.dispatch(d.Action.UPDATE)}}},e.prototype.updateBreadcrumbButton=function(t){this.breadcrumb&&p.updateActionFromPayload(this.breadcrumb,t)&&this.dispatch(d.Action.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.setSecondaryButton=function(t){var e=this,o=t||[],n=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(o,n),this.secondary=this.secondaryOptions?this.secondaryOptions.map(function(t){return e.getButton(t,l.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,h.subgroups,this.updateBreadcrumbButton):void 0},e.prototype.getChildButton=function(t,e){var o=t?[t]:[],n=e?[e]:[],r=this.getUpdatedChildActions(o,n);return r?r[0]:void 0},e}(p.ActionSetWithChildren);e.TitleBar=A,e.create=function(t,e){return new A(t,e)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(7);e.getGroupedButton=function(t,e,o,r){t.addChild(e,t.group,o);var i=e.id,s=e.label,c=e.disabled,u=e.buttons;return t.subscribeToChild(e,n.Action.UPDATE,r),{id:i,label:s,buttons:u,disabled:c}}}])});
!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 o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=29)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup",t.Cart="Cart",t.Error="Error",t.Features="Features",t.Toast="Toast",t.Loading="Loading",t.Modal="Modal",t.Navigation="Navigation",t.Print="Print",t.TitleBar="TitleBar",t.ResourcePicker="Resource_Picker"}(e.Group||(e.Group={})),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup"}(e.ComponentType||(e.ComponentType={}))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var c=o(2),u=o(5),a=o(4),p=o(16),f=s(o(37)),d=o(0),l=s(o(38)),h=o(39),y="::";function A(){return h.version}function E(t,e,o){var n=t.toUpperCase();if(o){var r=o.subgroups,i=o.type;r&&r.length>0&&(n+=n.length>0?y:"",r.forEach(function(t,e){n+=""+t.toUpperCase()+(e<r.length-1?y:"")})),i!==t&&i&&(n+=""+(n.length>0?y:"")+i.toUpperCase())}return n&&(n+=""+(n.length>0?y:"")+e.toUpperCase()),""+p.PREFIX+y+n}e.actionWrapper=function(t){return i({},t,{version:A()})},e.getVersion=A,e.getEventNameSpace=E,e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t};var P=function(){function t(t,e,o,n){var r=this;this.app=t,this.type=e,this.group=o,this.subgroups=[],this.subscriptions=[],t||c.throwError(c.ActionType.INVALID_OPTIONS,"Missing required `app`"),this.id=n||l.default(),this.defaultGroup=o;var i=this.set;this.set=function(){for(var t,e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return r.app.hooks?(t=r.app.hooks).run.apply(t,[u.LifecycleHook.UpdateAction,i,r].concat(e)):i.apply(r,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:!0,configurable:!0}),t.prototype.updateSubscription=function(t,e,o){var n,r=t.eventType,i=t.callback,s=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=o,Object.assign(s,{subgroups:this.subgroups}),this.subscribe(r,i,s,n)},t.prototype.error=function(t){var e=this,o=[];return b(c.Action,function(n){o.push(e.subscriptions.length),e.subscribe(n,t)}),function(){o.map(function(t){return e.subscriptions[t]}).forEach(function(t){a.removeFromCollection(e.subscriptions,t,function(t){t.unsubscribe()})})}},t.prototype.subscribe=function(t,e,o,n){var r,s=this,u=o||this.component,a=t.toUpperCase(),p="number"==typeof n?e:e.bind(this);r=c.isErrorEventName(t)?E(d.Group.Error,t,i({},u,{type:""})):E(this.group,t,u);var f=this.app.subscribe(r,p,o?o.id:this.id),l={eventType:a,unsubscribe:f,callback:p,component:u,updateSubscribe:function(t,e){return s.updateSubscription.call(s,l,t,e)}};return"number"==typeof n&&n>=0&&n<this.subscriptions.length?this.subscriptions[n]=l:this.subscriptions.push(l),f},t.prototype.unsubscribe=function(t){return void 0===t&&(t=!1),T(this.subscriptions,this.defaultGroup,t),this},t}();e.ActionSet=P;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=[],e}return r(e,t),e.prototype.unsubscribe=function(t,o){return void 0===t&&(t=!0),void 0===o&&(o=!1),T(this.subscriptions,this.defaultGroup,o),this.children.forEach(function(o){e.prototype.isPrototypeOf(o)?o.unsubscribe(t,!t):o.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(o){return o.component.id===t&&(!e||e===o.eventType)})},e.prototype.addChild=function(t,o,n){var r=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||o===t.group&&n===t.subgroups?this:(i.forEach(function(t){(0,t.updateSubscribe)(o,n)}),Object.assign(t,{group:o,subgroups:n}),e.prototype.isPrototypeOf(t)&&t.children.forEach(function(t){return r.addChild(t,o,n)}),this)},e.prototype.removeChild=function(t){var e=this;return a.removeFromCollection(this.children,this.getChild(t),function(){e.subscriptions.filter(function(e){return e.component.id===t}).forEach(function(t){a.removeFromCollection(e.subscriptions,t,function(t){t.unsubscribe()})})}),this},e.prototype.subscribeToChild=function(t,e,o){var n=this,r=o.bind(this);if(e instanceof Array)return e.forEach(function(e){return n.subscribeToChild(t,e,o)}),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),s=this.getChildSubscriptions(t.id,i);if(s.length>0)s.forEach(function(e){return e.updateSubscribe(n.group,t.subgroups)});else{var c={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,r,c)}return this},e.prototype.getUpdatedChildActions=function(t,e){if(0!==t.length){for(var o=t.filter(function(t,e,o){return e===o.indexOf(t)}),n=o.map(function(t){return t.id}),r=e.filter(function(t){return n.indexOf(t.id)<0});r.length>0;){if(!(i=r.pop()))break;this.removeChild(i.id)}return o}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(P);function T(t,e,o){void 0===o&&(o=!1),t.forEach(function(t){o?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()}),o||(t.length=0)}function _(t,e){var o=f.default(t,e);return o||Object.assign(t,e)}function b(t,e){Object.keys(t).forEach(function(o){e(t[o])})}e.ActionSetWithChildren=O,e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,_(t,e)),!0)},e.getMergedProps=_,e.forEachInEnum=b,e.findMatchInEnum=function(t,e){var o=Object.keys(t).find(function(o){return e===t[o]});return o?t[o]:void 0}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(32)),n(o(11))},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(31)),n(o(19))},function(t,e,o){"use strict";function n(t,e,o){var n=t.findIndex(function(t){return t===e});return n>=0&&(t.splice(n,1),o&&o(e),!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.addAndRemoveFromCollection=function(t,e,o){return t.push(e),function(){return n(t,e,o)}},e.removeFromCollection=n},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(o(12));n(o(18)),e.default=i.default,n(o(12))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=o(15),i=o(4);e.fromFrame=function(t,e){var o=[];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(t){if(t.origin===e&&r.isAppMessage(t))for(var n=0,i=o;n<i.length;n++)(0,i[n])(t)}),{localOrigin:e,hostFrame:s,dispatch:function(e){var o=t.contentWindow;o&&o.postMessage(e,"*")},subscribe:function(t){return i.addAndRemoveFromCollection(o,t)}}},e.fromWindow=function(t,e){var o=[];return void 0!==typeof window&&t!==window&&window.addEventListener("message",function(e){if(e.source===t&&(r.isAppBridgeAction(e.data.payload)||r.isAppMessage(e)))for(var n=0,i=o;n<i.length;n++)(0,i[n])(e)}),{localOrigin:e,hostFrame:t,dispatch:function(e){if(e.source&&e.source.shopOrigin){var o="https://"+e.source.shopOrigin;t.postMessage(e,o)}},subscribe:function(t){return i.addAndRemoveFromCollection(o,t)}}}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(40)),n(o(20))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(3);e.getSingleButton=function(t,e,o,r){return t.addChild(e,t.group,o),t.subscribeToChild(e,n.Action.UPDATE,r),e.payload}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(45)),n(o(10))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.SHOW="APP::TOAST::SHOW",t.CLEAR="APP::TOAST::CLEAR"}(e.ActionType||(e.ActionType={})),function(t){t.SHOW="SHOW",t.CLEAR="CLEAR"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.INVALID_ACTION="INVALID_ACTION",t.INVALID_ACTION_TYPE="INVALID_ACTION_TYPE",t.INVALID_OPTIONS="INVALID_OPTIONS",t.INVALID_PAYLOAD="INVALID_PAYLOAD",t.UNEXPECTED_ACTION="UNEXPECTED_ACTION",t.PERSISTENCE="PERSISTENCE",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK="NETWORK",t.PERMISSION="PERMISSION"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),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.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN"}(e.AppActionType||(e.AppActionType={}))},function(t,e,o){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),s=o(2),c=o(13),u=o(6),a=o(4),p=o(34),f=o(35),d=o(17),l=o(18),h=r(o(36)),y="window is not defined. Running an app outside a browser is not supported";function A(){var t={},e=d.getLocation();return e?e.search.slice(e.search.indexOf("?")+1).split("&").reduce(function(t,e){var o,r=e.split("="),i=r[0],s=r[1];return n({},t,((o={})[decodeURIComponent(i)]=decodeURIComponent(s),o))},t):t}function E(t,o,n){if(void 0===n&&(n=[]),!t)throw s.fromAction(y,s.AppActionType.WINDOW_UNDEFINED);var r=d.getLocation(),i=o||r&&r.origin;if(!i)throw s.fromAction("local origin cannot be blank",s.AppActionType.MISSING_LOCAL_ORIGIN);var c=u.fromWindow(t,i);return e.createClientApp(c,n)}e.getUrlParams=A,e.getShopOrigin=function(){return A().shop},e.createClientApp=function(t,e){void 0===e&&(e=[]);var o=[],n=[],r={},u=function(t){var e=t.data;switch(e.type){case"getState":o.splice(0).forEach(function(t){return t(e.payload)});break;case"dispatch":var c=e.payload;!function(t,e){var o=!1;if(r.hasOwnProperty(t))for(var n=0,c=r[t];n<c.length;n++){var u=c[n],a=u.id,p=u.callback;(!e||e.id!==a)&&a||(p(e),o=!0)}if(!o){var f=i.findMatchInEnum(s.ActionType,t);f&&s.throwError(f,e)}}(c.type,c.payload),n.forEach(function(t){return t.callback(c)})}};return t.subscribe(u),function(y){if(!y.shopOrigin)throw s.fromAction("shopOrigin must be provided",s.AppActionType.INVALID_CONFIG);if(!y.apiKey)throw s.fromAction("apiKey must be provided",s.AppActionType.INVALID_CONFIG);!function(t,e){var o=e.apiKey,n=e.shopOrigin,r=e.forceRedirect,i=void 0===r?!p.isDevelopmentClient:r,s=d.getLocation();if(s&&i&&d.shouldRedirect(t)&&o&&n){var c="https://"+n+"/admin/apps/"+o+s.pathname+(s.search||"");d.redirect(c)}}(t.hostFrame,y);for(var A=function(e){var o={payload:e,source:y,type:"dispatch"};return u({data:o}),t.dispatch(o),e},E=new h.default,P={localOrigin:t.localOrigin,hooks:E,dispatch:function(t){return P.hooks?P.hooks.run(l.LifecycleHook.DispatchAction,A,P,t):A(t)},featuresAvailable:function(t){return P.getState("features").then(function(e){return t&&Object.keys(e).forEach(function(o){t.includes(o)||delete e[o]}),e})},getState:function(e){return new Promise(function(e){o.push(e),t.dispatch({payload:void 0,source:y,type:"getState"})}).then(function(t){return e?e.split(".").reduce(function(e,o){if("object"==typeof t&&!Array.isArray(t))return e=t[o],t=e,e},void 0):t})},subscribe:function(){if(arguments.length<2)return a.addAndRemoveFromCollection(n,{callback:arguments[0]});var t=arguments[0],e={callback:arguments[1],id:arguments[2]};return r.hasOwnProperty(t)||(r[t]=[]),a.addAndRemoveFromCollection(r[t],e)},error:function(t,e){var o=this,n=[];return i.forEachInEnum(s.ActionType,function(r){n.push(o.subscribe(r,t,e))}),function(){n.forEach(function(t){return t()})}}},O=0,T=e;O<T.length;O++){(0,T[O])(E,P)}return function(t){t.subscribe(c.ActionType.APP,f.handleAppPrint)}(P),P}},e.createAppWrapper=E,e.default=function(t){var e=d.getWindow();if(!e)throw s.fromAction(y,s.AppActionType.WINDOW_UNDEFINED);return E(e.top)(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(33)),n(o(14))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.APP="APP::PRINT::APP"}(e.ActionType||(e.ActionType={})),function(t){t.APP="APP"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(16);e.isAppBridgeAction=function(t){return t instanceof Object&&t.hasOwnProperty("type")&&t.type.toString().startsWith(n.PREFIX)},e.isFromApp=function(t){return"object"==typeof t&&"object"==typeof t.source&&"string"==typeof t.source.apiKey},e.isAppMessage=function(t){if("object"!=typeof t||!t.data||"object"!=typeof t.data)return!1;var e=t.data;return e.hasOwnProperty("type")&&("getState"===e.type||"dispatch"===e.type)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PREFIX="APP"},function(t,e,o){"use strict";function n(){return r()?window.location:void 0}function r(){return"undefined"!=typeof window}Object.defineProperty(e,"__esModule",{value:!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 r()?window:void 0}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(0);e.AnyAction=n.AnyAction,e.Dispatch=n.Dispatch,e.Unsubscribe=n.Unsubscribe;var r=o(6);e.Handler=r.Handler,e.HandlerData=r.HandlerData,function(t){t.UpdateAction="UpdateAction",t.DispatchAction="DispatchAction"}(e.LifecycleHook||(e.LifecycleHook={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.CLICK="CLICK",t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.CLICK="APP::BUTTON::CLICK",t.UPDATE="APP::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.Print="print"}(e.Icon||(e.Icon={})),function(t){t.Danger="danger"}(e.Style||(e.Style={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.UPDATE="APP::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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"}(e.ActionType||(e.ActionType={})),function(t){t.FETCH="FETCH",t.UPDATE="UPDATE",t.SET_CUSTOMER="SET_CUSTOMER",t.REMOVE_CUSTOMER="REMOVE_CUSTOMER",t.ADD_CUSTOMER_ADDRESS="ADD_CUSTOMER_ADDRESS",t.UPDATE_CUSTOMER_ADDRESS="UPDATE_CUSTOMER_ADDRESS",t.SET_DISCOUNT="SET_DISCOUNT",t.REMOVE_DISCOUNT="REMOVE_DISCOUNT",t.SET_PROPERTIES="SET_PROPERTIES",t.REMOVE_PROPERTIES="REMOVE_PROPERTIES",t.CLEAR="CLEAR",t.ADD_LINE_ITEM="ADD_LINE_ITEM",t.UPDATE_LINE_ITEM="UPDATE_LINE_ITEM",t.REMOVE_LINE_ITEM="REMOVE_LINE_ITEM",t.SET_LINE_ITEM_DISCOUNT="SET_LINE_ITEM_DISCOUNT",t.REMOVE_LINE_ITEM_DISCOUNT="REMOVE_LINE_ITEM_DISCOUNT",t.SET_LINE_ITEM_PROPERTIES="SET_LINE_ITEM_PROPERTIES",t.REMOVE_LINE_ITEM_PROPERTIES="REMOVE_LINE_ITEM_PROPERTIES"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="APP::FEATURES::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.START="APP::LOADING::START",t.STOP="APP::LOADING::STOP"}(e.ActionType||(e.ActionType={})),function(t){t.START="START",t.STOP="STOP"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.OPEN="OPEN",t.CLOSE="CLOSE",t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.OPEN="APP::MODAL::OPEN",t.CLOSE="APP::MODAL::CLOSE",t.UPDATE="APP::MODAL::UPDATE",t.FOOTER_BUTTON_CLICK="APP::MODAL::FOOTER::BUTTON::CLICK",t.FOOTER_BUTTON_UPDATE="APP::MODAL::FOOTER::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.Small="small",t.Medium="medium",t.Large="large",t.Full="full"}(e.Size||(e.Size={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.PUSH="APP::NAVIGATION::HISTORY::PUSH",t.REPLACE="APP::NAVIGATION::HISTORY::REPLACE"}(e.ActionType||(e.ActionType={})),function(t){t.PUSH="PUSH",t.REPLACE="REPLACE"}(e.Action||(e.Action={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ADMIN_PATH="ADMIN::PATH",t.ADMIN_SECTION="ADMIN::SECTION",t.REMOTE="REMOTE",t.APP="APP"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),function(t){t.Product="products",t.Collection="collections",t.Order="orders",t.Customer="customers",t.Discount="discounts"}(e.ResourceType||(e.ResourceType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.OPEN="OPEN",t.SELECT="SELECT",t.CLOSE="CLOSE",t.UPDATE="UPDATE",t.CANCEL="CANCEL"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),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.Product="product",t.ProductVariant="variant",t.Collection="collection"}(e.ResourceType||(e.ResourceType={}))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={}))},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=r(o(30));e.actions=s;var c=i(o(5));e.default=c.default,n(o(6)),n(o(5))},function(t,e,o){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}(o(0));var r=n(o(3));e.Button=r;var i=n(o(7));e.ButtonGroup=i;var s=n(o(41));e.Cart=s;var c=n(o(2));e.Error=c;var u=n(o(43));e.Flash=u;var a=n(o(46));e.Features=a;var p=n(o(48));e.Loading=p;var f=n(o(50));e.Modal=f;var d=n(o(52));e.History=d;var l=n(o(54));e.Redirect=l;var h=n(o(13));e.Print=h;var y=n(o(56));e.ResourcePicker=y;var A=n(o(58));e.TitleBar=A;var E=n(o(9));e.Toast=E;var P=o(15);e.isAppBridgeAction=P.isAppBridgeAction},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(19);function a(t,e,o){var n=e.id,r=s.getEventNameSpace(t,u.Action.CLICK,e),i={id:n,payload:o};return s.actionWrapper({type:r,group:t,payload:i})}function p(t,e,o){var n=e.id,r=o.label,c=s.getEventNameSpace(t,u.Action.UPDATE,e),a=i({id:n,label:r},o);return s.actionWrapper({type:c,group:t,payload:a})}e.clickButton=a,e.update=p,e.isValidButtonProps=function(t){return"string"==typeof t.id&&"string"==typeof t.label};var f=function(t){function e(e,o){var n=t.call(this,e,c.ComponentType.Button,c.Group.Button)||this;return n.disabled=!1,n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{disabled:this.disabled,icon:this.icon,label:this.label,style:this.style}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=s.getMergedProps(this.options,t),n=o.label,r=o.disabled,i=o.icon,c=o.style;return this.label=n,this.disabled=!!r,this.icon=i,this.style=c,e&&this.dispatch(u.Action.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case u.Action.CLICK:this.app.dispatch(a(this.group,this.component,e));break;case u.Action.UPDATE:var o=p(this.group,this.component,this.payload);this.app.dispatch(o)}return this},e}(s.ActionSet);e.Button=f,e.create=function(t,e){return new f(t,e)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(11);function s(t,e,o){var i=e.payload;return n.actionWrapper({type:t,group:r.Group.Error,payload:{action:e,message:o,type:t,id:i&&i.id?i.id:void 0}})}!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 s(i.ActionType.INVALID_PAYLOAD,t,e||"The action's payload is missing required properties or has invalid properties")},e.invalidActionType=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:i.ActionType.INVALID_ACTION_TYPE},type:i.ActionType.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:i.ActionType.INVALID_ACTION},type:i.ActionType.INVALID_ACTION})},e.unexpectedAction=function(t,e){return n.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:i.ActionType.UNEXPECTED_ACTION},type:i.ActionType.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return s(i.ActionType.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return s(i.ActionType.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return s(i.ActionType.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return s(i.ActionType.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof n.findMatchInEnum(i.Action,t)};var c=function(){return 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,o){var n=new c(t?e+": "+t:e);return n.action=o,n.type=e,n}e.AppBridgeError=c,c.prototype=Object.create(Error.prototype),e.fromAction=u,e.throwError=function(){var t,e,o=arguments[0];throw"string"==typeof arguments[1]?t=arguments[1]:(e=arguments[1],t=arguments[2]||""),u(t,o,e)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(14);e.app=function(){return n.actionWrapper({group:r.Group.Print,type:i.ActionType.APP})}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isServer="undefined"==typeof window,e.isClient=!e.isServer,e.isProduction=!0,e.isDevelopment=!e.isProduction,e.isDevelopmentClient=e.isDevelopment&&e.isClient},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(17);function r(){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(),r(),t.remove())}e.handleAppPrint=function(){navigator.userAgent.indexOf("iOS")>=0?i():r()}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(4),r=function(){function t(){this.map={}}return t.prototype.set=function(t,e){this.map.hasOwnProperty(t)||(this.map[t]=[]);var o={handler:e,remove:function(){}},r=n.addAndRemoveFromCollection(this.map[t],o);return o={handler:e,remove:r},r},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,o){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];var i=0,s=this.get(t)||[];return function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var c=s[i++];return c?c(t).apply(o,n):e.apply(o,n)}.apply(o,n)},t}();e.default=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,o){if(void 0!==o){if(!Object.getPrototypeOf(e).isPrototypeOf(o)||"Object"!==o.constructor.name&&"Array"!==o.constructor.name)return o;var n={};return Object.keys(o).forEach(function(r){e.hasOwnProperty(r)?"object"!=typeof e[r]||Array.isArray(e[r])?n[r]=o[r]:n[r]=t(e[r],o[r]):n[r]=o[r]}),Object.keys(e).forEach(function(t){o.hasOwnProperty(t)||(n[t]=e[t])}),Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}}},function(t,e,o){"use strict";function n(t){return Array.from(t).map(function(t){return("00"+t.toString(16)).slice(-2)}).join("")}function r(t){if("function"==typeof Uint8Array&&window.crypto){var e=new Uint8Array(t),o=window.crypto.getRandomValues(e);if(o)return o}return Array.from(new Array(t),function(){return 255*Math.random()|0})}function i(){var t=r(1),e=r(2);return t[0]&=191,e[0]&=79,[n(r(4)),"-",n(r(2)),"-",n(e),"-",n(t),n(r(1)),"-",n(r(6))].join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=i,e.default=i},function(t){t.exports={name:"@shopify/app-bridge",version:"1.0.0",types:"index.d.ts",main:"index.js",browser:"umd/index.js",files:["MessageTransport.d.ts","MessageTransport.js","MessageTransport.js.map","actions/","client/","index.d.ts","index.js","index.js.map","umd/","util/"],private:!1,publishConfig:{access:"public","@shopify:registry":"https://registry.npmjs.org"},repository:"git@github.com:Shopify/app-bridge.git",author:"Shopify Inc.",license:"MIT",scripts:{build:"yarn build:tsc && yarn build:umd","build:tsc":"NODE_ENV=production tsc","build:umd":"NODE_ENV=production webpack -p",check:"tsc --pretty --noEmit",clean:"cat package.json | node -pe \"JSON.parse(require('fs').readFileSync('/dev/stdin').toString()).files.join(' ')\" | xargs rm -rf",pack:"yarn pack",size:"size-limit"},sideEffects:!1,"size-limit":[{limit:"14 KB",path:"index.js"}],devDependencies:{"@types/node":"^10.12.5",typescript:"3.2.1"},resolutions:{sqlite3:"4.0.1"}}},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(8),c=o(1),u=o(0),a=o(20);function p(t,e,o){return function(t,e,o,n,r){var s=e.id,u=n.label,a=c.getEventNameSpace(t,o,e),p=i({id:s,label:u},n,{payload:r});return c.actionWrapper({type:a,group:t,payload:p})}(t,e,a.Action.UPDATE,o)}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,o){var n=t.call(this,e,u.ComponentType.ButtonGroup,u.Group.ButtonGroup)||this;return n.disabled=!1,n.buttonsOptions=[],n.buttons=[],n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{buttons:this.buttonsOptions,disabled:this.disabled,label:this.label}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{buttons:this.buttons,id:this.id})},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=c.getMergedProps(this.options,t),n=o.label,r=o.disabled,i=o.buttons;return this.label=n,this.disabled=!!r,this.buttons=this.getButtons(i),e&&this.dispatch(a.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.Action.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,o=0,n=this.buttons;o<n.length;o++){var r=n[o];if(e=c.updateActionFromPayload(r,t))break}e&&this.dispatch(a.Action.UPDATE)}},e.prototype.getSingleButton=function(t){return s.getSingleButton(this,t,this.subgroups,this.updateButtons)},e.prototype.getButtons=function(t){var e=this,o=[];return t?(t.forEach(function(t){var n=s.getSingleButton(e,t,e.subgroups,e.updateButtons);o.push(n)}),this.buttonsOptions=t,o):[]},e}(c.ActionSetWithChildren);e.ButtonGroup=f,e.create=function(t,e){return new f(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(42)),n(o(21))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(21),a=function(t){function e(e,o){return t.call(this,e,c.Group.Cart,c.Group.Cart,o?o.id:void 0)||this}return r(e,t),e.prototype.dispatch=function(t,e){switch(t){case u.Action.FETCH:this.dispatchCartAction(u.ActionType.FETCH);break;case u.Action.UPDATE:this.dispatchCartAction(u.ActionType.UPDATE,e);break;case u.Action.SET_CUSTOMER:this.dispatchCartAction(u.ActionType.SET_CUSTOMER,e);break;case u.Action.REMOVE_CUSTOMER:this.dispatchCartAction(u.ActionType.REMOVE_CUSTOMER,e);break;case u.Action.ADD_CUSTOMER_ADDRESS:this.dispatchCartAction(u.ActionType.ADD_CUSTOMER_ADDRESS,e);break;case u.Action.UPDATE_CUSTOMER_ADDRESS:this.dispatchCartAction(u.ActionType.UPDATE_CUSTOMER_ADDRESS,e);break;case u.Action.SET_DISCOUNT:this.dispatchCartAction(u.ActionType.SET_DISCOUNT,e);break;case u.Action.REMOVE_DISCOUNT:this.dispatchCartAction(u.ActionType.REMOVE_DISCOUNT,e);break;case u.Action.SET_PROPERTIES:this.dispatchCartAction(u.ActionType.SET_PROPERTIES,e);break;case u.Action.REMOVE_PROPERTIES:this.dispatchCartAction(u.ActionType.REMOVE_PROPERTIES,e);break;case u.Action.CLEAR:this.dispatchCartAction(u.ActionType.CLEAR,e);break;case u.Action.ADD_LINE_ITEM:this.dispatchCartAction(u.ActionType.ADD_LINE_ITEM,e);break;case u.Action.UPDATE_LINE_ITEM:this.dispatchCartAction(u.ActionType.UPDATE_LINE_ITEM,e);break;case u.Action.REMOVE_LINE_ITEM:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM,e);break;case u.Action.SET_LINE_ITEM_DISCOUNT:this.dispatchCartAction(u.ActionType.SET_LINE_ITEM_DISCOUNT,e);break;case u.Action.REMOVE_LINE_ITEM_DISCOUNT:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM_DISCOUNT,e);break;case u.Action.SET_LINE_ITEM_PROPERTIES:this.dispatchCartAction(u.ActionType.SET_LINE_ITEM_PROPERTIES,e);break;case u.Action.REMOVE_LINE_ITEM_PROPERTIES:this.dispatchCartAction(u.ActionType.REMOVE_LINE_ITEM_PROPERTIES,e)}return this},e.prototype.dispatchCartAction=function(t,e){this.app.dispatch(s.actionWrapper({type:t,group:c.Group.Cart,payload:i({},e||{},{id:this.id})}))},e}(s.ActionSet);e.Cart=a,e.create=function(t,e){return new a(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(44)),n(o(10))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0});var i=o(9),s=o(9);e.ActionBase=s.ActionBase,e.clear=s.clear,e.ClearAction=s.ClearAction,e.show=s.show,e.ShowAction=s.ShowAction,e.FlashAction=s.ToastAction;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(i.Toast);e.Flash=c,e.create=function(t,e){return new c(t,e)}},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(10);function a(t){return s.actionWrapper({group:c.Group.Toast,payload:t,type:u.ActionType.SHOW})}function p(t){return s.actionWrapper({payload:t,group:c.Group.Toast,type:u.ActionType.CLEAR})}e.show=a,e.clear=p;var f=function(t){function e(e,o){var n=t.call(this,e,c.Group.Toast,c.Group.Toast)||this;return n.message="",n.duration=3e3,n.set(o),n}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{duration:this.duration,isError:this.isError,message:this.message}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!0,configurable:!0}),e.prototype.set=function(t){var e=s.getMergedProps(this.options,t),o=e.message,n=e.duration,r=e.isError;return this.message=o,this.duration=n,this.isError=r,this},e.prototype.dispatch=function(t){switch(t){case u.Action.SHOW:var e=a(this.payload);this.app.dispatch(e);break;case u.Action.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,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(47)),n(o(22))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=o(0),i=o(2),s=o(22);e.update=function(){return n.actionWrapper({group:r.Group.Features,type:s.ActionType.UPDATE})},e.validationError=function(t){switch(t.type){case s.ActionType.UPDATE:return;default:return i.invalidActionType(t)}}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(49)),n(o(23))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),s=o(0),c=o(23);function u(t){return i.actionWrapper({payload:t,group:s.Group.Loading,type:c.ActionType.START})}function a(t){return i.actionWrapper({payload:t,group:s.Group.Loading,type:c.ActionType.STOP})}e.start=u,e.stop=a;var p=function(t){function e(e){return t.call(this,e,s.Group.Loading,s.Group.Loading)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t){switch(t){case c.Action.START:this.app.dispatch(u(this.payload));break;case c.Action.STOP:this.app.dispatch(a(this.payload))}return this},e}(i.ActionSet);e.Loading=p,e.create=function(t){return new p(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(51)),n(o(24))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(8),c=o(1),u=o(0),a=o(3),p=o(24),f={group:u.Group.Modal,subgroups:["Footer"],type:u.ComponentType.Button};function d(t){return c.actionWrapper({group:u.Group.Modal,payload:t,type:p.ActionType.OPEN})}function l(t){return c.actionWrapper({group:u.Group.Modal,payload:t,type:p.ActionType.CLOSE})}function h(t){return c.actionWrapper({payload:t,group:u.Group.Modal,type:p.ActionType.UPDATE})}function y(t){return"string"==typeof t.url||"string"==typeof t.path}e.openModal=d,e.closeModal=l,e.clickFooterButton=function(t,e){var o=i({id:t},f);return a.clickButton(u.Group.Modal,o,e)},e.update=h,e.isIframeModal=y,e.isMessageModal=function(t){return"string"==typeof t.message};var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=p.Size.Small,e}return r(e,t),Object.defineProperty(e.prototype,"footer",{get:function(){if(this.footerPrimary||this.footerSecondary)return{buttons:{primary:this.footerPrimary,secondary:this.footerSecondary}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footerOptions",{get:function(){if(this.footerPrimaryOptions||this.footerSecondaryOptions)return{buttons:{primary:this.footerPrimaryOptions,secondary:this.footerSecondaryOptions}}},enumerable:!0,configurable:!0}),e.prototype.close=function(){this.app.dispatch(l({id:this.id}))},e.prototype.setFooterPrimaryButton=function(t,e){var o=this,n=f.subgroups;this.footerPrimaryOptions=this.getChildButton(t,this.footerPrimaryOptions),this.footerPrimary=this.footerPrimaryOptions?s.getSingleButton(this,this.footerPrimaryOptions,n,function(t){o.updatePrimaryFooterButton(t,e)}):void 0},e.prototype.setFooterSecondaryButtons=function(t,e){var o=this,n=f.subgroups,r=t||[],i=this.footerOptions&&this.footerOptions.buttons.secondary||[];this.footerSecondaryOptions=this.getUpdatedChildActions(r,i),this.footerSecondary=this.footerSecondaryOptions?this.footerSecondaryOptions.map(function(t){return s.getSingleButton(o,t,n,function(t){o.updateSecondaryFooterButton(t,e)})}):void 0},e.prototype.getChildButton=function(t,e){var o=t?[t]:[],n=e?[e]:[],r=this.getUpdatedChildActions(o,n);return r?r[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 o,n=0,r=this.footer.buttons.secondary;n<r.length;n++){var i=r[n];if(o=c.updateActionFromPayload(i,t))break}o&&e()}},e}(c.ActionSetWithChildren);e.Modal=A;var E=function(t){function e(e,o){var n=t.call(this,e,u.Group.Modal,u.Group.Modal)||this;return n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{footer:this.footer,id:this.id})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,message:this.message,size:this.size,title:this.title}},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){var o=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),r=n.title,i=n.footer,s=n.message,u=n.size;return this.title=r,this.message=s,this.size=u,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,function(){o.dispatch(p.Action.UPDATE)}),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,function(){o.dispatch(p.Action.UPDATE)}),e&&this.dispatch(p.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case p.Action.OPEN:this.app.dispatch(d(this.payload));break;case p.Action.CLOSE:this.close();break;case p.Action.UPDATE:this.app.dispatch(h(this.payload))}return this},e}(A);e.ModalMessage=E;var P=function(t){function e(e,o){var n=t.call(this,e,u.Group.Modal,u.Group.Modal)||this;return n.set(o,!1),n}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{footer:this.footer,id:this.id})},enumerable:!0,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}},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){var o=this;void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),r=n.title,i=n.footer,s=n.path,u=n.url,a=n.size;return this.title=r,this.url=u,this.path=s,this.size=a,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,function(){o.dispatch(p.Action.UPDATE)}),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,function(){o.dispatch(p.Action.UPDATE)}),e&&this.dispatch(p.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case p.Action.OPEN:this.app.dispatch(d(this.payload));break;case p.Action.CLOSE:this.close();break;case p.Action.UPDATE:this.app.dispatch(h(this.payload))}return this},e}(A);e.ModalIframe=P,e.create=function(t,e){return y(e)?new P(t,e):new E(t,e)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(53)),n(o(25))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(25);function a(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.PUSH})}function p(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.REPLACE})}e.push=a,e.replace=p;var f=function(t){function e(e){return t.call(this,e,"History",c.Group.Navigation)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t,e){var o=i({},this.payload,{path:e});switch(t){case u.Action.PUSH:this.app.dispatch(a(o));break;case u.Action.REPLACE:this.app.dispatch(p(o))}return this},e}(s.ActionSet);e.History=f,e.create=function(t){return new f(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(55)),n(o(26))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(26);function a(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:c.Group.Navigation,type:u.ActionType.ADMIN_PATH})}function d(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.ADMIN_SECTION})}function l(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.REMOTE})}function h(t){return s.actionWrapper({payload:t,group:c.Group.Navigation,type:u.ActionType.APP})}e.isResourcePayload=function(t){return"string"==typeof t.id},e.isCreateResourcePayload=a,e.isProductVariantResourcePayload=p,e.isProductVariantCreateResourcePayload=function(t){return!!p(t)&&a(t.variant)},e.toAdminPath=f,e.toAdminSection=d,e.toRemote=l,e.toApp=h;var y=function(t){function e(e){return t.call(this,e,"Redirect",c.Group.Navigation)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!0,configurable:!0}),e.prototype.dispatch=function(t,e){switch(t){case u.Action.ADMIN_PATH:var o=function(t){return"object"==typeof t&&t.hasOwnProperty("path")}(e)?e:{path:e};this.app.dispatch(f(i({},this.payload,o)));break;case u.Action.ADMIN_SECTION:var n=function(t){return"object"==typeof t&&"object"==typeof t.section&&t.section.hasOwnProperty("name")}(e)?e:{section:e};this.app.dispatch(d(i({},this.payload,n)));break;case u.Action.APP:this.app.dispatch(h(i({},this.payload,{path:e})));break;case u.Action.REMOTE:var r=function(t){return"object"==typeof t&&t.hasOwnProperty("url")}(e)?e:{url:e};this.app.dispatch(l(i({},this.payload,r)))}return this},e}(s.ActionSet);e.Redirect=y,e.create=function(t){return new y(t)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(57)),n(o(27))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),c=o(0),u=o(27);function a(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.SELECT})}function p(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.OPEN})}function f(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.CANCEL})}function d(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.UPDATE})}e.select=a,e.open=p,e.cancel=f,e.close=function(t){return s.actionWrapper({payload:t,group:c.Group.ResourcePicker,type:u.ActionType.CANCEL})},e.update=d;var l=function(t){function e(e,o,n){var r=t.call(this,e,c.Group.ResourcePicker,c.Group.ResourcePicker)||this;return r.selection=[],r.resourceType=n,r.set(o,!1),r}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{id:this.id,resourceType:this.resourceType})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){var t={initialQuery:this.initialQuery,selectMultiple:this.selectMultiple,showHidden:this.showHidden};return this.resourceType===u.ResourceType.Product?i({},t,{showVariants:this.showVariants}):t},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=s.getMergedProps(this.options,t),n=o.initialQuery,r=o.showHidden,i=void 0!==r&&r,c=o.showVariants,u=void 0===c||c,a=o.selectMultiple,p=void 0===a||a;return this.initialQuery=n,this.showHidden=Boolean(i),this.showVariants=Boolean(u),this.selectMultiple=Boolean(p),e&&this.update(),this},e.prototype.dispatch=function(t,e){return t===u.Action.OPEN?this.open():t===u.Action.UPDATE?this.update():t===u.Action.CLOSE||t===u.Action.CANCEL?this.cancel():t===u.Action.SELECT&&(this.selection=e,this.app.dispatch(a({id:this.id,selection:this.selection}))),this},e.prototype.update=function(){this.app.dispatch(d(this.payload))},e.prototype.open=function(){this.app.dispatch(p(this.payload))},e.prototype.cancel=function(){this.app.dispatch(f({id:this.id}))},e.prototype.close=function(){this.cancel()},e}(s.ActionSet);e.ResourcePicker=l,e.create=function(t,e){var o=e.resourceType,n=e.options;return new l(t,void 0===n?{}:n,o)}},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(59)),n(o(28))},function(t,e,o){"use strict";var n,r=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 o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(3),c=o(7),u=o(60),a=o(8),p=o(1),f=o(0),d=o(28),l={group:f.Group.TitleBar,subgroups:["Buttons"]},h={group:f.Group.TitleBar,subgroups:["Breadcrumbs"],type:f.ComponentType.Button};function y(t){return p.actionWrapper({payload:t,group:f.Group.TitleBar,type:d.ActionType.UPDATE})}e.clickActionButton=function(t,e){var o=f.ComponentType.Button,n=i({id:t,type:o},l);return s.clickButton(f.Group.TitleBar,n,e)},e.clickBreadcrumb=function(t,e){var o=i({id:t},h);return s.clickButton(f.Group.TitleBar,o,e)},e.update=y;var A=function(t){function e(e,o){var n=t.call(this,e,f.Group.TitleBar,f.Group.TitleBar)||this;return n.set(o),n}return r(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{breadcrumbs:this.breadcrumbsOption,buttons:this.buttonsOptions,title:this.title}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({},this.options,{breadcrumbs:this.breadcrumb,buttons:this.buttons,id:this.id})},enumerable:!0,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var o=p.getMergedProps(this.options,t),n=o.title,r=o.buttons,i=o.breadcrumbs;return this.title=n,this.setBreadcrumbs(i),this.setPrimaryButton(r?r.primary:void 0),this.setSecondaryButton(r?r.secondary:void 0),e&&this.dispatch(d.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case d.Action.UPDATE:this.app.dispatch(y(this.payload))}return this},e.prototype.getButton=function(t,e,o){return t instanceof c.ButtonGroup?u.getGroupedButton(this,t,e,o):a.getSingleButton(this,t,e,o)},e.prototype.updatePrimaryButton=function(t){this.primary&&p.updateActionFromPayload(this.primary,t)&&this.dispatch(d.Action.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find(function(e){return e.id===t.id});if(e){(c.isGroupedButtonPayload(t),p.updateActionFromPayload(e,t))&&this.dispatch(d.Action.UPDATE)}}},e.prototype.updateBreadcrumbButton=function(t){this.breadcrumb&&p.updateActionFromPayload(this.breadcrumb,t)&&this.dispatch(d.Action.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.setSecondaryButton=function(t){var e=this,o=t||[],n=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(o,n),this.secondary=this.secondaryOptions?this.secondaryOptions.map(function(t){return e.getButton(t,l.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,h.subgroups,this.updateBreadcrumbButton):void 0},e.prototype.getChildButton=function(t,e){var o=t?[t]:[],n=e?[e]:[],r=this.getUpdatedChildActions(o,n);return r?r[0]:void 0},e}(p.ActionSetWithChildren);e.TitleBar=A,e.create=function(t,e){return new A(t,e)}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(7);e.getGroupedButton=function(t,e,o,r){t.addChild(e,t.group,o);var i=e.id,s=e.label,c=e.disabled,u=e.buttons;return t.subscribeToChild(e,n.Action.UPDATE,r),{id:i,label:s,buttons:u,disabled:c}}}])});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc