whoami7 - Manager
:
/
home
/
dataiclx
/
vielorbe.com
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
surecart
/
Upload File:
files >> //home/dataiclx/vielorbe.com/wp-content/plugins/surecart/dist/components/surecart/p-1f60f497.js.map
{"version":3,"names":["store","createStore","type","code","message","data","status","http_status","additional_errors","dismissible","newValue","oldValue","JSON","stringify","state","onChange","on","dispose","forceUpdate","defaultOptions","wp","i18n","__"],"sources":["src/store/notices/store.ts","src/store/notices/mutations.ts"],"sourcesContent":["import { createStore } from '@stencil/store';\nimport { ScNoticeStore } from '../../types';\n\nconst store = createStore<ScNoticeStore>(\n {\n type: 'default',\n code: '',\n message: '',\n data: {\n status: 0,\n type: '',\n http_status: '',\n },\n additional_errors: [],\n dismissible: false,\n },\n (newValue, oldValue) => {\n return JSON.stringify(newValue) !== JSON.stringify(oldValue);\n },\n);\n\nconst { state, onChange, on, dispose, forceUpdate } = store;\nexport default state;\nexport { state, onChange, on, dispose, forceUpdate };\n","/**\n * External dependencies.\n */\nimport { __ } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies.\n */\nimport state from './store';\nimport { NoticeType, ScNoticeStore } from '../../types';\n\n/**\n * Default notice options.\n */\nconst defaultOptions = {\n dismissible: false,\n};\n\n/**\n * Create a notice.\n *\n * @param {NoticeType} status\n * @param {ScNoticeStore} notice\n */\nexport const createNotice = (status: NoticeType, notice: ScNoticeStore, options = defaultOptions) => {\n // if notice is a string, then it is message, else the notice object.\n if (typeof notice === 'string') {\n notice = {\n type: status,\n message: notice,\n code: '',\n };\n }\n\n // If no notice message, then set the default message.\n if (!notice?.message) {\n notice.message = __('Something went wrong. Please try again.', 'surecart');\n }\n\n // Set the notice type.\n state.type = status;\n\n // Merge options and notice.\n notice = { ...options, ...notice };\n\n // speak the error notice.\n speak(notice.message, 'assertive');\n\n // Set notice properties to the state.\n Object.keys(notice).forEach(key => {\n state[key] = notice[key];\n });\n};\n\n/**\n * Create an error notice.\n *\n * @param {ScNoticeStore} notice\n * @param {object} options\n */\nexport const createErrorNotice = (notice, options = defaultOptions) => {\n createNotice('error', notice, options);\n};\n\n/**\n * Create a success notice.\n *\n * @param {ScNoticeStore} notice\n * @param {object} options\n */\nexport const createSuccessNotice = (notice, options = defaultOptions) => {\n createNotice('success', notice, options);\n};\n\n/**\n * Create an info notice.\n *\n * @param {ScNoticeStore} notice\n * @param {object} options\n */\nexport const createInfoNotice = (notice, options = defaultOptions) => {\n createNotice('info', notice, options);\n};\n\n/**\n * Create a warning notice.\n *\n * @param {ScNoticeStore} notice\n * @param {object} options\n */\nexport const createWarningNotice = (notice, options = defaultOptions) => {\n createNotice('warning', notice, options);\n};\n\n/**\n * Remove the notice.\n */\nexport const removeNotice = () => {\n state.type = 'default';\n state.code = '';\n state.message = '';\n state.data = {\n status: 0,\n type: '',\n http_status: '',\n };\n state.additional_errors = [];\n};\n"],"mappings":"mEAGA,MAAMA,EAAQC,EACZ,CACEC,KAAM,UACNC,KAAM,GACNC,QAAS,GACTC,KAAM,CACJC,OAAQ,EACRJ,KAAM,GACNK,YAAa,IAEfC,kBAAmB,GACnBC,YAAa,QAEf,CAACC,EAAUC,IACFC,KAAKC,UAAUH,KAAcE,KAAKC,UAAUF,K,MAIjDG,MAAEA,EAAKC,SAAEA,EAAQC,GAAEA,EAAEC,QAAEA,EAAOC,YAAEA,GAAgBlB,ECNtD,MAAAmB,EAAA,C,mJAsBqBC,GAAAC,KAAAC,GAAE,qD","ignoreList":[]}
Copyright ©2021 || Defacer Indonesia