@nocobase/plugin-file-manager 2.1.0-alpha.40 → 2.1.0-alpha.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/client/867ada653cd02a3e.mjs +6 -0
  2. package/dist/client/876.ca16d7a6e6387862.js +11 -0
  3. package/dist/client/index.js +1 -1
  4. package/dist/client/locale/index.d.ts +1 -1
  5. package/dist/client/previewer/filePreviewTypes.d.ts +1 -1
  6. package/dist/client/templates/file.d.ts +1 -1
  7. package/dist/client-v2/125.0b8eef1f19b87042.js +10 -0
  8. package/dist/client-v2/867ada653cd02a3e.mjs +6 -0
  9. package/dist/client-v2/876.22cd8e41ac8631ed.js +11 -0
  10. package/dist/client-v2/{942.9dc2d49980a4dd9e.js → 942.f36d807d763a1b53.js} +1 -1
  11. package/dist/client-v2/index.d.ts +2 -0
  12. package/dist/client-v2/index.js +1 -1
  13. package/dist/{shared → client-v2}/previewer/filePreviewTypes.d.ts +4 -0
  14. package/dist/externalVersion.js +9 -9
  15. package/dist/locale/de-DE.json +3 -0
  16. package/dist/locale/en-US.json +3 -0
  17. package/dist/locale/es-ES.json +3 -0
  18. package/dist/locale/fr-FR.json +3 -0
  19. package/dist/locale/hu-HU.json +4 -1
  20. package/dist/locale/id-ID.json +4 -1
  21. package/dist/locale/it-IT.json +3 -0
  22. package/dist/locale/ja-JP.json +3 -0
  23. package/dist/locale/ko-KR.json +3 -0
  24. package/dist/locale/nl-NL.json +3 -0
  25. package/dist/locale/pt-BR.json +3 -0
  26. package/dist/locale/ru-RU.json +3 -0
  27. package/dist/locale/tr-TR.json +3 -0
  28. package/dist/locale/uk-UA.json +3 -0
  29. package/dist/locale/vi-VN.json +4 -1
  30. package/dist/locale/zh-CN.json +3 -0
  31. package/dist/locale/zh-TW.json +3 -0
  32. package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
  33. package/dist/node_modules/@aws-sdk/lib-storage/package.json +1 -1
  34. package/dist/node_modules/ali-oss/package.json +1 -1
  35. package/dist/node_modules/cos-nodejs-sdk-v5/package.json +1 -1
  36. package/dist/node_modules/mime-match/package.json +1 -1
  37. package/dist/node_modules/mime-types/package.json +1 -1
  38. package/dist/node_modules/mkdirp/package.json +1 -1
  39. package/dist/node_modules/url-join/package.json +1 -1
  40. package/dist/server/commands/repair-filenames.d.ts +55 -0
  41. package/dist/server/commands/repair-filenames.js +283 -0
  42. package/dist/server/server.d.ts +1 -0
  43. package/dist/server/server.js +4 -0
  44. package/dist/server/storages/ali-oss.d.ts +3 -1
  45. package/dist/server/storages/ali-oss.js +23 -2
  46. package/dist/server/storages/index.d.ts +3 -0
  47. package/dist/server/storages/index.js +6 -0
  48. package/dist/server/storages/local.d.ts +2 -0
  49. package/dist/server/storages/local.js +18 -0
  50. package/dist/server/storages/s3.d.ts +2 -0
  51. package/dist/server/storages/s3.js +26 -0
  52. package/dist/server/storages/tx-cos.d.ts +2 -0
  53. package/dist/server/storages/tx-cos.js +27 -0
  54. package/dist/server/utils.js +12 -2
  55. package/package.json +4 -2
  56. package/dist/client-v2/125.01d5562df948d974.js +0 -10
  57. package/dist/shared/locale.d.ts +0 -9
  58. package/dist/shared/locale.js +0 -36
  59. package/dist/shared/previewer/filePreviewTypes.js +0 -459
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- "use strict";(self.webpackChunk_nocobase_plugin_file_manager_client_v2=self.webpackChunk_nocobase_plugin_file_manager_client_v2||[]).push([["942"],{837:function(e,t,r){r.r(t),r.d(t,{default:function(){return E}});var n=r(375),a=r(477),o=r(485),l=r(694),u=r(625),i=r(59),c=r(773),s=r(155),f=r.n(s),p=r(488),d=r(124);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t,r,n,a,o,l){try{var u=e[o](l),i=u.value}catch(e){r(e);return}u.done?t(i):Promise.resolve(i).then(n,a)}function b(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function l(e){y(o,n,a,l,u,"next",e)}function u(e){y(o,n,a,l,u,"throw",e)}l(void 0)})}}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,u=!1;try{for(a=a.call(e);!(l=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(u)throw n}}return o}}(e,t)||v(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}}function h(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:i(0)}),u(l,"throw",{value:i(1)}),u(l,"return",{value:i(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function i(u){return function(i){var c=[u,i];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function w(){var e,t,r=(e=["\n .ant-radio-group {\n display: flex;\n flex-wrap: wrap;\n gap: ","px;\n }\n\n .ant-radio-wrapper {\n margin-inline-end: 0;\n max-width: 100%;\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return w=function(){return r},r}function S(){return(0,l.useFlowContext)().api.resource("storages")}function O(e){var t,r=(0,p.k)(),n=S(),u=g(i.Form.useForm(),1)[0],d=g((0,s.useState)(!1),2),m=d[0],y=d[1],v=(t=i.theme.useToken().token,(0,s.useMemo)(function(){return(0,a.css)(w(),t.marginSM)},[t.marginSM])),O=(0,s.useMemo)(function(){var t,r,n={mode:e.mode,storageType:e.storageType,record:e.record};return"edit"===n.mode?(0,c.cloneDeep)(n.record||{}):(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},(0,c.cloneDeep)(n.storageType.defaultValues||{})),r=r={type:n.storageType.name,name:(0,l.randomId)("s_")},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t)},[e.mode,e.record,e.storageType]);(0,s.useEffect)(function(){u.setFieldsValue(O)},[u,O]);var E=(0,s.useCallback)(function(){return b(function(){var t,r;return h(this,function(a){switch(a.label){case 0:return[4,u.validateFields()];case 1:t=a.sent(),y(!0),a.label=2;case 2:if(a.trys.push([2,,7,8]),"create"!==e.mode)return[3,4];return[4,n.create({values:t})];case 3:return a.sent(),[3,6];case 4:return[4,n.update({filterByTk:null==(r=e.record)?void 0:r.id,values:t})];case 5:a.sent(),a.label=6;case 6:return e.onSubmitted(),[3,8];case 7:return y(!1),[7];case 8:return[2]}})})()},[u,e,n]),k=(0,s.useMemo)(function(){return(0,s.lazy)(e.storageType.formLoader)},[e.storageType]),j="".concat(r("create"===e.mode?"Add new":"Edit")," - ").concat(r(e.storageType.title));return f().createElement(o.DrawerFormLayout,{title:j,onSubmit:E,submitting:m,submitText:r("Submit"),cancelText:r("Cancel")},f().createElement(i.Form,{form:u,layout:"vertical",initialValues:O,className:v},f().createElement(i.Form.Item,{name:"type",hidden:!0},f().createElement(i.Input,null)),f().createElement(s.Suspense,{fallback:f().createElement(i.Spin,null)},f().createElement(k,null))))}function E(){var e=(0,p.k)(),t=(0,l.useFlowContext)(),r=i.theme.useToken().token,a=i.App.useApp(),c=a.modal,y=a.message,w=S(),E=t.app.pm.get(d.S),k=(0,s.useMemo)(function(){var e;return function(e){if(Array.isArray(e))return m(e)}(e=E.storageTypes.values())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},[E]),j=g((0,s.useState)(1),2),T=j[0],A=j[1],x=g((0,s.useState)(o.DEFAULT_PAGE_SIZE),2),C=x[0],P=x[1],D=g((0,s.useState)([]),2),_=D[0],I=D[1],F=(0,u.useRequest)(function(){return b(function(){return h(this,function(e){switch(e.label){case 0:return[4,w.list({page:T,pageSize:C,sort:["id"],appends:[]})];case 1:var t,r,n,a,o;return[2,{records:a=Array.isArray(n=null==(r=null==(t=e.sent())?void 0:t.data)?void 0:r.data)?n:Array.isArray(null==n?void 0:n.data)?n.data:[],total:(o=(null==r?void 0:r.meta)||(null==n?void 0:n.meta)||{}).count||o.total||a.length}]}})})()},{refreshDeps:[T,C]}),M=F.data,z=F.loading,B=F.refresh,L=(0,u.useMemoizedFn)(function(e,t){if(t!==C){P(t),A(1);return}A(e)}),V=(0,s.useCallback)(function(e,r,n){t.viewer.drawer({width:"50%",closable:!0,content:function(){return f().createElement(O,{mode:e,storageType:r,record:n,onSubmitted:function(){return B()}})}})},[t.viewer,B]),G=(0,s.useCallback)(function(t){c.confirm({title:e("Delete"),content:e("Are you sure you want to delete it?"),onOk:function(){return b(function(){return h(this,function(e){switch(e.label){case 0:return[4,w.destroy({filterByTk:t})];case 1:return e.sent(),I([]),B(),[2]}})})()}})},[c,B,w,e]),K=(0,s.useMemo)(function(){return[{title:e("Title"),dataIndex:"title"},{title:e("Storage name"),dataIndex:"name"},{title:e("Default storage"),dataIndex:"default",render:function(e){return e?f().createElement(n.CheckOutlined,{style:{color:r.colorSuccess}}):null}},{title:e("Actions"),render:function(t,r){return f().createElement(i.Space,null,f().createElement("a",{onClick:function(){var t=E.getStorageType(r.type);t?V("edit",t,r):y.error(e("Storage type {{type}} is not registered, please check if related plugin is enabled.").replace("{{type}}",r.type||""))}},e("Edit")),f().createElement("a",{onClick:function(){return G(r.id)}},e("Delete")))}}]},[E,G,y,V,e]);return f().createElement(i.Card,{variant:"borderless"},f().createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginBottom:16}},f().createElement(i.Button,{icon:f().createElement(n.DeleteOutlined,null),disabled:!_.length,onClick:function(){return G(_)}},e("Delete")),f().createElement(i.Dropdown,{menu:{items:k.map(function(t){return{key:t.name,label:e(t.title)}}),onClick:function(e){var t=E.getStorageType(e.key);t&&V("create",t)}}},f().createElement(i.Button,{type:"primary",icon:f().createElement(n.PlusOutlined,null)},e("Add new")," ",f().createElement(n.DownOutlined,null)))),f().createElement(o.Table,{rowKey:"id",loading:z,columns:K,dataSource:(null==M?void 0:M.records)||[],rowSelection:{selectedRowKeys:_,onChange:I},pagination:{current:T,pageSize:C,total:(null==M?void 0:M.total)||0,onChange:L}}))}}}]);
10
+ "use strict";(self.webpackChunk_nocobase_plugin_file_manager_client_v2=self.webpackChunk_nocobase_plugin_file_manager_client_v2||[]).push([["942"],{837:function(e,t,r){r.r(t),r.d(t,{default:function(){return E}});var n=r(375),a=r(477),o=r(485),l=r(694),u=r(625),i=r(59),c=r(773),s=r(155),f=r.n(s),p=r(488),d=r(667);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t,r,n,a,o,l){try{var u=e[o](l),i=u.value}catch(e){r(e);return}u.done?t(i):Promise.resolve(i).then(n,a)}function b(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function l(e){y(o,n,a,l,u,"next",e)}function u(e){y(o,n,a,l,u,"throw",e)}l(void 0)})}}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,u=!1;try{for(a=a.call(e);!(l=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(u)throw n}}return o}}(e,t)||v(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}}function h(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:i(0)}),u(l,"throw",{value:i(1)}),u(l,"return",{value:i(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function i(u){return function(i){var c=[u,i];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function w(){var e,t,r=(e=["\n .ant-radio-group {\n display: flex;\n flex-wrap: wrap;\n gap: ","px;\n }\n\n .ant-radio-wrapper {\n margin-inline-end: 0;\n max-width: 100%;\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return w=function(){return r},r}function S(){return(0,l.useFlowContext)().api.resource("storages")}function O(e){var t,r=(0,p.k)(),n=S(),u=g(i.Form.useForm(),1)[0],d=g((0,s.useState)(!1),2),m=d[0],y=d[1],v=(t=i.theme.useToken().token,(0,s.useMemo)(function(){return(0,a.css)(w(),t.marginSM)},[t.marginSM])),O=(0,s.useMemo)(function(){var t,r,n={mode:e.mode,storageType:e.storageType,record:e.record};return"edit"===n.mode?(0,c.cloneDeep)(n.record||{}):(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},(0,c.cloneDeep)(n.storageType.defaultValues||{})),r=r={type:n.storageType.name,name:(0,l.randomId)("s_")},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t)},[e.mode,e.record,e.storageType]);(0,s.useEffect)(function(){u.setFieldsValue(O)},[u,O]);var E=(0,s.useCallback)(function(){return b(function(){var t,r;return h(this,function(a){switch(a.label){case 0:return[4,u.validateFields()];case 1:t=a.sent(),y(!0),a.label=2;case 2:if(a.trys.push([2,,7,8]),"create"!==e.mode)return[3,4];return[4,n.create({values:t})];case 3:return a.sent(),[3,6];case 4:return[4,n.update({filterByTk:null==(r=e.record)?void 0:r.id,values:t})];case 5:a.sent(),a.label=6;case 6:return e.onSubmitted(),[3,8];case 7:return y(!1),[7];case 8:return[2]}})})()},[u,e,n]),k=(0,s.useMemo)(function(){return(0,s.lazy)(e.storageType.formLoader)},[e.storageType]),j="".concat(r("create"===e.mode?"Add new":"Edit")," - ").concat(r(e.storageType.title));return f().createElement(o.DrawerFormLayout,{title:j,onSubmit:E,submitting:m,submitText:r("Submit"),cancelText:r("Cancel")},f().createElement(i.Form,{form:u,layout:"vertical",initialValues:O,className:v},f().createElement(i.Form.Item,{name:"type",hidden:!0},f().createElement(i.Input,null)),f().createElement(s.Suspense,{fallback:f().createElement(i.Spin,null)},f().createElement(k,null))))}function E(){var e=(0,p.k)(),t=(0,l.useFlowContext)(),r=i.theme.useToken().token,a=i.App.useApp(),c=a.modal,y=a.message,w=S(),E=t.app.pm.get(d.S),k=(0,s.useMemo)(function(){var e;return function(e){if(Array.isArray(e))return m(e)}(e=E.storageTypes.values())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},[E]),j=g((0,s.useState)(1),2),T=j[0],A=j[1],x=g((0,s.useState)(o.DEFAULT_PAGE_SIZE),2),C=x[0],P=x[1],D=g((0,s.useState)([]),2),_=D[0],I=D[1],F=(0,u.useRequest)(function(){return b(function(){return h(this,function(e){switch(e.label){case 0:return[4,w.list({page:T,pageSize:C,sort:["id"],appends:[]})];case 1:var t,r,n,a,o;return[2,{records:a=Array.isArray(n=null==(r=null==(t=e.sent())?void 0:t.data)?void 0:r.data)?n:Array.isArray(null==n?void 0:n.data)?n.data:[],total:(o=(null==r?void 0:r.meta)||(null==n?void 0:n.meta)||{}).count||o.total||a.length}]}})})()},{refreshDeps:[T,C]}),M=F.data,z=F.loading,B=F.refresh,L=(0,u.useMemoizedFn)(function(e,t){if(t!==C){P(t),A(1);return}A(e)}),V=(0,s.useCallback)(function(e,r,n){t.viewer.drawer({width:"50%",closable:!0,content:function(){return f().createElement(O,{mode:e,storageType:r,record:n,onSubmitted:function(){return B()}})}})},[t.viewer,B]),G=(0,s.useCallback)(function(t){c.confirm({title:e("Delete"),content:e("Are you sure you want to delete it?"),onOk:function(){return b(function(){return h(this,function(e){switch(e.label){case 0:return[4,w.destroy({filterByTk:t})];case 1:return e.sent(),I([]),B(),[2]}})})()}})},[c,B,w,e]),K=(0,s.useMemo)(function(){return[{title:e("Title"),dataIndex:"title"},{title:e("Storage name"),dataIndex:"name"},{title:e("Default storage"),dataIndex:"default",render:function(e){return e?f().createElement(n.CheckOutlined,{style:{color:r.colorSuccess}}):null}},{title:e("Actions"),render:function(t,r){return f().createElement(i.Space,null,f().createElement("a",{onClick:function(){var t=E.getStorageType(r.type);t?V("edit",t,r):y.error(e("Storage type {{type}} is not registered, please check if related plugin is enabled.").replace("{{type}}",r.type||""))}},e("Edit")),f().createElement("a",{onClick:function(){return G(r.id)}},e("Delete")))}}]},[E,G,y,V,e]);return f().createElement(i.Card,{variant:"borderless"},f().createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginBottom:16}},f().createElement(i.Button,{icon:f().createElement(n.DeleteOutlined,null),disabled:!_.length,onClick:function(){return G(_)}},e("Delete")),f().createElement(i.Dropdown,{menu:{items:k.map(function(t){return{key:t.name,label:e(t.title)}}),onClick:function(e){var t=E.getStorageType(e.key);t&&V("create",t)}}},f().createElement(i.Button,{type:"primary",icon:f().createElement(n.PlusOutlined,null)},e("Add new")," ",f().createElement(n.DownOutlined,null)))),f().createElement(o.Table,{rowKey:"id",loading:z,columns:K,dataSource:(null==M?void 0:M.records)||[],rowSelection:{selectedRowKeys:_,onChange:I},pagination:{current:T,pageSize:C,total:(null==M?void 0:M.total)||0,onChange:L}}))}}}]);
@@ -13,3 +13,5 @@ export { BaseUrlField, DefaultField, FileSizeField, MimetypeField, NameField, Pa
13
13
  export type { DefaultFieldProps } from './components/DefaultField';
14
14
  export type { PathFieldProps } from './components/PathField';
15
15
  export { CardUpload, UploadFieldModel } from './models/UploadFieldModel';
16
+ export { filePreviewTypes, wrapWithModalPreviewer } from './previewer/filePreviewTypes';
17
+ export type { FilePreviewType, FilePreviewerProps } from './previewer/filePreviewTypes';
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@emotion/css"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-manager/client-v2",["react-i18next","@emotion/css","@formily/react","@ant-design/icons","@nocobase/flow-engine","ahooks","@nocobase/client-v2","react","antd","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-file-manager/client-v2"]=t(require("react-i18next"),require("@emotion/css"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("lodash")):e["@nocobase/plugin-file-manager/client-v2"]=t(e["react-i18next"],e["@emotion/css"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e.ahooks,e["@nocobase/client-v2"],e.react,e.antd,e.lodash)}(self,function(e,t,n,r,o,i,l,a,u,c){return function(){var s,f,p,d={484:function(e,t,n){var r=n(986),o=/[\/\+\.]/;e.exports=function(e,t){function n(t){var n=r(t,e,o);return n&&n.length>=2}return t?n(t.split(";")[0]):n}},986:function(e){"use strict";function t(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}t.prototype.match=function(e){var t,n,r=!0,o=this.parts,i=o.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(t=0,n=(e||"").split(this.separator);r&&t<i;t++)if("*"===o[t])continue;else r=t<n.length&&o[t]===n[t];r=r&&n}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var l in r={},e)this.match(l)&&(r[l]=e[l]);return r},e.exports=function(e,n,r){var o=new t(e,r||/[\/\.]/);return void 0!==n?o.match(n):o}},76:function(e,t,n){"use strict";n.r(t),n.d(t,{UploadFieldModel:function(){return _},CardUpload:function(){return q}});var r=n(375),o=n(477),i=n(59),l=n(773),a=n(953),u=n(694),c=n(155),s=n.n(c),f=n(230),p=n(485),d=n(348);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var g=function(e,t){var n,r,o,i,l=null==e?void 0:e.response,a=null!=(n=null==e?void 0:e.id)?n:null==l?void 0:l.id,u=null!=(r=null==e?void 0:e.url)?r:null==l?void 0:l.url,c=null!=(o=null==e?void 0:e.filename)?o:null==l?void 0:l.filename,s=null!=(i=null==e?void 0:e.name)?i:null==l?void 0:l.name;return null!=a?"id:".concat(String(a)):null!=u?"url:".concat(u):null!=c?"filename:".concat(c,":").concat(t):null!=s?"name:".concat(s,":").concat(t):(null==e?void 0:e.uid)?"uid:".concat(e.uid):"index:".concat(t)},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map(t.map(function(e,t){return[g(e,t),e.uid]}).filter(function(e){return!!(function(e){if(Array.isArray(e))return e}(e)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return m(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1]}));return e.map(function(e,t){var r,o,i,l=g(e,t);return r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),o=o={uid:e.uid||n.get(l)||l,thumbUrl:null!=(i=e.thumbUrl)?i:(0,d.qk)(e)},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r})},v=function(e,t){var n=e.findIndex(function(e){return e.uid===(null==t?void 0:t.uid)});return n>=0?n:0};function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,i,l){try{var a=e[i](l),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){h(i,r,o,l,a,"next",e)}function a(e){h(i,r,o,l,a,"throw",e)}l(void 0)})}}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t,n){return(x="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=S(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){O(e,t,n[t])})}return e}function E(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||F(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||F(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(R=function(){return!!e})()}function T(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:u(0)}),a(l,"throw",{value:u(1)}),a(l,"return",{value:u(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function u(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function I(){var e,t,n=(e=["\n .ant-upload-list-picture-card {\n margin-bottom: 10px;\n .ant-upload-list-item-container {\n margin: ",";\n }\n }\n .ant-upload-select {\n margin: ",";\n }\n ","\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return I=function(){return n},n}var q=function(e){var t,n=e.allowSelectExistingRecord,u=e.multiple,p=e.value,m=e.disabled,g=e.onSelectExitRecordClick,b=e.quickUpload,h=e.showFileName,O=k((0,c.useState)(function(){return y((0,l.castArray)(p||[]))}),2),x=O[0],S=O[1],P=k((0,c.useState)(!1),2),C=P[0],F=P[1],R=k((0,c.useState)(null),2),q=R[0],_=R[1],M=k((0,c.useState)(0),2),A=M[0],D=M[1],U=(0,a.useTranslation)().t;(0,c.useLayoutEffect)(function(){S(function(e){return y((0,l.castArray)(p||[]),e)})},[p]);var L=(t=x.length,!!u||0===t);return s().createElement(f.FieldContext.Provider,{value:{value:x}},s().createElement("div",{style:{display:"flex"},className:(0,o.css)(I(),h?"8px 0px":"0px",h?"8px 0px":"0px",u?"":"\n .ant-upload-list-item-container.ant-upload-animate-inline-appear,\n .ant-upload-list-item-container.ant-upload-animate-inline-appear-active,\n .ant-upload-list-item-container.ant-upload-animate-inline-enter,\n .ant-upload-list-item-container.ant-upload-animate-inline-enter-active {\n animation: none !important;\n transition: none !important;\n transform: none !important;\n opacity: 1 !important;\n }\n\n .ant-upload.ant-upload-animate-inline-leave,\n .ant-upload.ant-upload-animate-inline-leave-active {\n animation: none !important;\n transition: none !important;\n }\n ")},s().createElement(i.Upload,E(j({onPreview:function(e){return w(function(){var t;return T(this,function(n){switch(n.label){case 0:var r;if(t=v(x,e),!(!e.url&&!e.preview))return[3,2];return[4,(r=e.originFileObj,new Promise(function(e,t){var n=new FileReader;n.readAsDataURL(r),n.onload=function(){return e(n.result)},n.onerror=function(e){return t(e)}}))];case 1:e.preview=n.sent(),n.label=2;case 2:return _(e),D(t),F(!0),[2]}})})()}},e),{listType:"picture-card",fileList:x,onChange:function(t){var n=t.fileList;S(function(e){return y(n,e)});var r=n.filter(function(e){return"done"===e.status||e.id});if(n.every(function(e){return"done"===e.status||e.id}))if(1===e.maxCount){var o=r[0];e.onChange(o?o.response:null)}else e.onChange(r.map(function(e){return e.response||e}).filter(Boolean))},itemRender:function(e,t){return s().createElement(s().Fragment,null,e,h&&s().createElement("div",{style:{fontSize:12,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},title:t.filename},t.filename))}}),(void 0===b||b)&&L?s().createElement(r.UploadOutlined,{style:{fontSize:20}}):null),q&&s().createElement(d.Mo,{open:C,file:q,list:x,index:A,onOpenChange:F,onClose:function(){return _(null)},onSwitchIndex:function(e){e<0||e>=x.length||(D(e),_(x[e]))},onDownload:function(e){var t=e||q;if(t){var n=t.url||t.preview;if(n){var r=(0,d.ub)(t,n);fetch(n).then(function(e){return e.blob()}).then(function(e){var t=URL.createObjectURL(new Blob([e])),n=document.createElement("a");n.href=t,n.download=r,document.body.appendChild(n),n.click(),URL.revokeObjectURL(t),n.remove()})}}}}),n&&L?s().createElement("div",{style:{marginLeft:5}},s().createElement(i.Upload,{disabled:m,multiple:u,listType:"picture-card",showUploadList:!1},s().createElement("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},onClick:function(e){m||(e.stopPropagation(),e.preventDefault(),g())}},s().createElement(r.PlusOutlined,null),U("Select")))):null))},_=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=S(t),O(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,R()?Reflect.construct(t,r||[],S(this).constructor):t.apply(this,r)),"selectedRows",u.observable.ref([])),O(e,"_closeView",void 0),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&P(n,e),t=[{key:"customRequest",set:function(e){this.setProps({customRequest:e})}},{key:"onInit",value:function(e){var t=this;x(S(n.prototype),"onInit",this).call(this,e),this.onSelectExitRecordClick=function(e){t.dispatchEvent("openView",{event:e})}}},{key:"onSelectExitRecordClick",set:function(e){this.setProps({onSelectExitRecordClick:e})}},{key:"change",value:function(){this.props.onChange(this.selectedRows.value)}},{key:"render",value:function(){return s().createElement(q,this.props)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(p.FieldModel);(_=function(e,t,n,r){var o,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i<3?o(l):i>3?o(t,n,l):o(t,n))||l);return i>3&&l&&Object.defineProperty(t,n,l),l}([(0,u.largeField)()],_)).registerFlow({key:"uploadSettings",title:(0,u.tExpr)("Upload file settings"),steps:{quickUpload:{title:(0,u.tExpr)("Quick upload"),uiMode:{type:"switch",key:"quickUpload"},hideInSettings:function(e){return!e.collectionField.isAssociationField()||!e.collectionField.targetCollection},defaultParams:function(e){return{quickUpload:!0}},handler:function(e,t){e.model.setProps({quickUpload:t.quickUpload})}},allowMultiple:{title:(0,u.tExpr)("Allow multiple"),uiMode:{type:"switch",key:"multiple"},hideInSettings:function(e){return!e.collectionField||!["belongsToMany","hasMany","belongsToArray"].includes(e.collectionField.type)},defaultParams:function(e){return{multiple:e.collectionField&&["belongsToMany","hasMany","belongsToArray"].includes(e.model.context.collectionField.type)}},handler:function(e,t){e.model.setProps({multiple:null==t?void 0:t.multiple,maxCount:(null==t?void 0:t.multiple)?null:1})}},showFileName:{title:(0,u.tExpr)("Show file name"),uiMode:{type:"switch",key:"showFileName"},defaultParams:{showFileName:!1},handler:function(e,t){e.model.setProps("showFileName",t.showFileName)}},allowSelectExistingRecord:{title:(0,u.tExpr)("Allow selection of existing file"),uiMode:{type:"switch",key:"allowSelectExistingRecord"},hideInSettings:function(e){return!e.collectionField.isAssociationField()||!e.collectionField.targetCollection},defaultParams:function(e){return{allowSelectExistingRecord:e.collectionField.targetCollection&&e.collectionField.isAssociationField()}},handler:function(e,t){e.model.setProps({allowSelectExistingRecord:t.allowSelectExistingRecord})}}}}),_.registerFlow({key:"eventSettings",sort:300,steps:{bindEvent:{handler:function(e,t){e.model.customRequest=function(t){e.model.dispatchEvent("customRequest",{apiClient:e.app.apiClient,fileData:t})}}}}}),_.registerFlow({key:"customRequestSettings",on:"customRequest",steps:{step1:{handler:function(e,t){return w(function(){var t,n,r,o,i,l,a,u,c,s,f,p,d,m,g,y,v,b,h,w,O,x,S,P,k,C,F,R;return T(this,function(T){switch(T.label){case 0:if(n=(t=e.inputArgs.fileData).file,r=t.onSuccess,o=t.onError,i=t.onProgress,l=e.app.pm.get("@nocobase/plugin-file-manager"),a=e.model.props.target,u=e.collectionField,!l)return[2,r(n)];T.label=1;case 1:return T.trys.push([1,6,,7]),[4,e.api.resource("storages").check({fileCollectionName:a,storageName:u.options.storage})];case 2:if(!(null==(h=T.sent().data)||null==(c=h.data)?void 0:c.isSupportToUploadFiles))return O=e.t('The current storage "{{storageName}}" does not support file uploads.',{storageName:null==(w=h.data.storage)?void 0:w.title}).replaceAll("&gt;",">"),null==o||o(Error(O)),[2];if(x=l.getStorageType(null==h||null==(f=h.data)||null==(s=f.storage)?void 0:s.type)||{},S=null==h||null==(p=h.data)?void 0:p.storage,!x.createUploadCustomRequest||"function"!=typeof(P=x.createUploadCustomRequest(E(j({},e.model.props),{api:e.api,action:"".concat(a,":create?attachmentField=").concat(u.collectionName,".").concat(u.name),storage:S}))))return[3,4];return[4,P({file:n,onProgress:i,onSuccess:r,onError:o})];case 3:return T.sent(),[2];case 4:return[4,l.uploadFile({file:n,fileCollectionName:a,storageId:null==h||null==(m=h.data)||null==(d=m.storage)?void 0:d.id,storageType:null==h||null==(y=h.data)||null==(g=y.storage)?void 0:g.type,storageRules:null==h||null==(b=h.data)||null==(v=b.storage)?void 0:v.rules,onProgress:function(e){null==i||i({percent:e})},query:{attachmentField:"".concat(u.collectionName,".").concat(u.name)}})];case 5:if(C=(k=T.sent()).data,F=k.errorMessage)return null==o||o(Error(F)),[2];if(!C)return null==o||o(Error("上传成功但响应数据为空")),[2];return r(C),[3,7];case 6:return R=T.sent(),null==o||o(R),[3,7];case 7:return[2]}})})()}}}}),_.registerFlow({key:"selectExitRecordSettings",title:(0,u.tExpr)("Selector setting"),on:{eventName:"openView"},steps:{openView:{title:(0,u.tExpr)("Edit popup"),hideInSettings:function(e){var t,n,r;return!1===(null==(n=(r=e.model).getStepParams)||null==(t=n.call(r,"uploadSettings","allowSelectExistingRecord"))?void 0:t.allowSelectExistingRecord)},uiSchema:function(e){return{mode:{type:"string",title:(0,u.tExpr)("Open mode"),enum:[{label:(0,u.tExpr)("Drawer"),value:"drawer"},{label:(0,u.tExpr)("Dialog"),value:"dialog"}],"x-decorator":"FormItem","x-component":"Radio.Group"},size:{type:"string",title:(0,u.tExpr)("Popup size"),enum:[{label:(0,u.tExpr)("Small"),value:"small"},{label:(0,u.tExpr)("Medium"),value:"medium"},{label:(0,u.tExpr)("Large"),value:"large"}],"x-decorator":"FormItem","x-component":"Radio.Group"}}},defaultParams:{mode:"drawer",size:"medium"},handler:function(e,t){var n,r,o,i,l,a=["belongsTo","hasOne"].includes(e.collectionField.type),u=e.isMobileLayout?"embed":e.inputArgs.mode||t.mode||"drawer",c=e.inputArgs.size||t.size||"medium",f=(null==(n=e.model.props)?void 0:n.sourceFieldModelUid)||e.model.uid,d=(null==(r=e.model.parent)?void 0:r.use)==="QuickEditFormModel"?null==(o=e.model.parent)?void 0:o.viewContainer:null;null==d||null==(i=d.update)||i.call(d,{preventClose:!0}),e.viewer.open({type:u,width:{drawer:{small:"30%",medium:"50%",large:"70%"},dialog:{small:"40%",medium:"50%",large:"80%"},embed:{}}[u][c],inheritContext:!1,target:e.layoutContentElement,onClose:function(){setTimeout(function(){var e;null==d||null==(e=d.update)||e.call(d,{preventClose:!1})},0)},inputArgs:{parentId:f,scene:"select",dataSourceKey:e.collection.dataSourceKey,collectionName:null==(l=e.collectionField)?void 0:l.target,collectionField:e.collectionField,rowSelectionProps:{type:a?"radio":"checkbox",defaultSelectedRows:function(){return e.model.props.value},renderCell:void 0,selectedRowKeys:void 0,onChange:function(t,n){if(a){var r,o;e.model.selectedRows.value=null==n?void 0:n[0],e.model.change(),null==(r=(o=e.model)._closeView)||r.call(o)}else{var i=C(e.model.props.value||[]).concat(C(n)).filter(function(t,n,r){return n===r.findIndex(function(n){return n[e.collection.filterTargetKey]===t[e.collection.filterTargetKey]})});e.model.selectedRows.value=i}}}},content:function(){return s().createElement(p.RecordPickerContent,{model:e.model})},styles:{content:j({padding:0,backgroundColor:e.model.flowEngine.context.themeToken.colorBgLayout},"embed"===u?{position:"absolute",top:0,left:0,right:0,bottom:0}:{}),body:{padding:0}}})}}}}),_.define({label:(0,u.tExpr)("File picker")}),u.EditableItemModel.bindModelToInterface("UploadFieldModel",["attachment","m2m","m2o","o2o","o2m","oho","obo","updatedBy","createdBy","mbm"],{isDefault:!0,order:30,when:function(e,t){return!t.targetCollection||"file"===t.targetCollection.template}})},124:function(e,t,n){"use strict";n.d(t,{A:function(){return h},S:function(){return b}});var r=n(485),o=n(624),i="file-manager";function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t,n,r,o,i,l){try{var a=e[i](l),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){a(i,r,o,l,u,"next",e)}function u(e){a(i,r,o,l,u,"throw",e)}l(void 0)})}}function c(e,t,n){return(c=y()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&m(o,n.prototype),o}).apply(null,arguments)}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){s(e,t,n[t])})}return e}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t="function"==typeof Map?new Map:void 0;return(g=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return c(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),m(n,e)})(e)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}function v(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:u(0)}),a(l,"throw",{value:u(1)}),a(l,"return",{value:u(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function u(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var b=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=f(t),s(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,y()?Reflect.construct(t,n||[],f(this).constructor):t.apply(this,n)),"storageTypes",new Map),e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&m(r,e),t=[{key:"load",value:function(){return u(function(){var e;return v(this,function(t){return e=this.app.i18n.t("File manager",{ns:i}),this.pluginSettingsManager.addMenuItem({key:i,title:e,icon:"FileOutlined",aclSnippet:"pm.file-manager.storages"}),this.pluginSettingsManager.addPageTabItem({menuKey:i,key:"index",title:e,componentLoader:function(){return n.e("942").then(n.bind(n,837))}}),this.registerBuiltInStorageTypes(),this.flowEngine.registerModelLoaders({DisplayPreviewFieldModel:{loader:function(){return n.e("125").then(n.bind(n,212))}},UploadActionModel:{loader:function(){return n.e("450").then(n.bind(n,177))}},UploadFieldModel:{loader:function(){return Promise.resolve().then(n.bind(n,76))}}}),[2]})}).call(this)}},{key:"registerStorageType",value:function(e,t){this.storageTypes.set(e,d(p({},t),{name:e}))}},{key:"getStorageType",value:function(e){return e?this.storageTypes.get(e):void 0}},{key:"registerBuiltInStorageTypes",value:function(){var e={renameMode:"appendRandomID",rules:{size:o.ZH}};this.registerStorageType(o.ZF,{title:"Local storage",formLoader:function(){return n.e("929").then(n.bind(n,864))},defaultValues:d(p({},e),{baseUrl:"/storage/uploads",options:{documentRoot:"storage/uploads"}})}),this.registerStorageType(o.y2,{title:"Aliyun OSS",formLoader:function(){return n.e("43").then(n.bind(n,574))},defaultValues:d(p({},e),{options:{timeout:6e5},settings:{requestOptions:{}}})}),this.registerStorageType(o.e7,{title:"Amazon S3",formLoader:function(){return n.e("336").then(n.bind(n,595))},defaultValues:e}),this.registerStorageType(o.a_,{title:"Tencent COS",formLoader:function(){return n.e("229").then(n.bind(n,316))},defaultValues:e})}},{key:"uploadFile",value:function(e){return u(function(){var t,n,r,o,i,a,u,c,s,f,p,d,m;return v(this,function(g){switch(g.label){case 0:if(!(null==e?void 0:e.file))return[2,{errorMessage:"Missing file"}];if(t=e.file,n=e.storageType,r=e.storageId,o=e.storageRules,a=void 0===(i=e.query)?{}:i,u=e.fileCollectionName||"attachments",!(null==(c=this.getStorageType(n))?void 0:c.upload))return[3,2];return[4,c.upload({file:t,apiClient:this.app.apiClient,storageType:n,storageId:r,storageRules:o,fileCollectionName:u,query:a})];case 1:return[2,g.sent()];case 2:return g.trys.push([2,4,,5]),(f=new FormData).append("file",t),d=(p=new URLSearchParams(Object.entries(a).map(function(e){var t=function(e){if(Array.isArray(e))return e}(e)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return l(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return[t[0],String(t[1])]})).toString())?"".concat(u,":create?").concat(p):"".concat(u,":create"),[4,this.app.apiClient.request({url:d,method:"post",data:f})];case 3:return[2,{data:null==(s=g.sent().data)?void 0:s.data}];case 4:var y,v;return[2,{errorMessage:(y=m=g.sent(),null!=(v=Error)&&"u">typeof Symbol&&v[Symbol.hasInstance]?!!v[Symbol.hasInstance](y):y instanceof v)?m.message:"Upload failed"}];case 5:return[2]}})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}(g(r.Plugin));s(b,"buildInStorage",[o.ZF,o.y2,o.e7,o.a_]);var h=b},348:function(e,t,n){"use strict";n.d(t,{Mo:function(){return q},WP:function(){return P},_H:function(){return d},_Y:function(){return C},q:function(){return m},qk:function(){return F},ub:function(){return k}});var r=n(155),o=n.n(r),i=n(375),l=n(59),a=n(484),u=n.n(a),c=n(953),s=n(301);function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var p=new(function(){var e;function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");f(this,"types",[])}return e=[{key:"add",value:function(e){this.types.unshift(e)}},{key:"getTypeByFile",value:function(e){var t=d(e);return this.types.find(function(e){return e.match(t)})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}());function d(e){return e&&"string"==typeof e?{url:e}:e}function m(e){return e?"string"==typeof e?e:e.preview||e.url||"":""}function g(e){return e?"string"==typeof e?e:e.url||e.preview||"":""}var y={pdf:"/file-placeholder/pdf-200-200.png",mp4:"/file-placeholder/video-200-200.png",mov:"/file-placeholder/video-200-200.png",avi:"/file-placeholder/video-200-200.png",wmv:"/file-placeholder/video-200-200.png",flv:"/file-placeholder/video-200-200.png",mkv:"/file-placeholder/video-200-200.png",mp3:"/file-placeholder/audio-200-200.png",wav:"/file-placeholder/audio-200-200.png",aac:"/file-placeholder/audio-200-200.png",ogg:"/file-placeholder/audio-200-200.png",doc:"/file-placeholder/docx-200-200.png",docx:"/file-placeholder/docx-200-200.png",odt:"/file-placeholder/docx-200-200.png",xls:"/file-placeholder/xlsx-200-200.png",xlsx:"/file-placeholder/xlsx-200-200.png",csv:"/file-placeholder/xlsx-200-200.png",ppt:"/file-placeholder/pptx-200-200.png",pptx:"/file-placeholder/pptx-200-200.png",jpg:"/file-placeholder/jpeg-200-200.png",jpeg:"/file-placeholder/jpeg-200-200.png",png:"/file-placeholder/png-200-200.png",gif:"/file-placeholder/gif-200-200.png",webp:"/file-placeholder/png-200-200.png",bmp:"/file-placeholder/png-200-200.png",svg:"/file-placeholder/svg-200-200.png",default:"/file-placeholder/unknown-200-200.png"},v=new Set(["application/xhtml+xml","image/svg+xml","text/html"]),b=new Set(["htm","html","svg","svgz","xhtml"]),h=function(e){return e.split("?")[0].split("#")[0]},w=function(e){if(!e)return"";var t=h(e),n=t.lastIndexOf(".");return -1!==n?t.slice(n+1).toLowerCase():""},O={aac:"audio/aac",avi:"video/x-msvideo",bmp:"image/bmp",csv:"text/csv",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",flv:"video/x-flv",gif:"image/gif",jpeg:"image/jpeg",jpg:"image/jpeg",json:"application/json",mkv:"video/x-matroska",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",odt:"application/vnd.oasis.opendocument.text",ogg:"audio/ogg",pdf:"application/pdf",png:"image/png",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",svg:"image/svg+xml",txt:"text/plain",wav:"audio/wav",webp:"image/webp",wmv:"video/x-ms-wmv",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};function x(e,t){return!!e&&(e.originFileObj?u()(e.type,t):e.mimetype?u()(e.mimetype,t):!!e.url&&u()(O[w(e.url)]||"",t))}var S=function(e){if(!e)return"";var t=h(e),n=t.lastIndexOf("/");return -1!==n?t.slice(n+1):t},j=function(e,t){if(e&&(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"){if(e.extname)return String(e.extname).replace(/^\./,"").toLowerCase();var n=w(e.name||e.filename||e.title);if(n)return n}return w(t)},E=function(e,t){var n=(null==e?void 0:e.mimetype)||(null==e?void 0:e.type);if("string"==typeof n&&v.has(n.toLowerCase()))return!0;var r=j(e,t);return b.has(r)},P=function(e,t){var n=S(t);return e&&"string"!=typeof e&&(e.name||e.filename||e.title)||n},k=function(e,t){var n=t||g(e),r=P(e,n),o=j(e,n);return r&&o&&!r.toLowerCase().endsWith(".".concat(o))&&(r="".concat(r,".").concat(o)),"".concat(Date.now(),"_").concat(r||"file")},C=function(e,t){return y[j(e,t)]||y.default},F=function(e){var t,n=d(e),r=m(n);if(E(n,r))return C(n,r);var o=(null!=(t=p.getTypeByFile(n))?t:{}).getThumbnailURL,i=null==o?void 0:o(n);return i||(x(n,"image/*")?"":C(n,r))},R=function(e){var t=e.index,n=e.list,r=e.onSwitchIndex,a=e.onDownload,u=e.file,c="number"==typeof t&&!!r&&t>0,s="number"==typeof t&&!!r&&t<n.length-1;return o().createElement(l.Space,{size:14,style:{fontSize:"20px"}},o().createElement(i.LeftOutlined,{style:{cursor:c?"pointer":"not-allowed"},disabled:!c,onClick:function(){return c&&(null==r?void 0:r(t-1))}}),o().createElement(i.RightOutlined,{style:{cursor:s?"pointer":"not-allowed"},disabled:!s,onClick:function(){return s&&(null==r?void 0:r(t+1))}}),o().createElement(i.DownloadOutlined,{onClick:function(){return a(u)}}))},T=function(e){return function(t){var n=t.open,r=t.onOpenChange,i=t.onClose,a=t.file;if("boolean"!=typeof n)return o().createElement(e,t);var u=P(a,g(a));return o().createElement(l.Modal,{open:n,title:u,onCancel:function(){null==r||r(!1),null==i||i()},footer:R(t),width:"90vw",centered:!0},o().createElement("div",{style:{maxWidth:"100%",maxHeight:"calc(100vh - 256px)",height:"80vh",width:"100%",background:"white",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",overflowY:"auto"}},o().createElement(e,t)))}},I=function(e){(0,c.useTranslation)().t;var t=e.file;return o().createElement(l.Alert,{type:"warning",description:o().createElement(c.Trans,{ns:s.C},"File type is not supported for previewing, please ",e.onDownload?o().createElement("a",{onClick:function(){var n;return null==(n=e.onDownload)?void 0:n.call(e,t)},style:{textDecoration:"underline",cursor:"pointer"}},"download it to preview"):o().createElement("span",null,"download it to preview")),showIcon:!0})};p.add({match:function(){return!0},Previewer:T(I)}),p.add({match:function(e){return x(e,"image/*")},getThumbnailURL:function(e){return m(e)},Previewer:function(e){var t=e.file,n=e.list,r=e.index,a=e.open,u=e.onOpenChange,c=e.onSwitchIndex,s=e.onClose,f=e.onDownload;if("boolean"!=typeof a)return null;var p=g(t);if(!p)return null;var d="number"==typeof r&&r>0,m="number"==typeof r&&r<n.length-1;return o().createElement(l.Image,{wrapperStyle:{display:"none"},preview:{visible:a,onVisibleChange:function(e){return null==u?void 0:u(e)},afterOpenChange:function(e){e||null==s||s()},toolbarRender:function(e,n){var a=n.transform.scale,u=n.actions,s=u.onFlipY,p=u.onFlipX,g=u.onRotateLeft,y=u.onRotateRight,v=u.onZoomOut,b=u.onZoomIn,h=u.onReset;return o().createElement(l.Space,{size:14,className:"toolbar-wrapper",style:{fontSize:"20px"}},o().createElement(i.LeftOutlined,{style:{cursor:d?"pointer":"not-allowed"},disabled:!d,onClick:function(){return d&&(null==c?void 0:c(r-1))}}),o().createElement(i.RightOutlined,{style:{cursor:m?"pointer":"not-allowed"},disabled:!m,onClick:function(){return m&&(null==c?void 0:c(r+1))}}),f?o().createElement(i.DownloadOutlined,{onClick:function(){return f(t)}}):null,o().createElement(i.SwapOutlined,{rotate:90,onClick:s}),o().createElement(i.SwapOutlined,{onClick:p}),o().createElement(i.RotateLeftOutlined,{onClick:g}),o().createElement(i.RotateRightOutlined,{onClick:y}),o().createElement(i.ZoomOutOutlined,{disabled:1===a,onClick:v}),o().createElement(i.ZoomInOutlined,{disabled:50===a,onClick:b}),o().createElement(i.UndoOutlined,{onClick:h}))}},src:p})}}),p.add({match:function(e){return["text/plain","application/pdf","application/json"].some(function(t){return x(e,t)})},Previewer:T(function(e){var t=g(e.file);return t?o().createElement("iframe",{src:t,width:"100%",height:"100%",style:{border:"none"}}):null})}),p.add({match:function(e){return x(e,"audio/*")},Previewer:T(function(e){var t=e.file,n=(0,c.useTranslation)().t,r=g(t);return r?o().createElement("audio",{controls:!0},o().createElement("source",{src:r,type:(null==t?void 0:t.type)||(null==t?void 0:t.mimetype)}),n("Your browser does not support the audio tag.")):null})}),p.add({match:function(e){return x(e,"video/*")},Previewer:T(function(e){var t=e.file,n=(0,c.useTranslation)().t,r=g(t);return r?o().createElement("video",{controls:!0,width:"100%",height:"100%"},o().createElement("source",{src:r,type:(null==t?void 0:t.type)||(null==t?void 0:t.mimetype)}),n("Your browser does not support the video tag.")):null})}),p.add({match:function(e){return E(e,g(e))},Previewer:T(I)});var q=function(e){var t,n,r,i=d(e.file);if(!i)return null;var l=(null!=(r=p.getTypeByFile(i))?r:{}).Previewer;return l?o().createElement(l,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){f(e,t,n[t])})}return e}({},e),n=n={file:i},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)):null}},564:function(e,t,n){"use strict";n.d(t,{KT:function(){return f},tp:function(){return m},OC:function(){return v},BL:function(){return u},om:function(){return d},mt:function(){return c},Sx:function(){return g},Lq:function(){return p},Lg:function(){return b}});var r=n(485),o=n(59),i=n(155),l=n.n(i),a=n(488);function u(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:"baseUrl",label:"".concat(e("Base URL")," :"),rules:[{required:!0,message:e("The field value is required")}],extra:e('Base URL for file access, could be your CDN base URL. For example: "https://cdn.nocobase.com".')},l().createElement(r.EnvVariableInput,null))}function c(e){var t=(0,a.k)();return l().createElement(o.Form.Item,{name:"default",valuePropName:"checked"},l().createElement(o.Checkbox,{disabled:e.disabled},t("Default storage")))}var s=n(624);function f(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:["rules","size"],label:"".concat(e("File size limit")," :"),rules:[{required:!0,message:e("The field value is required")}],extra:e("Minimum from 1 byte.")},l().createElement(r.FileSizeInput,{min:s.UW,max:s.Qj,defaultValue:s.ZH}))}function p(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:["rules","mimetype"],label:"".concat(e("File type allowed (in MIME type format)")," :"),extra:e('Multi-types seperated with comma, for example: "image/*", "image/png", "image/*, application/pdf" etc.')},l().createElement(o.Input,{placeholder:"*"}))}function d(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:"name",label:"".concat(e("Storage name")," :"),rules:[{required:!0,message:e("The field value is required")}],extra:e("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")},l().createElement(o.Input,null))}function m(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:"paranoid",valuePropName:"checked",extra:e("Files are only removed when their corresponding records in the file collection are deleted. If a record from another collection includes an associating field referencing the file collection, the file will not be deleted unless cascade deletion is enabled for that association.")},l().createElement(o.Checkbox,null,e("Keep file in storage when destroy the file record")))}function g(e){var t=(0,a.k)();return l().createElement(o.Form.Item,{name:"path",label:"".concat(t("Path")," :"),extra:t('Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes "/" will be ignored. For example: "user/avatar".')},l().createElement(r.EnvVariableInput,{addonBefore:e.addonBefore}))}var y=[{label:"Append random ID",value:"appendRandomID"},{label:"Random string",value:"random"},{label:"Keep original filename (will be overwrite if filename is existed)",value:"none"}];function v(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:"renameMode",label:"".concat(e("Renaming")," :"),extra:e("Renaming strategy to avoid filename conflicts when uploading files.")},l().createElement(o.Radio.Group,{options:y.map(function(t){var n,r;return n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},t),r=r={label:e(t.label)},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n})}))}function b(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:"title",label:"".concat(e("Title")," :"),rules:[{required:!0,message:e("The field value is required")}]},l().createElement(o.Input,null))}},488:function(e,t,n){"use strict";n.d(t,{k:function(){return i}});var r=n(694),o=n(301);function i(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ns:[o.C,"client"]},n))}}},624:function(e,t,n){"use strict";n.d(t,{Qj:function(){return o},UW:function(){return r},ZF:function(){return l},ZH:function(){return i},a_:function(){return c},e7:function(){return u},y2:function(){return a}});var r=1,o=1/0,i=0x1400000,l="local",a="ali-oss",u="s3",c="tx-cos"},301:function(e,t,n){"use strict";n.d(t,{C:function(){return r}});var r="file-manager"},375:function(e){"use strict";e.exports=r},477:function(e){"use strict";e.exports=t},230:function(e){"use strict";e.exports=n},485:function(e){"use strict";e.exports=l},694:function(e){"use strict";e.exports=o},625:function(e){"use strict";e.exports=i},59:function(e){"use strict";e.exports=u},773:function(e){"use strict";e.exports=c},155:function(e){"use strict";e.exports=a},953:function(t){"use strict";t.exports=e}},m={};function g(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return d[e](n,n.exports,g),n.exports}g.m=d,g.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return g.d(t,{a:t}),t},g.d=function(e,t){for(var n in t)g.o(t,n)&&!g.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},g.f={},g.e=function(e){return Promise.all(Object.keys(g.f).reduce(function(t,n){return g.f[n](e,t),t},[]))},g.u=function(e){return""+e+"."+({125:"01d5562df948d974",229:"bd72c2d7aa088310",336:"1dd1b32466d0c778",43:"eb45d53ba3e9828b",450:"f590b4c220108742",929:"d7e783304cc1f236",942:"9dc2d49980a4dd9e"})[e]+".js"},g.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),g.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},y={},g.l=function(e,t,n,r){if(y[e])return void y[e].push(t);if(void 0!==n)for(var o,i,l=document.getElementsByTagName("script"),a=0;a<l.length;a++){var u=l[a];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-file-manager/client-v2:"+n){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,g.nc&&o.setAttribute("nonce",g.nc),o.setAttribute("data-rspack","@nocobase/plugin-file-manager/client-v2:"+n),o.src=e),y[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=y[e];if(delete y[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},g.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},g.g.importScripts&&(v=g.g.location+"");var y,v,b=g.g.document;if(!v&&b&&(b.currentScript&&"SCRIPT"===b.currentScript.tagName.toUpperCase()&&(v=b.currentScript.src),!v)){var h=b.getElementsByTagName("script");if(h.length)for(var w=h.length-1;w>-1&&(!v||!/^http(s?):/.test(v));)v=h[w--].src}if(!v)throw Error("Automatic publicPath is not supported in this browser");g.p=v.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s={889:0},g.f.j=function(e,t){var n=g.o(s,e)?s[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=s[e]=[t,r]});t.push(n[2]=r);var o=g.p+g.u(e),i=Error();g.l(o,function(t){if(g.o(s,e)&&(0!==(n=s[e])&&(s[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},f=function(e,t){var n,r,o=t[0],i=t[1],l=t[2],a=0;if(o.some(function(e){return 0!==s[e]})){for(n in i)g.o(i,n)&&(g.m[n]=i[n]);l&&l(g)}for(e&&e(t);a<o.length;a++)r=o[a],g.o(s,r)&&s[r]&&s[r][0](),s[r]=0},(p=self.webpackChunk_nocobase_plugin_file_manager_client_v2=self.webpackChunk_nocobase_plugin_file_manager_client_v2||[]).forEach(f.bind(null,0)),p.push=f.bind(null,p.push.bind(p));var O={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-file-manager/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");e=o>=0?r.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-file-manager/dist/client-v2/"}g.p=e}(),!function(){"use strict";g.r(O),g.d(O,{BaseUrlField:function(){return t.BL},CardUpload:function(){return n.CardUpload},DefaultField:function(){return t.mt},FileSizeField:function(){return t.KT},MimetypeField:function(){return t.Lq},NameField:function(){return t.om},ParanoidField:function(){return t.tp},PathField:function(){return t.Sx},PluginFileManagerClientV2:function(){return e.A},RenameModeField:function(){return t.OC},TitleField:function(){return t.Lg},UploadFieldModel:function(){return n.UploadFieldModel},default:function(){return e.A}});var e=g(124),t=g(564),n=g(76)}(),O}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@emotion/css"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-manager/client-v2",["react-i18next","@emotion/css","@formily/react","@ant-design/icons","@nocobase/flow-engine","ahooks","@nocobase/client-v2","react","antd","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-file-manager/client-v2"]=t(require("react-i18next"),require("@emotion/css"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("lodash")):e["@nocobase/plugin-file-manager/client-v2"]=t(e["react-i18next"],e["@emotion/css"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e.ahooks,e["@nocobase/client-v2"],e.react,e.antd,e.lodash)}(self,function(e,t,n,r,o,i,l,a,u,c){return function(){var s,f,p,d={484:function(e,t,n){var r=n(986),o=/[\/\+\.]/;e.exports=function(e,t){function n(t){var n=r(t,e,o);return n&&n.length>=2}return t?n(t.split(";")[0]):n}},986:function(e){"use strict";function t(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}t.prototype.match=function(e){var t,n,r=!0,o=this.parts,i=o.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(t=0,n=(e||"").split(this.separator);r&&t<i;t++)if("*"===o[t])continue;else r=t<n.length&&o[t]===n[t];r=r&&n}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var l in r={},e)this.match(l)&&(r[l]=e[l]);return r},e.exports=function(e,n,r){var o=new t(e,r||/[\/\.]/);return void 0!==n?o.match(n):o}},613:function(e,t,n){"use strict";e.exports=n.p+"867ada653cd02a3e.mjs"},76:function(e,t,n){"use strict";n.r(t),n.d(t,{UploadFieldModel:function(){return _},CardUpload:function(){return M}});var r=n(375),o=n(477),i=n(59),l=n(773),a=n(953),u=n(694),c=n(155),s=n.n(c),f=n(230),p=n(485),d=n(23);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var y=function(e,t){var n,r,o,i,l=null==e?void 0:e.response,a=null!=(n=null==e?void 0:e.id)?n:null==l?void 0:l.id,u=null!=(r=null==e?void 0:e.url)?r:null==l?void 0:l.url,c=null!=(o=null==e?void 0:e.filename)?o:null==l?void 0:l.filename,s=null!=(i=null==e?void 0:e.name)?i:null==l?void 0:l.name;return null!=a?"id:".concat(String(a)):null!=u?"url:".concat(u):null!=c?"filename:".concat(c,":").concat(t):null!=s?"name:".concat(s,":").concat(t):(null==e?void 0:e.uid)?"uid:".concat(e.uid):"index:".concat(t)},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map(t.map(function(e,t){return[y(e,t),e.uid]}).filter(function(e){return!!(function(e){if(Array.isArray(e))return e}(e)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return m(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1]}));return e.map(function(e,t){var r,o,i,l=y(e,t);return r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),o=o={uid:e.uid||n.get(l)||l,thumbUrl:null!=(i=e.thumbUrl)?i:(0,d.qk)(e)},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r})},h=function(e,t){var n=e.findIndex(function(e){return e.uid===(null==t?void 0:t.uid)});return n>=0?n:0};function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t,n,r,o,i,l){try{var a=e[i](l),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){v(i,r,o,l,a,"next",e)}function a(e){v(i,r,o,l,a,"throw",e)}l(void 0)})}}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t,n){return(x="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=S(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){O(e,t,n[t])})}return e}function P(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||C(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||C(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(R=function(){return!!e})()}function T(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:u(0)}),a(l,"throw",{value:u(1)}),a(l,"return",{value:u(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function u(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function I(){var e,t,n=(e=["\n .ant-upload-list-picture-card {\n margin-bottom: 10px;\n .ant-upload-list-item-container {\n margin: ",";\n }\n }\n .ant-upload-select {\n margin: ",";\n }\n ","\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return I=function(){return n},n}var M=function(e){var t,n=e.allowSelectExistingRecord,u=e.multiple,p=e.value,m=e.disabled,y=e.onSelectExitRecordClick,b=e.quickUpload,v=e.showFileName,O=k((0,c.useState)(function(){return g((0,l.castArray)(p||[]))}),2),x=O[0],S=O[1],E=k((0,c.useState)(!1),2),F=E[0],C=E[1],R=k((0,c.useState)(null),2),M=R[0],_=R[1],D=k((0,c.useState)(0),2),A=D[0],U=D[1],q=(0,a.useTranslation)().t;(0,c.useLayoutEffect)(function(){S(function(e){return g((0,l.castArray)(p||[]),e)})},[p]);var L=(t=x.length,!!u||0===t);return s().createElement(f.FieldContext.Provider,{value:{value:x}},s().createElement("div",{style:{display:"flex"},className:(0,o.css)(I(),v?"8px 0px":"0px",v?"8px 0px":"0px",u?"":"\n .ant-upload-list-item-container.ant-upload-animate-inline-appear,\n .ant-upload-list-item-container.ant-upload-animate-inline-appear-active,\n .ant-upload-list-item-container.ant-upload-animate-inline-enter,\n .ant-upload-list-item-container.ant-upload-animate-inline-enter-active {\n animation: none !important;\n transition: none !important;\n transform: none !important;\n opacity: 1 !important;\n }\n\n .ant-upload.ant-upload-animate-inline-leave,\n .ant-upload.ant-upload-animate-inline-leave-active {\n animation: none !important;\n transition: none !important;\n }\n ")},s().createElement(i.Upload,P(j({onPreview:function(e){return w(function(){var t;return T(this,function(n){switch(n.label){case 0:var r;if(t=h(x,e),!(!e.url&&!e.preview))return[3,2];return[4,(r=e.originFileObj,new Promise(function(e,t){var n=new FileReader;n.readAsDataURL(r),n.onload=function(){return e(n.result)},n.onerror=function(e){return t(e)}}))];case 1:e.preview=n.sent(),n.label=2;case 2:return _(e),U(t),C(!0),[2]}})})()}},e),{listType:"picture-card",fileList:x,onChange:function(t){var n=t.fileList;S(function(e){return g(n,e)});var r=n.filter(function(e){return"done"===e.status||e.id});if(n.every(function(e){return"done"===e.status||e.id}))if(1===e.maxCount){var o=r[0];e.onChange(o?o.response:null)}else e.onChange(r.map(function(e){return e.response||e}).filter(Boolean))},itemRender:function(e,t){return s().createElement(s().Fragment,null,e,v&&s().createElement("div",{style:{fontSize:12,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},title:t.filename},t.filename))}}),(void 0===b||b)&&L?s().createElement(r.UploadOutlined,{style:{fontSize:20}}):null),M&&s().createElement(d.Mo,{open:F,file:M,list:x,index:A,onOpenChange:C,onClose:function(){return _(null)},onSwitchIndex:function(e){e<0||e>=x.length||(U(e),_(x[e]))},onDownload:function(e){var t=e||M;if(t){var n=t.url||t.preview;if(n){var r=(0,d.ub)(t,n);fetch(n).then(function(e){return e.blob()}).then(function(e){var t=URL.createObjectURL(new Blob([e])),n=document.createElement("a");n.href=t,n.download=r,document.body.appendChild(n),n.click(),URL.revokeObjectURL(t),n.remove()})}}}}),n&&L?s().createElement("div",{style:{marginLeft:5}},s().createElement(i.Upload,{disabled:m,multiple:u,listType:"picture-card",showUploadList:!1},s().createElement("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},onClick:function(e){m||(e.stopPropagation(),e.preventDefault(),y())}},s().createElement(r.PlusOutlined,null),q("Select")))):null))},_=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=S(t),O(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,R()?Reflect.construct(t,r||[],S(this).constructor):t.apply(this,r)),"selectedRows",u.observable.ref([])),O(e,"_closeView",void 0),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&E(n,e),t=[{key:"customRequest",set:function(e){this.setProps({customRequest:e})}},{key:"onInit",value:function(e){var t=this;x(S(n.prototype),"onInit",this).call(this,e),this.onSelectExitRecordClick=function(e){t.dispatchEvent("openView",{event:e})}}},{key:"onSelectExitRecordClick",set:function(e){this.setProps({onSelectExitRecordClick:e})}},{key:"change",value:function(){this.props.onChange(this.selectedRows.value)}},{key:"render",value:function(){return s().createElement(M,this.props)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(p.FieldModel);(_=function(e,t,n,r){var o,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i<3?o(l):i>3?o(t,n,l):o(t,n))||l);return i>3&&l&&Object.defineProperty(t,n,l),l}([(0,u.largeField)()],_)).registerFlow({key:"uploadSettings",title:(0,u.tExpr)("Upload file settings"),steps:{quickUpload:{title:(0,u.tExpr)("Quick upload"),uiMode:{type:"switch",key:"quickUpload"},hideInSettings:function(e){return!e.collectionField.isAssociationField()||!e.collectionField.targetCollection},defaultParams:function(e){return{quickUpload:!0}},handler:function(e,t){e.model.setProps({quickUpload:t.quickUpload})}},allowMultiple:{title:(0,u.tExpr)("Allow multiple"),uiMode:{type:"switch",key:"multiple"},hideInSettings:function(e){return!e.collectionField||!["belongsToMany","hasMany","belongsToArray"].includes(e.collectionField.type)},defaultParams:function(e){return{multiple:e.collectionField&&["belongsToMany","hasMany","belongsToArray"].includes(e.model.context.collectionField.type)}},handler:function(e,t){e.model.setProps({multiple:null==t?void 0:t.multiple,maxCount:(null==t?void 0:t.multiple)?null:1})}},showFileName:{title:(0,u.tExpr)("Show file name"),uiMode:{type:"switch",key:"showFileName"},defaultParams:{showFileName:!1},handler:function(e,t){e.model.setProps("showFileName",t.showFileName)}},allowSelectExistingRecord:{title:(0,u.tExpr)("Allow selection of existing file"),uiMode:{type:"switch",key:"allowSelectExistingRecord"},hideInSettings:function(e){return!e.collectionField.isAssociationField()||!e.collectionField.targetCollection},defaultParams:function(e){return{allowSelectExistingRecord:e.collectionField.targetCollection&&e.collectionField.isAssociationField()}},handler:function(e,t){e.model.setProps({allowSelectExistingRecord:t.allowSelectExistingRecord})}}}}),_.registerFlow({key:"eventSettings",sort:300,steps:{bindEvent:{handler:function(e,t){e.model.customRequest=function(t){e.model.dispatchEvent("customRequest",{apiClient:e.app.apiClient,fileData:t})}}}}}),_.registerFlow({key:"customRequestSettings",on:"customRequest",steps:{step1:{handler:function(e,t){return w(function(){var t,n,r,o,i,l,a,u,c,s,f,p,d,m,y,g,h,b,v,w,O,x,S,E,k,F,C,R;return T(this,function(T){switch(T.label){case 0:if(n=(t=e.inputArgs.fileData).file,r=t.onSuccess,o=t.onError,i=t.onProgress,l=e.app.pm.get("@nocobase/plugin-file-manager"),a=e.model.props.target,u=e.collectionField,!l)return[2,r(n)];T.label=1;case 1:return T.trys.push([1,6,,7]),[4,e.api.resource("storages").check({fileCollectionName:a,storageName:u.options.storage})];case 2:if(!(null==(v=T.sent().data)||null==(c=v.data)?void 0:c.isSupportToUploadFiles))return O=e.t('The current storage "{{storageName}}" does not support file uploads.',{storageName:null==(w=v.data.storage)?void 0:w.title}).replaceAll("&gt;",">"),null==o||o(Error(O)),[2];if(x=l.getStorageType(null==v||null==(f=v.data)||null==(s=f.storage)?void 0:s.type)||{},S=null==v||null==(p=v.data)?void 0:p.storage,!x.createUploadCustomRequest||"function"!=typeof(E=x.createUploadCustomRequest(P(j({},e.model.props),{api:e.api,action:"".concat(a,":create?attachmentField=").concat(u.collectionName,".").concat(u.name),storage:S}))))return[3,4];return[4,E({file:n,onProgress:i,onSuccess:r,onError:o})];case 3:return T.sent(),[2];case 4:return[4,l.uploadFile({file:n,fileCollectionName:a,storageId:null==v||null==(m=v.data)||null==(d=m.storage)?void 0:d.id,storageType:null==v||null==(g=v.data)||null==(y=g.storage)?void 0:y.type,storageRules:null==v||null==(b=v.data)||null==(h=b.storage)?void 0:h.rules,onProgress:function(e){null==i||i({percent:e})},query:{attachmentField:"".concat(u.collectionName,".").concat(u.name)}})];case 5:if(F=(k=T.sent()).data,C=k.errorMessage)return null==o||o(Error(C)),[2];if(!F)return null==o||o(Error("上传成功但响应数据为空")),[2];return r(F),[3,7];case 6:return R=T.sent(),null==o||o(R),[3,7];case 7:return[2]}})})()}}}}),_.registerFlow({key:"selectExitRecordSettings",title:(0,u.tExpr)("Selector setting"),on:{eventName:"openView"},steps:{openView:{title:(0,u.tExpr)("Edit popup"),hideInSettings:function(e){var t,n,r;return!1===(null==(n=(r=e.model).getStepParams)||null==(t=n.call(r,"uploadSettings","allowSelectExistingRecord"))?void 0:t.allowSelectExistingRecord)},uiSchema:function(e){return{mode:{type:"string",title:(0,u.tExpr)("Open mode"),enum:[{label:(0,u.tExpr)("Drawer"),value:"drawer"},{label:(0,u.tExpr)("Dialog"),value:"dialog"}],"x-decorator":"FormItem","x-component":"Radio.Group"},size:{type:"string",title:(0,u.tExpr)("Popup size"),enum:[{label:(0,u.tExpr)("Small"),value:"small"},{label:(0,u.tExpr)("Medium"),value:"medium"},{label:(0,u.tExpr)("Large"),value:"large"}],"x-decorator":"FormItem","x-component":"Radio.Group"}}},defaultParams:{mode:"drawer",size:"medium"},handler:function(e,t){var n,r,o,i,l,a=["belongsTo","hasOne"].includes(e.collectionField.type),u=e.isMobileLayout?"embed":e.inputArgs.mode||t.mode||"drawer",c=e.inputArgs.size||t.size||"medium",f=(null==(n=e.model.props)?void 0:n.sourceFieldModelUid)||e.model.uid,d=(null==(r=e.model.parent)?void 0:r.use)==="QuickEditFormModel"?null==(o=e.model.parent)?void 0:o.viewContainer:null;null==d||null==(i=d.update)||i.call(d,{preventClose:!0}),e.viewer.open({type:u,width:{drawer:{small:"30%",medium:"50%",large:"70%"},dialog:{small:"40%",medium:"50%",large:"80%"},embed:{}}[u][c],inheritContext:!1,target:e.layoutContentElement,onClose:function(){setTimeout(function(){var e;null==d||null==(e=d.update)||e.call(d,{preventClose:!1})},0)},inputArgs:{parentId:f,scene:"select",dataSourceKey:e.collection.dataSourceKey,collectionName:null==(l=e.collectionField)?void 0:l.target,collectionField:e.collectionField,rowSelectionProps:{type:a?"radio":"checkbox",defaultSelectedRows:function(){return e.model.props.value},renderCell:void 0,selectedRowKeys:void 0,onChange:function(t,n){if(a){var r,o;e.model.selectedRows.value=null==n?void 0:n[0],e.model.change(),null==(r=(o=e.model)._closeView)||r.call(o)}else{var i=F(e.model.props.value||[]).concat(F(n)).filter(function(t,n,r){return n===r.findIndex(function(n){return n[e.collection.filterTargetKey]===t[e.collection.filterTargetKey]})});e.model.selectedRows.value=i}}}},content:function(){return s().createElement(p.RecordPickerContent,{model:e.model})},styles:{content:j({padding:0,backgroundColor:e.model.flowEngine.context.themeToken.colorBgLayout},"embed"===u?{position:"absolute",top:0,left:0,right:0,bottom:0}:{}),body:{padding:0}}})}}}}),_.define({label:(0,u.tExpr)("File picker")}),u.EditableItemModel.bindModelToInterface("UploadFieldModel",["attachment","m2m","m2o","o2o","o2m","oho","obo","updatedBy","createdBy","mbm"],{isDefault:!0,order:30,when:function(e,t){return!t.targetCollection||"file"===t.targetCollection.template}})},667:function(e,t,n){"use strict";n.d(t,{S:function(){return v}});var r=n(485),o=n(624),i=n(358),l=n(488);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n,r,o,i,l){try{var a=e[i](l),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){u(i,r,o,l,a,"next",e)}function a(e){u(i,r,o,l,a,"throw",e)}l(void 0)})}}function s(e,t,n){return(s=h()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&y(o,n.prototype),o}).apply(null,arguments)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){f(e,t,n[t])})}return e}function m(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t="function"==typeof Map?new Map:void 0;return(g=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return s(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)})(e)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function b(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:u(0)}),a(l,"throw",{value:u(1)}),a(l,"return",{value:u(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function u(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var v=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=p(t),f(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,h()?Reflect.construct(t,n||[],p(this).constructor):t.apply(this,n)),"storageTypes",new Map),e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&y(r,e),t=[{key:"load",value:function(){return c(function(){var e,t,r;return b(this,function(o){return t=this.app.i18n.t("File manager",{ns:i.C}),null==(r=this.app.pm.get("@nocobase/plugin-data-source-manager")||this.app.pm.get("data-source-manager"))||null==(e=r.registerCollectionTemplate)||e.call(r,{name:"file",title:(0,l.M)("File collection"),order:25,color:"blue",collection:{options:{template:"file",createdBy:!0,updatedBy:!0},fields:[{name:"title",interface:"input",type:"string",title:(0,l.M)("Title"),deletable:!1},{name:"filename",interface:"input",type:"string",title:(0,l.M)("File name"),deletable:!1,uiSchema:{"x-read-pretty":!0}},{name:"extname",interface:"input",type:"string",title:(0,l.M)("Extension name"),deletable:!1,uiSchema:{"x-read-pretty":!0}},{name:"size",interface:"integer",type:"integer",title:(0,l.M)("Size"),deletable:!1,componentProps:{stringMode:!0,step:"0"},uiSchema:{"x-read-pretty":!0}},{name:"mimetype",interface:"input",type:"string",title:(0,l.M)("MIME type"),deletable:!1,uiSchema:{"x-read-pretty":!0}},{name:"path",interface:"textarea",type:"text",title:(0,l.M)("Path"),deletable:!1,component:"TextAreaWithGlobalScope",uiSchema:{"x-read-pretty":!0}},{name:"url",interface:"url",type:"text",title:(0,l.M)("URL"),deletable:!1,uiSchema:{"x-read-pretty":!0}},{name:"preview",interface:"url",type:"text",title:(0,l.M)("Preview"),field:"url",deletable:!1,component:"Preview",uiSchema:{"x-read-pretty":!0}},{name:"storage",interface:"m2o",type:"belongsTo",title:(0,l.M)("Storage"),target:"storages",foreignKey:"storageId",deletable:!1,componentProps:{fieldNames:{value:"id",label:"title"}},uiSchema:{type:"object","x-read-pretty":!0}},{name:"meta",interface:"json",type:"jsonb",defaultValue:{},deletable:!1}]},presetFields:{disabled:!0}}),this.pluginSettingsManager.addMenuItem({key:i.C,title:t,icon:"FileOutlined",aclSnippet:"pm.file-manager.storages"}),this.pluginSettingsManager.addPageTabItem({menuKey:i.C,key:"index",title:t,componentLoader:function(){return n.e("942").then(n.bind(n,837))}}),this.registerBuiltInStorageTypes(),this.flowEngine.registerModelLoaders({DisplayPreviewFieldModel:{loader:function(){return n.e("125").then(n.bind(n,212))}},UploadActionModel:{loader:function(){return n.e("450").then(n.bind(n,177))}},UploadFieldModel:{loader:function(){return Promise.resolve().then(n.bind(n,76))}}}),[2]})}).call(this)}},{key:"registerStorageType",value:function(e,t){this.storageTypes.set(e,m(d({},t),{name:e}))}},{key:"getStorageType",value:function(e){return e?this.storageTypes.get(e):void 0}},{key:"registerBuiltInStorageTypes",value:function(){var e={renameMode:"appendRandomID",rules:{size:o.ZH}};this.registerStorageType(o.ZF,{title:"Local storage",formLoader:function(){return n.e("929").then(n.bind(n,864))},defaultValues:m(d({},e),{baseUrl:"/storage/uploads",options:{documentRoot:"storage/uploads"}})}),this.registerStorageType(o.y2,{title:"Aliyun OSS",formLoader:function(){return n.e("43").then(n.bind(n,574))},defaultValues:m(d({},e),{options:{timeout:6e5},settings:{requestOptions:{}}})}),this.registerStorageType(o.e7,{title:"Amazon S3",formLoader:function(){return n.e("336").then(n.bind(n,595))},defaultValues:e}),this.registerStorageType(o.a_,{title:"Tencent COS",formLoader:function(){return n.e("229").then(n.bind(n,316))},defaultValues:e})}},{key:"uploadFile",value:function(e){return c(function(){var t,n,r,o,i,l,u,c,s,f,p,d,m;return b(this,function(y){switch(y.label){case 0:if(!(null==e?void 0:e.file))return[2,{errorMessage:"Missing file"}];if(t=e.file,n=e.storageType,r=e.storageId,o=e.storageRules,l=void 0===(i=e.query)?{}:i,u=e.fileCollectionName||"attachments",!(null==(c=this.getStorageType(n))?void 0:c.upload))return[3,2];return[4,c.upload({file:t,apiClient:this.app.apiClient,storageType:n,storageId:r,storageRules:o,fileCollectionName:u,query:l})];case 1:return[2,y.sent()];case 2:return y.trys.push([2,4,,5]),(f=new FormData).append("file",t),d=(p=new URLSearchParams(Object.entries(l).map(function(e){var t=function(e){if(Array.isArray(e))return e}(e)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return a(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return[t[0],String(t[1])]})).toString())?"".concat(u,":create?").concat(p):"".concat(u,":create"),[4,this.app.apiClient.request({url:d,method:"post",data:f})];case 3:return[2,{data:null==(s=y.sent().data)?void 0:s.data}];case 4:var g,h;return[2,{errorMessage:(g=m=y.sent(),null!=(h=Error)&&"u">typeof Symbol&&h[Symbol.hasInstance]?!!h[Symbol.hasInstance](g):g instanceof h)?m.message:"Upload failed"}];case 5:return[2]}})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}(g(r.Plugin));f(v,"buildInStorage",[o.ZF,o.y2,o.e7,o.a_]),t.A=v},23:function(e,t,n){"use strict";n.d(t,{LD:function(){return $},Mo:function(){return Q},WP:function(){return N},_H:function(){return E},_Y:function(){return z},e$:function(){return P},q:function(){return k},qk:function(){return V},ub:function(){return B}});var r=n(155),o=n.n(r),i=n(375),l=n(59),a=n(484),u=n.n(a),c=n(953),s=n(358);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t,n,r,o,i,l){try{var a=e[i](l),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){p(i,r,o,l,a,"next",e)}function a(e){p(i,r,o,l,a,"throw",e)}l(void 0)})}}function m(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function y(e,t,n){return(y=x()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&b(o,n.prototype),o}).apply(null,arguments)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function O(e){var t="function"==typeof Map?new Map:void 0;return(O=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return y(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),b(n,e)})(e)}function x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(x=function(){return!!e})()}function S(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:u(0)}),a(l,"throw",{value:u(1)}),a(l,"return",{value:u(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function u(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var j="u">typeof window&&window.__nocobase_public_path__||"/",P=new(function(){var e;function t(){m(this,t),g(this,"types",[])}return e=[{key:"add",value:function(e){this.types.unshift(e)}},{key:"getTypeByFile",value:function(e){var t=E(e);return this.types.find(function(e){return e.match(t)})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}());function E(e){return e&&"string"==typeof e?{url:e}:e}function k(e){return e?"string"==typeof e?e:e.preview||e.url||"":""}function F(e){return e?"string"==typeof e?e:e.url||e.preview||"":""}var C={pdf:"/file-placeholder/pdf-200-200.png",mp4:"/file-placeholder/video-200-200.png",mov:"/file-placeholder/video-200-200.png",avi:"/file-placeholder/video-200-200.png",wmv:"/file-placeholder/video-200-200.png",flv:"/file-placeholder/video-200-200.png",mkv:"/file-placeholder/video-200-200.png",mp3:"/file-placeholder/audio-200-200.png",wav:"/file-placeholder/audio-200-200.png",aac:"/file-placeholder/audio-200-200.png",ogg:"/file-placeholder/audio-200-200.png",doc:"/file-placeholder/docx-200-200.png",docx:"/file-placeholder/docx-200-200.png",odt:"/file-placeholder/docx-200-200.png",xls:"/file-placeholder/xlsx-200-200.png",xlsx:"/file-placeholder/xlsx-200-200.png",csv:"/file-placeholder/xlsx-200-200.png",ppt:"/file-placeholder/pptx-200-200.png",pptx:"/file-placeholder/pptx-200-200.png",jpg:"/file-placeholder/jpeg-200-200.png",jpeg:"/file-placeholder/jpeg-200-200.png",png:"/file-placeholder/png-200-200.png",gif:"/file-placeholder/gif-200-200.png",webp:"/file-placeholder/png-200-200.png",bmp:"/file-placeholder/png-200-200.png",svg:"/file-placeholder/svg-200-200.png",default:"/file-placeholder/unknown-200-200.png"},R=new Set(["application/pdf","application/xhtml+xml","image/svg+xml","text/html"]),T=new Set(["htm","html","pdf","svg","svgz","xhtml"]),I=function(e){return e.split("?")[0].split("#")[0]},M=function(e){if(!e)return"";var t=I(e),n=t.lastIndexOf(".");return -1!==n?t.slice(n+1).toLowerCase():""},_={aac:"audio/aac",avi:"video/x-msvideo",bmp:"image/bmp",csv:"text/csv",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",flv:"video/x-flv",gif:"image/gif",jpeg:"image/jpeg",jpg:"image/jpeg",json:"application/json",mkv:"video/x-matroska",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",odt:"application/vnd.oasis.opendocument.text",ogg:"audio/ogg",pdf:"application/pdf",png:"image/png",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",svg:"image/svg+xml",txt:"text/plain",wav:"audio/wav",webp:"image/webp",wmv:"video/x-ms-wmv",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};function D(e,t){return!!e&&(e.originFileObj?u()(e.type,t):e.mimetype?u()(e.mimetype,t):!!e.url&&u()(_[M(e.url)]||"",t))}var A=function(e){if(!e)return"";var t=I(e),n=t.lastIndexOf("/"),r=-1!==n?t.slice(n+1):t;try{return decodeURIComponent(r)}catch(e){return r}},U=function(e,t){if(e&&(void 0===e?"undefined":w(e))==="object"){if(e.extname)return String(e.extname).replace(/^\./,"").toLowerCase();var n=M(e.name||e.filename||e.title);if(n)return n}return M(t)},q=function(e,t){var n=(null==e?void 0:e.mimetype)||(null==e?void 0:e.type);if("string"==typeof n&&R.has(n.toLowerCase()))return!0;var r=U(e,t);return T.has(r)},L=function(e,t){var n=(null==e?void 0:e.mimetype)||(null==e?void 0:e.type);return"string"==typeof n&&"application/pdf"===n.toLowerCase()||"pdf"===U(e,t)},N=function(e,t){var n=A(t||F(e));return e&&"string"!=typeof e&&(e.name||e.filename||e.title)||n},B=function(e,t){var n=t||F(e),r=N(e,n),o=U(e,n);return r&&o&&!r.toLowerCase().endsWith(".".concat(o))&&(r="".concat(r,".").concat(o)),"".concat(Date.now(),"_").concat(r||"file")},z=function(e,t){var n;return n=C[U(e,t)]||C.default,"".concat(j.replace(/\/$/,""),"/").concat(n.replace(/^\//,""))},V=function(e){var t,n=E(e),r=k(n);if(q(n,r))return z(n,r);var o=(null!=(t=P.getTypeByFile(n))?t:{}).getThumbnailURL,i=null==o?void 0:o(n);return i||(D(n,"image/*")?"":z(n,r))},W=function(e){var t=e.index,n=e.list,r=e.onSwitchIndex,a=e.onDownload,u=e.file,c="number"==typeof t&&!!r&&t>0,s="number"==typeof t&&!!r&&t<n.length-1;return o().createElement(l.Space,{size:14,style:{fontSize:"20px"}},o().createElement(i.LeftOutlined,{style:{cursor:c?"pointer":"not-allowed"},disabled:!c,onClick:function(){return c&&(null==r?void 0:r(t-1))}}),o().createElement(i.RightOutlined,{style:{cursor:s?"pointer":"not-allowed"},disabled:!s,onClick:function(){return s&&(null==r?void 0:r(t+1))}}),o().createElement(i.DownloadOutlined,{onClick:function(){return a(u)}}))},$=function(e){return function(t){var n=t.open,r=t.onOpenChange,i=t.onClose,a=t.file;if("boolean"!=typeof n)return o().createElement(e,t);var u=N(a,F(a));return o().createElement(l.Modal,{open:n,title:u,onCancel:function(){null==r||r(!1),null==i||i()},footer:W(t),width:"90vw",centered:!0},o().createElement("div",{style:{maxWidth:"100%",maxHeight:"calc(100vh - 256px)",height:"80vh",width:"100%",background:"white",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",overflowY:"auto"}},o().createElement(e,t)))}},K=null,Z=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(e,n,r){var o,i,l;return m(this,t),i=t,l=[n],i=h(i),g(o=function(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,x()?Reflect.construct(i,l||[],h(this).constructor):i.apply(this,l)),"code",void 0),g(o,"cause",void 0),o.name="PdfPreviewError",o.code=e,o.cause=r,o}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e),t}(O(Error)),G=function(e){return(null!=Z&&"u">typeof Symbol&&Z[Symbol.hasInstance]?!!Z[Symbol.hasInstance](e):e instanceof Z)?e.code:"document"},H={resources:"PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.",file:"PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.",document:"PDF preview failed. Please download the file to preview it."},Y=function(e){var t=e.file;return o().createElement(l.Alert,{type:"warning",description:o().createElement(c.Trans,{ns:s.C},"File type is not supported for previewing, please ",e.onDownload?o().createElement("a",{onClick:function(){var n;return null==(n=e.onDownload)?void 0:n.call(e,t)},style:{textDecoration:"underline",cursor:"pointer"}},"download it to preview"):o().createElement("span",null,"download it to preview")),showIcon:!0})};P.add({match:function(){return!0},Previewer:$(Y)}),P.add({match:function(e){return D(e,"image/*")},getThumbnailURL:function(e){return k(e)},Previewer:function(e){var t=e.file,n=e.list,r=e.index,a=e.open,u=e.onOpenChange,c=e.onSwitchIndex,s=e.onClose,f=e.onDownload;if("boolean"!=typeof a)return null;var p=F(t);if(!p)return null;var d="number"==typeof r&&r>0,m="number"==typeof r&&r<n.length-1;return o().createElement(l.Image,{wrapperStyle:{display:"none"},preview:{visible:a,onVisibleChange:function(e){return null==u?void 0:u(e)},afterOpenChange:function(e){e||null==s||s()},toolbarRender:function(e,n){var a=n.transform.scale,u=n.actions,s=u.onFlipY,p=u.onFlipX,y=u.onRotateLeft,g=u.onRotateRight,h=u.onZoomOut,b=u.onZoomIn,v=u.onReset;return o().createElement(l.Space,{size:14,className:"toolbar-wrapper",style:{fontSize:"20px"}},o().createElement(i.LeftOutlined,{style:{cursor:d?"pointer":"not-allowed"},disabled:!d,onClick:function(){return d&&(null==c?void 0:c(r-1))}}),o().createElement(i.RightOutlined,{style:{cursor:m?"pointer":"not-allowed"},disabled:!m,onClick:function(){return m&&(null==c?void 0:c(r+1))}}),f?o().createElement(i.DownloadOutlined,{onClick:function(){return f(t)}}):null,o().createElement(i.SwapOutlined,{rotate:90,onClick:s}),o().createElement(i.SwapOutlined,{onClick:p}),o().createElement(i.RotateLeftOutlined,{onClick:y}),o().createElement(i.RotateRightOutlined,{onClick:g}),o().createElement(i.ZoomOutOutlined,{disabled:1===a,onClick:h}),o().createElement(i.ZoomInOutlined,{disabled:50===a,onClick:b}),o().createElement(i.UndoOutlined,{onClick:v}))}},src:p})}}),P.add({match:function(e){return["text/plain","application/json"].some(function(t){return D(e,t)})},Previewer:$(function(e){var t=F(e.file);return t?o().createElement("iframe",{src:t,width:"100%",height:"100%",style:{border:"none"}}):null})}),P.add({match:function(e){return D(e,"audio/*")},Previewer:$(function(e){var t=e.file,n=(0,c.useTranslation)().t,r=F(t);return r?o().createElement("audio",{controls:!0},o().createElement("source",{src:r,type:(null==t?void 0:t.type)||(null==t?void 0:t.mimetype)}),n("Your browser does not support the audio tag.")):null})}),P.add({match:function(e){return D(e,"video/*")},Previewer:$(function(e){var t=e.file,n=(0,c.useTranslation)().t,r=F(t);return r?o().createElement("video",{controls:!0,width:"100%",height:"100%"},o().createElement("source",{src:r,type:(null==t?void 0:t.type)||(null==t?void 0:t.mimetype)}),n("Your browser does not support the video tag.")):null})}),P.add({match:function(e){return q(e,F(e))},Previewer:$(Y)}),P.add({match:function(e){return L(e,F(e))},Previewer:$(function(e){var t=e.file,r=(0,c.useTranslation)(s.C).t,i=F(t),a=o().useRef(new Map),u=o().useRef(null),f=v(o().useState(null),2),p=f[0],m=f[1],y=v(o().useState(null),2),g=y[0],h=y[1];return(o().useEffect(function(){if(i){var e={cancelled:!1,abortController:new AbortController,rendered:new Set,inFlight:new Set,loadingTasks:[],renderTasks:[]};return u.current=e,m(null),h(null),d(function(){var t,r,o,l,a,u,c,s;return S(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,d(function(){return S(this,function(e){return K||(K=n.e("876").then(n.bind(n,583))),[2,K]})})()];case 1:return t=f.sent(),[3,3];case 2:throw new Z("resources","Failed to load PDF.js resources.",f.sent());case 3:if(e.cancelled)return[2];e.pdfjs=t;try{r=new URL(i,location.href)}catch(e){throw new Z("file","Invalid PDF file URL.",e)}f.label=4;case 4:return f.trys.push([4,6,,7]),[4,fetch(r,{credentials:r.origin===location.origin?"include":"omit",signal:e.abortController.signal})];case 5:return o=f.sent(),[3,7];case 6:throw new Z("file","Failed to fetch PDF file.",f.sent());case 7:if(!o.ok)throw new Z("file","Failed to fetch PDF file: ".concat(o.status));f.label=8;case 8:return f.trys.push([8,10,,11]),a=Uint8Array.bind,[4,o.arrayBuffer()];case 9:return l=new(a.apply(Uint8Array,[void 0,f.sent()])),[3,11];case 10:throw new Z("file","Failed to read PDF file response.",f.sent());case 11:if(e.cancelled)return[2];e.data=l;try{t.GlobalWorkerOptions.workerSrc=new URL(n(613),n.b).toString(),e.worker=t.PDFWorker.create({})}catch(e){throw new Z("resources","Failed to load PDF.js worker.",e)}u=t.getDocument({data:l.slice(0),isEvalSupported:!1,enableXfa:!1,useWasm:!1,worker:e.worker}),e.loadingTasks.push(u),f.label=12;case 12:return f.trys.push([12,14,,15]),[4,u.promise];case 13:return c=f.sent(),[3,15];case 14:throw new Z("document","Failed to parse PDF file.",f.sent());case 15:if(e.cancelled)return[2];return e.metaPdf=c,[4,c.getPage(1)];case 16:if(s=f.sent().getViewport({scale:1.4}),e.cancelled)return[2];return m({numPages:c.numPages,width:s.width,height:s.height}),[2]}})})().catch(function(t){if(!e.cancelled){var n=G(t);console.warn("[file-manager] PDF preview failed",{code:n,src:i,error:t}),h(n)}}),function(){var t,n,r;e.cancelled=!0,e.abortController.abort(),null==(t=e.observer)||t.disconnect(),e.renderTasks.forEach(function(e){var t;return null==(t=e.cancel)?void 0:t.call(e)}),e.loadingTasks.forEach(function(e){var t;return null==(t=e.destroy)?void 0:t.call(e)}),null==(r=e.worker)||null==(n=r.destroy)||n.call(r)}}},[i]),o().useEffect(function(){var e=u.current;if(p&&(null==e?void 0:e.pdfjs)&&e.metaPdf){var t=e.pdfjs,n=e.metaPdf,r=function(r){return d(function(){var o,l,u,c,s,f,p,d,m,y;return S(this,function(g){switch(g.label){case 0:if(e.cancelled||e.rendered.has(r)||e.inFlight.has(r)||!(o=a.current.get(r)))return[2];e.inFlight.add(r),g.label=1;case 1:if(g.trys.push([1,7,8,9]),!(1===r||!e.data))return[3,2];return c=n,[3,4];case 2:return l=t.getDocument({data:e.data.slice(0),isEvalSupported:!1,enableXfa:!1,useWasm:!1,worker:e.worker}),e.loadingTasks.push(l),[4,l.promise];case 3:c=g.sent(),g.label=4;case 4:if(e.cancelled)return[2];return[4,c.getPage(r)];case 5:if(f=(s=g.sent()).getViewport({scale:1.4}),!(p=document.createElement("canvas").getContext("2d")))return[2];return(d=p.canvas).width=f.width,d.height=f.height,d.style.display="block",d.style.width="100%",d.style.height="auto",o.style.aspectRatio="",o.replaceChildren(d),m=s.render({canvas:d,canvasContext:p,viewport:f,annotationMode:t.AnnotationMode.DISABLE}),e.renderTasks.push(m),[4,m.promise];case 6:if(g.sent(),e.cancelled)return[2];return e.rendered.add(r),null==(u=e.observer)||u.unobserve(o),[3,9];case 7:return y=g.sent(),e.cancelled||console.warn("[file-manager] PDF page render failed",{pageNumber:r,src:i,error:y}),[3,9];case 8:return null==l||l.destroy(),e.inFlight.delete(r),[7];case 9:return[2]}})})()},o=new IntersectionObserver(function(e){var t=!0,n=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(t=(i=l.next()).done);t=!0){var a=i.value;a.isIntersecting&&r(Number(a.target.dataset.page))}}catch(e){n=!0,o=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw o}}},{rootMargin:"300px 0px"});return e.observer=o,a.current.forEach(function(e){return o.observe(e)}),function(){o.disconnect(),e.observer===o&&(e.observer=void 0)}}},[p,i]),i)?o().createElement("div",{style:{width:"100%",minHeight:"100%",padding:16}},g?o().createElement(l.Alert,{type:"warning",showIcon:!0,message:r(H[g])}):null,p||g?null:o().createElement("div",{style:{display:"flex",justifyContent:"center",padding:48}},o().createElement(l.Spin,null)),p?Array.from({length:p.numPages},function(e,t){return t+1}).map(function(e){return o().createElement("div",{key:e,"data-page":e,ref:function(t){t?a.current.set(e,t):a.current.delete(e)},style:{width:"100%",maxWidth:p.width,margin:"0 auto 16px",aspectRatio:"".concat(p.width," / ").concat(p.height),background:"#fff",border:"1px solid #f0f0f0"}})}):null):null})});var Q=function(e){var t,n,r,i=E(e.file);if(!i)return null;var l=(null!=(r=P.getTypeByFile(i))?r:{}).Previewer;return l?o().createElement(l,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){g(e,t,n[t])})}return e}({},e),n=n={file:i},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)):null}},564:function(e,t,n){"use strict";n.d(t,{KT:function(){return f},tp:function(){return m},OC:function(){return h},BL:function(){return u},om:function(){return d},mt:function(){return c},Sx:function(){return y},Lq:function(){return p},Lg:function(){return b}});var r=n(485),o=n(59),i=n(155),l=n.n(i),a=n(488);function u(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:"baseUrl",label:"".concat(e("Base URL")," :"),rules:[{required:!0,message:e("The field value is required")}],extra:e('Base URL for file access, could be your CDN base URL. For example: "https://cdn.nocobase.com".')},l().createElement(r.EnvVariableInput,null))}function c(e){var t=(0,a.k)();return l().createElement(o.Form.Item,{name:"default",valuePropName:"checked"},l().createElement(o.Checkbox,{disabled:e.disabled},t("Default storage")))}var s=n(624);function f(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:["rules","size"],label:"".concat(e("File size limit")," :"),rules:[{required:!0,message:e("The field value is required")}],extra:e("Minimum from 1 byte.")},l().createElement(r.FileSizeInput,{min:s.UW,max:s.Qj,defaultValue:s.ZH}))}function p(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:["rules","mimetype"],label:"".concat(e("File type allowed (in MIME type format)")," :"),extra:e('Multi-types seperated with comma, for example: "image/*", "image/png", "image/*, application/pdf" etc.')},l().createElement(o.Input,{placeholder:"*"}))}function d(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:"name",label:"".concat(e("Storage name")," :"),rules:[{required:!0,message:e("The field value is required")}],extra:e("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")},l().createElement(o.Input,null))}function m(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:"paranoid",valuePropName:"checked",extra:e("Files are only removed when their corresponding records in the file collection are deleted. If a record from another collection includes an associating field referencing the file collection, the file will not be deleted unless cascade deletion is enabled for that association.")},l().createElement(o.Checkbox,null,e("Keep file in storage when destroy the file record")))}function y(e){var t=(0,a.k)();return l().createElement(o.Form.Item,{name:"path",label:"".concat(t("Path")," :"),extra:t('Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes "/" will be ignored. For example: "user/avatar".')},l().createElement(r.EnvVariableInput,{addonBefore:e.addonBefore}))}var g=[{label:"Append random ID",value:"appendRandomID"},{label:"Random string",value:"random"},{label:"Keep original filename (will be overwrite if filename is existed)",value:"none"}];function h(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:"renameMode",label:"".concat(e("Renaming")," :"),extra:e("Renaming strategy to avoid filename conflicts when uploading files.")},l().createElement(o.Radio.Group,{options:g.map(function(t){var n,r;return n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},t),r=r={label:e(t.label)},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n})}))}function b(){var e=(0,a.k)();return l().createElement(o.Form.Item,{name:"title",label:"".concat(e("Title")," :"),rules:[{required:!0,message:e("The field value is required")}]},l().createElement(o.Input,null))}},488:function(e,t,n){"use strict";n.d(t,{M:function(){return l},k:function(){return i}});var r=n(694),o=n(358);function i(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ns:[o.C,"client"]},n))}}function l(e){return(0,r.tExpr)(e,{ns:[o.C,"client"]})}},358:function(e,t,n){"use strict";n.d(t,{C:function(){return r}});var r="file-manager"},624:function(e,t,n){"use strict";n.d(t,{Qj:function(){return o},UW:function(){return r},ZF:function(){return l},ZH:function(){return i},a_:function(){return c},e7:function(){return u},y2:function(){return a}});var r=1,o=1/0,i=0x1400000,l="local",a="ali-oss",u="s3",c="tx-cos"},375:function(e){"use strict";e.exports=r},477:function(e){"use strict";e.exports=t},230:function(e){"use strict";e.exports=n},485:function(e){"use strict";e.exports=l},694:function(e){"use strict";e.exports=o},625:function(e){"use strict";e.exports=i},59:function(e){"use strict";e.exports=u},773:function(e){"use strict";e.exports=c},155:function(e){"use strict";e.exports=a},953:function(t){"use strict";t.exports=e}},m={};function y(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return d[e](n,n.exports,y),n.exports}y.m=d,y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},y.f={},y.e=function(e){return Promise.all(Object.keys(y.f).reduce(function(t,n){return y.f[n](e,t),t},[]))},y.u=function(e){return""+e+"."+({125:"0b8eef1f19b87042",229:"bd72c2d7aa088310",336:"1dd1b32466d0c778",43:"eb45d53ba3e9828b",450:"f590b4c220108742",876:"22cd8e41ac8631ed",929:"d7e783304cc1f236",942:"f36d807d763a1b53"})[e]+".js"},y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g={},y.l=function(e,t,n,r){if(g[e])return void g[e].push(t);if(void 0!==n)for(var o,i,l=document.getElementsByTagName("script"),a=0;a<l.length;a++){var u=l[a];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-file-manager/client-v2:"+n){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,y.nc&&o.setAttribute("nonce",y.nc),o.setAttribute("data-rspack","@nocobase/plugin-file-manager/client-v2:"+n),o.src=e),g[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=g[e];if(delete g[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},y.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.g.importScripts&&(h=y.g.location+"");var g,h,b=y.g.document;if(!h&&b&&(b.currentScript&&"SCRIPT"===b.currentScript.tagName.toUpperCase()&&(h=b.currentScript.src),!h)){var v=b.getElementsByTagName("script");if(v.length)for(var w=v.length-1;w>-1&&(!h||!/^http(s?):/.test(h));)h=v[w--].src}if(!h)throw Error("Automatic publicPath is not supported in this browser");y.p=h.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),y.b=document.baseURI||self.location.href,s={889:0},y.f.j=function(e,t){var n=y.o(s,e)?s[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=s[e]=[t,r]});t.push(n[2]=r);var o=y.p+y.u(e),i=Error();y.l(o,function(t){if(y.o(s,e)&&(0!==(n=s[e])&&(s[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},f=function(e,t){var n,r,o=t[0],i=t[1],l=t[2],a=0;if(o.some(function(e){return 0!==s[e]})){for(n in i)y.o(i,n)&&(y.m[n]=i[n]);l&&l(y)}for(e&&e(t);a<o.length;a++)r=o[a],y.o(s,r)&&s[r]&&s[r][0](),s[r]=0},(p=self.webpackChunk_nocobase_plugin_file_manager_client_v2=self.webpackChunk_nocobase_plugin_file_manager_client_v2||[]).forEach(f.bind(null,0)),p.push=f.bind(null,p.push.bind(p));var O={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-file-manager/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");e=o>=0?r.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-file-manager/dist/client-v2/"}y.p=e}(),!function(){"use strict";y.r(O),y.d(O,{BaseUrlField:function(){return t.BL},CardUpload:function(){return n.CardUpload},DefaultField:function(){return t.mt},FileSizeField:function(){return t.KT},MimetypeField:function(){return t.Lq},NameField:function(){return t.om},ParanoidField:function(){return t.tp},PathField:function(){return t.Sx},PluginFileManagerClientV2:function(){return e.A},RenameModeField:function(){return t.OC},TitleField:function(){return t.Lg},UploadFieldModel:function(){return n.UploadFieldModel},default:function(){return e.A},filePreviewTypes:function(){return r.e$},wrapWithModalPreviewer:function(){return r.LD}});var e=y(667),t=y(564),n=y(76),r=y(23)}(),O}()});
@@ -34,9 +34,13 @@ export declare function getFileUrl(file: any): any;
34
34
  export declare function matchMimetype(file: any, type: string): any;
35
35
  export declare const getFileExt: (file: any, url?: string) => string;
36
36
  export declare const isActiveContentFile: (file: any, url?: string) => boolean;
37
+ export declare const isPdfFile: (file: any, url?: string) => boolean;
37
38
  export declare const getFileName: (file: any, url?: string) => any;
38
39
  export declare const getDownloadFileName: (file: any, url?: string) => string;
39
40
  export declare const getFallbackIcon: (file: any, url?: string) => string;
40
41
  export declare const getPreviewThumbnailUrl: (file: any) => string;
41
42
  export declare const wrapWithModalPreviewer: (Previewer: React.ComponentType<FilePreviewerProps>) => (props: FilePreviewerProps) => React.JSX.Element;
43
+ type PdfPreviewErrorCode = 'resources' | 'file' | 'document';
44
+ export declare const getPdfPreviewErrorCode: (error: unknown) => PdfPreviewErrorCode;
42
45
  export declare const FilePreviewRenderer: (props: FilePreviewerProps) => React.JSX.Element;
46
+ export {};
@@ -8,25 +8,25 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.40",
11
+ "@nocobase/client": "2.1.0-alpha.45",
12
12
  "react": "18.2.0",
13
13
  "antd": "5.24.2",
14
14
  "@ant-design/icons": "5.6.1",
15
15
  "@formily/shared": "2.3.7",
16
16
  "lodash": "4.18.1",
17
17
  "react-i18next": "11.18.6",
18
- "@nocobase/flow-engine": "2.1.0-alpha.40",
19
- "@nocobase/client-v2": "2.1.0-alpha.40",
18
+ "@nocobase/flow-engine": "2.1.0-alpha.45",
19
+ "@nocobase/client-v2": "2.1.0-alpha.45",
20
20
  "multer": "1.4.5-lts.2",
21
- "@nocobase/database": "2.1.0-alpha.40",
22
- "@nocobase/server": "2.1.0-alpha.40",
23
- "@nocobase/utils": "2.1.0-alpha.40",
24
- "@nocobase/test": "2.1.0-alpha.40",
21
+ "@nocobase/database": "2.1.0-alpha.45",
22
+ "@nocobase/server": "2.1.0-alpha.45",
23
+ "@nocobase/utils": "2.1.0-alpha.45",
24
+ "@nocobase/test": "2.1.0-alpha.45",
25
25
  "@formily/react": "2.3.7",
26
26
  "@emotion/css": "11.13.0",
27
27
  "ahooks": "3.7.8",
28
- "@nocobase/actions": "2.1.0-alpha.40",
28
+ "@nocobase/actions": "2.1.0-alpha.45",
29
+ "@nocobase/plugin-data-source-main": "2.1.0-alpha.45",
29
30
  "sequelize": "6.35.2",
30
- "@nocobase/plugin-data-source-main": "2.1.0-alpha.40",
31
31
  "axios": "1.7.7"
32
32
  };
@@ -33,6 +33,9 @@
33
33
  "Minimum from 1 byte.": "Minimum from 1 byte.",
34
34
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Mehrere Typen durch Kommas getrennt, zum Beispiel: \"image/*\", \"image/png\", \"image/*, application/pdf\" usw.",
35
35
  "Path": "Pfad",
36
+ "PDF preview failed. Please download the file to preview it.": "PDF-Vorschau fehlgeschlagen. Bitte laden Sie die Datei herunter, um sie anzuzeigen.",
37
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "Die PDF-Vorschau konnte die Datei nicht laden. Wenn die Datei auf einer anderen Domain gespeichert ist, konfigurieren Sie CORS für den externen Speicher, damit diese Website die Datei lesen darf.",
38
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "Die Ressourcen für die PDF-Vorschau konnten nicht geladen werden. Bitte aktualisieren Sie die Seite und prüfen Sie, ob die statischen Plugin-Dateien korrekt bereitgestellt wurden.",
36
39
  "Region": "Region",
37
40
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Relativer Pfad, in dem die Datei gespeichert wird. Leer lassen als Stammpfad. Die führenden und abschließenden Schrägstriche \"/\" werden ignoriert. Zum Beispiel: \"user/avatar\".",
38
41
  "Renaming strategy to avoid filename conflicts when uploading files.": "Umbenennungsstrategie, um Dateikonflikte beim Hochladen zu vermeiden.",
@@ -35,6 +35,9 @@
35
35
  "Minimum from 1 byte.": "Minimum from 1 byte.",
36
36
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.",
37
37
  "Path": "Path",
38
+ "PDF preview failed. Please download the file to preview it.": "PDF preview failed. Please download the file to preview it.",
39
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.",
40
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.",
38
41
  "Region": "Region",
39
42
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".",
40
43
  "Renaming strategy to avoid filename conflicts when uploading files.": "Renaming strategy to avoid filename conflicts when uploading files.",
@@ -33,6 +33,9 @@
33
33
  "Minimum from 1 byte.": "Minimum from 1 byte.",
34
34
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.",
35
35
  "Path": "Path",
36
+ "PDF preview failed. Please download the file to preview it.": "La vista previa del PDF falló. Descargue el archivo para verlo.",
37
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "La vista previa del PDF no pudo cargar el archivo. Si el archivo está almacenado en otro dominio, configure CORS en el almacenamiento externo para permitir que este sitio lea el archivo.",
38
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "No se pudieron cargar los recursos de vista previa del PDF. Actualice la página y compruebe si los archivos estáticos del plugin se han desplegado correctamente.",
36
39
  "Region": "Region",
37
40
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".",
38
41
  "Renaming strategy to avoid filename conflicts when uploading files.": "Estrategia de renombrado para evitar conflictos de nombres de archivo al subir archivos.",
@@ -33,6 +33,9 @@
33
33
  "Minimum from 1 byte.": "Minimum from 1 byte.",
34
34
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.",
35
35
  "Path": "Chemin",
36
+ "PDF preview failed. Please download the file to preview it.": "L'aperçu du PDF a échoué. Veuillez télécharger le fichier pour le consulter.",
37
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "L'aperçu du PDF n'a pas pu charger le fichier. Si le fichier est stocké sur un autre domaine, configurez CORS pour le stockage externe afin d'autoriser ce site à lire le fichier.",
38
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "Les ressources de l'aperçu du PDF n'ont pas pu être chargées. Veuillez actualiser la page et vérifier que les fichiers statiques du plugin sont correctement déployés.",
36
39
  "Region": "Region",
37
40
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".",
38
41
  "Renaming strategy to avoid filename conflicts when uploading files.": "Stratégie de renommage pour éviter les conflits de noms de fichiers lors du téléchargement.",
@@ -28,6 +28,9 @@
28
28
  "Minimum from 1 byte.": "Minimum from 1 byte.",
29
29
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Több típus vesszővel elválasztva, például: \"image/*\", \"image/png\", \"image/*, application/pdf\" stb.",
30
30
  "Path": "Útvonal",
31
+ "PDF preview failed. Please download the file to preview it.": "A PDF előnézete sikertelen. Kérjük, töltse le a fájlt a megtekintéshez.",
32
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "A PDF előnézete nem tudta betölteni a fájlt. Ha a fájl másik tartományban van tárolva, állítsa be a CORS-t a külső tárhelyen, hogy ez a webhely olvashassa a fájlt.",
33
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "A PDF előnézeti erőforrásai nem töltődtek be. Kérjük, frissítse az oldalt, és ellenőrizze, hogy a plugin statikus fájljai megfelelően lettek-e telepítve.",
31
34
  "Region": "Régió",
32
35
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Relatív útvonal, ahová a fájl mentésre kerül. Üresen hagyva gyökér útvonal. A kezdő és záró \"/\" karaktereket figyelmen kívül hagyjuk. Például: \"user/avatar\".",
33
36
  "See more": "Továbbiak",
@@ -45,4 +48,4 @@
45
48
  "Upload timeout for a single file in milliseconds. Default is 600000.": "Upload timeout for a single file in milliseconds. Default is 600000.",
46
49
  "Use the built-in static file server": "A beépített statikus fájlkiszolgáló használata",
47
50
  "Will be used for API": "Az API-hoz lesz használva"
48
- }
51
+ }
@@ -28,6 +28,9 @@
28
28
  "Minimum from 1 byte.": "Minimum from 1 byte.",
29
29
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Beberapa tipe dipisahkan dengan koma, contoh: \"image/*\", \"image/png\", \"image/*, application/pdf\" dll.",
30
30
  "Path": "Jalur",
31
+ "PDF preview failed. Please download the file to preview it.": "Pratinjau PDF gagal. Silakan unduh file untuk melihatnya.",
32
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "Pratinjau PDF gagal memuat file. Jika file disimpan di domain lain, konfigurasikan CORS pada penyimpanan eksternal agar situs ini dapat membaca file tersebut.",
33
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "Sumber daya pratinjau PDF gagal dimuat. Silakan segarkan halaman dan periksa apakah file statis plugin telah diterapkan dengan benar.",
31
34
  "Region": "Wilayah",
32
35
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Jalur relatif tempat file akan disimpan. Biarkan kosong sebagai jalur root. Garis miring di awal dan akhir \"/\" akan diabaikan. Contoh: \"user/avatar\".",
33
36
  "See more": "Lihat selengkapnya",
@@ -45,4 +48,4 @@
45
48
  "Upload timeout for a single file in milliseconds. Default is 600000.": "Upload timeout for a single file in milliseconds. Default is 600000.",
46
49
  "Use the built-in static file server": "Gunakan server file statis bawaan",
47
50
  "Will be used for API": "Akan digunakan untuk API"
48
- }
51
+ }
@@ -33,6 +33,9 @@
33
33
  "Minimum from 1 byte.": "Minimum from 1 byte.",
34
34
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Più tipi separati da virgola, ad esempio: \"image/*\", \"image/png\", \"image/*, application/pdf\" ecc.",
35
35
  "Path": "Percorso",
36
+ "PDF preview failed. Please download the file to preview it.": "Anteprima PDF non riuscita. Scarica il file per visualizzarlo.",
37
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "L'anteprima PDF non è riuscita a caricare il file. Se il file è archiviato su un altro dominio, configura CORS per l'archiviazione esterna per consentire a questo sito di leggere il file.",
38
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "Le risorse dell'anteprima PDF non sono state caricate. Aggiorna la pagina e verifica che i file statici del plugin siano distribuiti correttamente.",
36
39
  "Region": "Regione",
37
40
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Percorso relativo in cui verrà salvato il file. Lasciare vuoto per il percorso radice. Le barre iniziali e finali \"/\" verranno ignorate. Ad esempio: \"user/avatar\".",
38
41
  "Renaming strategy to avoid filename conflicts when uploading files.": "Strategia di rinominazione per evitare conflitti di nomi di file durante il caricamento dei file.",
@@ -33,6 +33,9 @@
33
33
  "Minimum from 1 byte.": "Minimum from 1 byte.",
34
34
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "複数のタイプはカンマで区切ります。 例えば「image/*」「image/png」「image/*、application/pdf」など。",
35
35
  "Path": "パス",
36
+ "PDF preview failed. Please download the file to preview it.": "PDF のプレビューに失敗しました。ファイルをダウンロードして確認してください。",
37
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "PDF プレビューでファイルを読み込めませんでした。ファイルが別ドメインに保存されている場合は、このサイトがファイルを読み取れるように外部ストレージの CORS を設定してください。",
38
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "PDF プレビューのリソースを読み込めませんでした。ページを更新し、プラグインの静的ファイルが正しくデプロイされているか確認してください。",
36
39
  "Region": "地域",
37
40
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "更清晰的表达方式,符合技术描述",
38
41
  "Renaming strategy to avoid filename conflicts when uploading files.": "ファイルアップロード時のファイル名の競合を避けるためのリネーム戦略。",
@@ -34,6 +34,9 @@
34
34
  "Minimum from 1 byte.": "Minimum from 1 byte.",
35
35
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.",
36
36
  "Path": "경로",
37
+ "PDF preview failed. Please download the file to preview it.": "PDF 미리보기에 실패했습니다. 파일을 다운로드하여 확인하세요.",
38
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "PDF 미리보기가 파일을 불러오지 못했습니다. 파일이 다른 도메인에 저장되어 있다면 이 사이트가 파일을 읽을 수 있도록 외부 저장소의 CORS를 설정하세요.",
39
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "PDF 미리보기 리소스를 불러오지 못했습니다. 페이지를 새로고침하고 플러그인 정적 파일이 올바르게 배포되었는지 확인하세요.",
37
40
  "Region": "지역",
38
41
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".",
39
42
  "Renaming strategy to avoid filename conflicts when uploading files.": "파일 업로드 시 파일 이름 충돌을 피하기 위한 이름 변경 전략입니다.",
@@ -33,6 +33,9 @@
33
33
  "Minimum from 1 byte.": "Minimum from 1 byte.",
34
34
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Meerdere typen gescheiden door een komma, bijvoorbeeld: \"image/*\", \"image/png\", \"image/*, application/pdf\" enz.",
35
35
  "Path": "Pad",
36
+ "PDF preview failed. Please download the file to preview it.": "PDF-voorbeeld mislukt. Download het bestand om het te bekijken.",
37
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "Het PDF-voorbeeld kon het bestand niet laden. Als het bestand op een ander domein is opgeslagen, configureer dan CORS voor de externe opslag zodat deze site het bestand kan lezen.",
38
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "De PDF-voorbeeldbronnen konden niet worden geladen. Vernieuw de pagina en controleer of de statische pluginbestanden correct zijn geïmplementeerd.",
36
39
  "Region": "Regio",
37
40
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Relatief pad waar het bestand zal worden opgeslagen. Laat leeg als hoofdmap. De voorloop- en achterloop-slashes \"/\" worden genegeerd. Bijvoorbeeld: \"gebruiker/avatar\".",
38
41
  "Renaming strategy to avoid filename conflicts when uploading files.": "Hernoemstrategie om bestandsnaamconflicten te voorkomen bij het uploaden van bestanden.",
@@ -33,6 +33,9 @@
33
33
  "Minimum from 1 byte.": "Minimum from 1 byte.",
34
34
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.",
35
35
  "Path": "Path",
36
+ "PDF preview failed. Please download the file to preview it.": "A pré-visualização do PDF falhou. Baixe o arquivo para visualizá-lo.",
37
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "A pré-visualização do PDF não conseguiu carregar o arquivo. Se o arquivo estiver armazenado em outro domínio, configure CORS no armazenamento externo para permitir que este site leia o arquivo.",
38
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "Os recursos de pré-visualização do PDF não foram carregados. Atualize a página e verifique se os arquivos estáticos do plugin foram implantados corretamente.",
36
39
  "Region": "Region",
37
40
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".",
38
41
  "Renaming strategy to avoid filename conflicts when uploading files.": "Renaming strategy to avoid filename conflicts when uploading files.",
@@ -33,6 +33,9 @@
33
33
  "Minimum from 1 byte.": "Minimum from 1 byte.",
34
34
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Несколько типов, разделенных запятой, например: \"image/*\", \"image/png\", \"image/*, application/pdf\" и т. д.",
35
35
  "Path": "Путь",
36
+ "PDF preview failed. Please download the file to preview it.": "Не удалось выполнить предварительный просмотр PDF. Скачайте файл, чтобы просмотреть его.",
37
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "Предварительный просмотр PDF не смог загрузить файл. Если файл хранится на другом домене, настройте CORS для внешнего хранилища, чтобы разрешить этому сайту читать файл.",
38
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "Не удалось загрузить ресурсы предварительного просмотра PDF. Обновите страницу и проверьте, правильно ли развернуты статические файлы плагина.",
36
39
  "Region": "Регион",
37
40
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Относительный путь, по которому будет сохранен файл. Оставьте пустым для корневого пути. Начальные и конечные слеши \"/\" будут проигнорированы. Например: \"user/avatar\".",
38
41
  "Renaming strategy to avoid filename conflicts when uploading files.": "Стратегия переименования для избежания конфликтов имен файлов при загрузке файлов.",
@@ -33,6 +33,9 @@
33
33
  "Minimum from 1 byte.": "Minimum from 1 byte.",
34
34
  "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.",
35
35
  "Path": "Path",
36
+ "PDF preview failed. Please download the file to preview it.": "PDF önizlemesi başarısız oldu. Görüntülemek için lütfen dosyayı indirin.",
37
+ "PDF preview failed to load the file. If the file is stored on another domain, configure CORS for the external storage to allow this site to read the file.": "PDF önizlemesi dosyayı yükleyemedi. Dosya başka bir alan adında saklanıyorsa, bu sitenin dosyayı okuyabilmesi için harici depolamada CORS yapılandırın.",
38
+ "PDF preview resources failed to load. Please refresh the page and check whether plugin static files are deployed correctly.": "PDF önizleme kaynakları yüklenemedi. Lütfen sayfayı yenileyin ve eklenti statik dosyalarının doğru dağıtıldığını kontrol edin.",
36
39
  "Region": "Region",
37
40
  "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".",
38
41
  "Renaming strategy to avoid filename conflicts when uploading files.": "Dosya yüklerken dosya adı çakışmalarını önlemek için yeniden adlandırma stratejisi.",