Liferay.Loader.define("@liferay/commerce-order-web@5.0.87/js/channels",["module","exports","require","commerce-frontend-js/ServiceProvider/index","commerce-frontend-js/components/item_finder/entry","commerce-frontend-js/utilities/eventsDefinitions","frontend-js-web"],(function(e,n,r){window;{Object.defineProperty(n,"__esModule",{value:!0}),n.default=function _default({commerceOrderTypeId:e,dataSetId:n,orderTypeExternalReferenceCode:r,rootPortletId:o}){const c=t.default.AdminOrderAPI("v1");(0,d.default)("itemFinder","item-finder-root-channel",{apiUrl:"/o/headless-commerce-admin-channel/v1.0/channels",getSelectedItems:()=>Promise.resolve([]),inputPlaceholder:Liferay.Language.get("find-a-channel"),itemCreation:!1,itemSelectedMessage:Liferay.Language.get("channel-selected"),itemsKey:"id",linkedDataSetsId:[n],onItemSelected:function selectItem(t){const d={channelExternalReferenceCode:t.externalReferenceCode,channelId:t.id,orderTypeExternalReferenceCode:r,orderTypeId:e};return c.addOrderTypeChannel(e,d).then((()=>{Liferay.fire(i.FDS_UPDATE_DISPLAY,{id:n})})).catch((e=>{(0,a.openToast)({message:e.title,type:"danger"})}))},pageSize:10,panelHeaderLabel:Liferay.Language.get("add-channels"),portletId:o,schema:[{fieldName:"name"}],titleLabel:Liferay.Language.get("add-existing-channel")})};var t=_interopRequireDefault(r("commerce-frontend-js/ServiceProvider/index")),d=_interopRequireDefault(r("commerce-frontend-js/components/item_finder/entry")),i=r("commerce-frontend-js/utilities/eventsDefinitions"),a=r("frontend-js-web");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=channels.js.map