",a};function B(){let e=8,a=Number($("#cantoViewBody").find("#imagesContent")[0].offsetWidth),n=0,t=function(l){if(n=Number((a-8)/l-2),n>=160&&n<=210)return n;n<160?(l--,t(l)):n>210&&(l++,t(l))},o=t(e);$("#cantoViewBody").find(".single-image").css("width",o)}function H(){let e=$("#cantoImageBody").height(),a=$("#imagesContent").height(),n=$("#cantoImageBody").scrollTop(),t=a-e-n<0,o=$(".single-image").length==0;return t&&!o}function T(e){let a=u.length==0?0:v,n="sortBy=time&sortDirection=descending&limit="+e+"&start="+a;return $(".single-image").length!==0?$("#loadingMore").fadeIn("slow"):$("#cantoViewBody").find("#imagesContent").html(""),n}function L(){if(h=="bySearch"){let e=$("#cantoViewBody").find("#globalSearch input").val();if(!e)return;let a=$("#cantoViewBody").find(".type-font.current").data("type"),n={};n.scheme=a,n.keywords=e,s.getFilterList(n,y)}else if(h=="bytree"){let e=$("#cantoViewBody").find("#treeviewSection ul li").find(".selected").data("id");s.getListByAlbum(e,y)}else{let e=$("#cantoViewBody").find(".type-font.current").data("type");C(e)}}function N(e){let a=`https://${m}/api/v1/upload/setting`;fetch(a,{method:"GET",headers:{Authorization:`${p} ${g}`,"Content-Type":"application/json; charset=utf-8"}}).then(t=>t.json()).then(t=>{const o=new FormData;o.append("key",t.key),o.append("acl",t.acl),o.append("AWSAccessKeyId",t.AWSAccessKeyId),o.append("Policy",t.Policy),o.append("Signature",t.Signature),o.append("x-amz-meta-file_name",e.currentTarget.files[0].name),o.append("x-amz-meta-tag",""),o.append("x-amz-meta-scheme",""),o.append("x-amz-meta-id",""),o.append("x-amz-meta-album_id",""),o.append("file",e.currentTarget.files[0]),parent.document.querySelector(".modal-status-bar"),fetch(t.url,{method:"post",body:o,mode:"no-cors",redirect:"follow"}).then(l=>{document.getElementById("uploadBtn").style.background="linear-gradient(16deg, rgb(205 101 1) 0%, rgb(169 218 0 / 100%) 100%)",document.getElementById("uploadBtn").value="Uploading image..."}).catch(l=>{console.log(l)}).finally(()=>{document.getElementById("uploadBtn").value="Upload complete - processing",n(e.currentTarget.files[0].name)})}).catch(t=>{console.log("An error occurred while attempting to grab upload settings!"),console.log(t)});function n(t){let o=`https://${m}/api/v1/upload/status?hours=1`;parent.document.querySelector(".modal-status-bar"),setInterval(()=>{fetch(o,{method:"get",headers:{Authorization:p+" "+g}}).then(l=>l.json()).then(l=>{l.results&&l.results.length>0&&l.results.filter(d=>{if(d.name==t&&d.status!="Done")return d}).filter(d=>d!=null).length==0&&(document.getElementById("uploadBtn").value="Canto processing complete! Reloading",window.location.reload())}).catch(l=>{console.log("an error occurred!"),console.log(l)})},5e3)}}parent.document.querySelector(".modal-status-bar").style.display="none";
+//# sourceMappingURL=canto-embed-f0b95696.js.map
diff --git a/src/web/assets/dist/assets/canto-embed-f0b95696.js.gz b/src/web/assets/dist/assets/canto-embed-f0b95696.js.gz
new file mode 100644
index 0000000..4b687db
Binary files /dev/null and b/src/web/assets/dist/assets/canto-embed-f0b95696.js.gz differ
diff --git a/src/web/assets/dist/assets/canto-embed-f0b95696.js.map b/src/web/assets/dist/assets/canto-embed-f0b95696.js.map
new file mode 100644
index 0000000..cd6808a
--- /dev/null
+++ b/src/web/assets/dist/assets/canto-embed-f0b95696.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"canto-embed-f0b95696.js","sources":["../../../../../buildchain/src/js/canto-embed.js"],"sourcesContent":["let cantoViewDom = {};\nlet _accessToken = \"\";\nlet _refreshToken = \"\";\nlet _tokenType = \"\";\nlet _tenants = \"\";\nlet cantoAPI = {};\nlet _APIHeaders = {};\nlet searchedBy = \"\"; //bySearch bytree byScheme''\nlet currentImageList = [];\nlet singleCountLoad = 50;\nlet apiNextStart = 0;\nlet isLoadingComplete = false;\nlet _formatDistrict = '';\nconst MAX_CONTENT_REQUEST_ITEMS = 100;\nconst MAX_ALBUM_REQUEST_ITEMS = 1000;\n\n/* -----------------canto API start-------------------------------------------------------------*/\n\nfunction setToken(tokenInfo) {\n _accessToken = tokenInfo.accessToken;\n _tenants = tokenInfo.tenant;\n _tokenType = tokenInfo.tokenType ? tokenInfo.tokenType : \"bearer\";\n _APIHeaders = {\n \"Authorization\": _tokenType + \" \" + _accessToken,\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n };\n _formatDistrict = tokenInfo.formatDistrict;\n}\n\n\ncantoAPI.loadTree = function (callback) {\n var url = \"https://\" + _tenants + \"/api/v1/tree?sortBy=name&sortDirection=ascending&layer=1\";\n $.ajax({\n headers: _APIHeaders,\n type: \"GET\",\n url: url,\n async: true,\n error: function (request) {\n alert(\"load tree error\");\n },\n success: function (data) {\n callback(data.results);\n }\n });\n};\ncantoAPI.loadSubTree = function (treeID, callback) {\n let url = `https://${_tenants}/api/v1/tree/${treeID}`;\n $.ajax({\n headers: _APIHeaders,\n type: \"GET\",\n url: url,\n async: true,\n error: function (request) {\n alert(\"load tree error\");\n },\n success: function (data) {\n callback(data.results);\n }\n });\n};\ncantoAPI.getListByAlbum = function (albumID, callback) {\n if (isLoadingComplete) {\n return;\n }\n let filterString = loadMoreHandler(singleCountLoad);\n let url = `https://${_tenants}/api/v1/album/${albumID}?${filterString}`;\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n async: true,\n error: function (request) {\n alert(\"load list error\");\n },\n success: function (data) {\n currentImageList.push.apply(currentImageList, data.results);\n if (!data.start) {\n data.start = 0;\n }\n if (data.found - data.limit <= data.start) {\n isLoadingComplete = true;\n } else {\n isLoadingComplete = false;\n }\n apiNextStart = data.start + data.limit + 1;\n $(\"#loadingMore\").delay(1500).fadeOut(\"slow\");\n callback(data.results);\n }\n });\n};\ncantoAPI.getRedirectURL = function (previewURL, ID) {\n if (!(previewURL && ID)) return;\n let url = previewURL + 'URI';\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n error: function (request) {\n console.error(request.getError());\n },\n success: function (data) {\n $(\"img#\" + ID).attr('src', data);\n }\n });\n};\ncantoAPI.getHugeRedirectURL = function (previewURL, ID) {\n if (!(previewURL && ID)) return;\n let url = `${previewURL}URI/2000`;\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n error: function (request) {\n console.error(request.getError());\n },\n success: function (data) {\n let $viewImageModal = $(\"#cantoViewBody\").find(\"#imageBox\");\n $viewImageModal.find(\"img\").attr(\"src\", data);\n }\n });\n};\n\n\ncantoAPI.getListByScheme = function (scheme, callback) {\n if (scheme == \"allfile\") {\n let data = {scheme: \"allfile\", keywords: \"\"};\n cantoAPI.getFilterList(data, callback);\n } else {\n if (isLoadingComplete) {\n return;\n }\n let filterString = loadMoreHandler(singleCountLoad);\n let url = `https://${_tenants}/api/v1/${scheme}?${filterString}`;\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n async: false,\n error: function (request) {\n alert(\"load list error\");\n },\n success: function (data) {\n currentImageList.push.apply(currentImageList, data.results);\n if (!data.start) {\n data.start = 0;\n }\n if (data.found - data.limit <= data.start) {\n isLoadingComplete = true;\n } else {\n isLoadingComplete = false;\n }\n apiNextStart = data.start + data.limit + 1;\n $(\"#loadingMore\").delay(1500).fadeOut(\"slow\");\n callback(data.results);\n }\n });\n }\n\n};\n\ncantoAPI.getDetail = function (contentID, scheme, callback) {\n let url = `https://${_tenants}/api/v1/${scheme}/${contentID}`;\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n async: true,\n error: function (request) {\n alert(\"load detail error\");\n },\n success: function (data) {\n callback(data);\n }\n });\n};\n\ncantoAPI.getFilterList = function (data, callback) {\n if (isLoadingComplete) {\n return;\n }\n let filterString = loadMoreHandler(singleCountLoad);\n let url = `https://${_tenants}/api/v1/search?${filterString}`;\n url += `&keyword=${data.keywords}`;\n if (data.scheme && data.scheme == \"allfile\") {\n url += `&scheme=${encodeURIComponent(\"image|presentation|document|audio|video|other\")}`;\n } else if (data.scheme) {\n url += `&scheme=${data.scheme}`;\n }\n $.ajax({\n type: \"GET\",\n headers: _APIHeaders,\n url: url,\n async: false,\n error: function (request) {\n alert(\"load List error\");\n },\n success: function (data) {\n currentImageList.push.apply(currentImageList, data.results);\n if (!data.start) {\n data.start = 0;\n }\n if (data.found - data.limit <= data.start) {\n isLoadingComplete = true;\n } else {\n isLoadingComplete = false;\n }\n apiNextStart = data.start + data.limit + 1;\n $(\"#loadingMore\").delay(1500).fadeOut(\"slow\");\n callback(data.results);\n }\n });\n};\n\ncantoAPI.logout = function () {\n //clear cookie and trun to login page.\n let targetWindow = parent;\n let data = {};\n data.type = \"cantoLogout\";\n targetWindow.postMessage(data, '*');\n};\n\n/**\n * Retrieve all of the assets from the albumId album, paginated to handle API limits\n *\n * @param {[]} buffer\n * @param {string} albumId\n * @param {number} start\n * @returns {Promise<*>}\n */\ncantoAPI.paginatedAlbumRequest = async (buffer, albumId, start = 0) => {\n let url = `https://${_tenants}/api/v1/album/${albumId}`;\n let filterString = \"sortBy=time&sortDirection=descending&limit=\" + MAX_ALBUM_REQUEST_ITEMS + \"&start=\" + start;\n let result = await fetch(`${url}?${filterString}`, {\n method: \"get\",\n headers: {\n \"Authorization\": `${_tokenType} ${_accessToken}`,\n \"Content-Type\": \"application/json; charset=utf-8\"\n },\n }).then((response) => {\n return response.json();\n });\n buffer.push(...result['results']);\n if (buffer.length < result.found) {\n return cantoAPI.paginatedAlbumRequest(buffer, albumId, start + MAX_ALBUM_REQUEST_ITEMS);\n } else {\n return buffer;\n }\n}\n\n/**\n * Retrieve all of the assets in the imageArray array, paginated to handle API limits\n *\n * @param {[]} buffer\n * @param {{id: string, scheme: string}[]} imageArray\n * @param {number} start\n * @returns {Promise<*>}\n */\ncantoAPI.paginatedContentRequest = async (buffer, imageArray, start = 0) => {\n let url = `https://${_tenants}/api/v1/batch/content`;\n const imageArraySubset = imageArray.slice(start, start + MAX_CONTENT_REQUEST_ITEMS);\n let result = await fetch(url, {\n method: \"post\",\n headers: {\n \"Authorization\": `${_tokenType} ${_accessToken}`,\n \"Content-Type\": \"application/json; charset=utf-8\"\n },\n body: JSON.stringify(imageArraySubset)\n }).then((response) => {\n return response.json();\n });\n buffer.push(...result['docResult']);\n if (buffer.length < imageArray.length) {\n return cantoAPI.paginatedContentRequest(buffer, imageArray, start + MAX_CONTENT_REQUEST_ITEMS);\n } else {\n return buffer;\n }\n}\n\n/**\n * Insert the images in imageArray into the CMS\n *\n * @param {{id: string, scheme: string}[]} imageArray\n */\ncantoAPI.insertImage = function (imageArray) {\n if (!(imageArray && imageArray.length)) {\n return;\n }\n cantoAPI.paginatedContentRequest([], imageArray, 0).then((response) => {\n // Get the id of the canto asset, or 0 if it is a collection of images\n let id = response.length === 1 ? response[0].id : 0;\n // Gather information about the selected album\n let album = $(\"#treeviewSection\").find(\"li.selected\");\n const albumId = album.data('id');\n let albumName = album.find('span').text();\n const albumData = {\n id: albumId,\n name: albumName,\n };\n // Compose the payload to send as an event\n let data = {\n type: \"closeModal\",\n // The id of the canto asset, or 0 if it not a single image selection\n cantoId: id,\n // The id of the album, or 0 if it not a full album selection\n cantoAlbumId: 0,\n cantoAssetData: response,\n cantoAlbumData: albumData,\n };\n // Let our canto-field.js know what asset(s) were picked\n parent.postMessage(data, '*');\n }).catch((error) => {\n console.error(error.message);\n data.type = \"cantoInsertImage\";\n data.assetList = [];\n parent.postMessage(data, '*');\n });\n};\n\n/**\n * Insert the images in imageArray into the CMS\n *\n * @param {string} albumId\n * @param {string} albumName\n */\ncantoAPI.insertAlbum = function (albumId, albumName) {\n cantoAPI.paginatedAlbumRequest([], albumId, 0).then((response) => {\n // Gather information about the selected album\n const albumData = {\n id: albumId,\n name: albumName,\n };\n // Compose the payload to send as an event\n let data = {\n type: \"closeModal\",\n // The id of the canto asset, or 0 if it not a single image selection\n cantoId: 0,\n // The id of the album, or 0 if it not a full album selection\n cantoAlbumId: albumId,\n cantoAssetData: response,\n cantoAlbumData: albumData,\n };\n // Let our canto-field.js know what asset(s) were picked\n parent.postMessage(data, '*');\n }).catch((error) => {\n console.error(error.message);\n data.type = \"cantoInsertImage\";\n data.assetList = [];\n parent.postMessage(data, '*');\n });\n};\n\n/* -----------------canto API end--------------------------------------------------------*/\n\n$(document).ready(function () {\n getFrameDom();\n addEventListener();\n getTokenInfo();\n\n window.addEventListener(\"message\", (event) => {\n let tokenInfo = event.data;\n\n if (tokenInfo && tokenInfo.accessToken && tokenInfo.accessToken.length > 0) {\n setToken(tokenInfo);\n } else {\n setToken({\n accessToken: parent.document.querySelector(\".canto-uc-subiframe\").dataset.access,\n tenant: parent.document.querySelector(\".canto-uc-subiframe\").dataset.tenant,\n });\n }\n treeviewDataHandler();\n let initSchme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n $(\"#cantoViewBody\").find(\"#globalSearch input\").val(\"\");\n getImageInit(initSchme);\n });\n\n\n});\n\nfunction getTokenInfo() {\n let targetWindow = parent;\n let data = {};\n data.type = \"getTokenInfo\";\n targetWindow.postMessage(data, '*');\n}\n\nfunction getFrameDom() {\n let parentDocument = document;\n let contentIframe = document.getElementsByClassName('canto-uc-subiframe')[0];\n if (contentIframe) {\n parentDocument = contentIframe.contentDocument;\n }\n cantoViewDom = parentDocument;\n}\n\nfunction addEventListener() {\n document.addEventListener('sendTokenInfo', function (e) {\n let tokenInfo = e.data;\n _accessToken = tokenInfo.accessToken;\n _refreshToken = tokenInfo.refreshToken;\n _tokenType = tokenInfo.tokenType;\n });\n\n $(document).off('click').on(\"change\", \"#uploadBtnInvisible\", (e) => {\n uploadFileToCanto(e);\n })\n .on(\"click\", \"#uploadBtn\", (e) => {\n document.querySelector(\"#uploadBtnInvisible\").click();\n })\n .on(\"click\", \"#treeviewSwitch\", function (e) {\n if ($('#treeviewSection').hasClass(\"expanded\")) {\n $('#treeviewSection').stop().animate({\n left: '-20%'\n });\n $('#cantoImageBody').stop().animate({\n width: '100%',\n left: '0'\n }, imageResize);\n $('#treeviewSection').removeClass(\"expanded\");\n $(\"#loadingMore\").addClass(\"no-treeview\");\n $(\"#noItem\").addClass(\"no-treeview\");\n $(\".max-select-tips\").addClass(\"no-treeview\");\n } else {\n $('#treeviewSection').stop().animate({\n left: '0px'\n });\n $('#cantoImageBody').stop().animate({\n width: '80%',\n left: '20%'\n }, imageResize);\n $('#treeviewSection').addClass(\"expanded\");\n $(\"#loadingMore\").removeClass(\"no-treeview\");\n $(\"#noItem\").removeClass(\"no-treeview\");\n $(\".max-select-tips\").removeClass(\"no-treeview\");\n }\n\n })\n .on(\"click\", \".type-font\", function (e) {\n searchedBy = \"byScheme\";\n $(\".type-font\").removeClass(\"current\");\n $(this).addClass(\"current\");\n // let type = $(this).data(\"type\");\n $(\"#cantoViewBody\").find(\"#globalSearch input\").val(\"\");\n $(\"#cantoViewBody\").find(\"#treeviewSection ul li\").removeClass(\"selected\");\n\n let data = {};\n data.scheme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n data.keywords = \"\";\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").scrollTop(0);\n isLoadingComplete = false;\n currentImageList = [];\n cantoAPI.getFilterList(data, imageListDisplay);\n\n })\n .on(\"click\", \"#selectAllBtn\", function (e) {\n $(\"#cantoViewBody\").find('.single-image .select-box').removeClass(\"icon-s-Ok2_32\");\n $(\"#cantoViewBody\").find(\".single-image\").removeClass(\"selected\");\n handleSelectedMode();\n })\n .on(\"click\", \"#insertAssetsBtn\", function (e) {\n $(\"#cantoViewBody\").find(\".loading-icon\").removeClass(\"hidden\");\n let assetArray = [];\n let selectedArray = $(\"#cantoViewBody\").find(\".single-image .icon-s-Ok2_32\").closest(\".single-image\");\n for (let i = 0; i < selectedArray.length; i++) {\n let obj = {};\n obj.id = $(selectedArray[i]).data(\"id\");\n obj.scheme = $(selectedArray[i]).data(\"scheme\");\n assetArray.push(obj);\n }\n cantoAPI.insertImage(assetArray);\n })\n // Allow for the insertion of the entire album into the target system\n .on(\"click\", \"#insertAlbumBtn\", function (e) {\n $(\"#cantoViewBody\").find(\".loading-icon\").removeClass(\"hidden\");\n let album = $(\"#treeviewSection\").find(\"li.selected\");\n const albumId = album.data('id');\n let albumName = album.find('span').text();\n cantoAPI.insertAlbum(albumId, albumName);\n })\n .on(\"click\", \".icon-s-Fullscreen\", function (e) {\n e.cancelBubble = true;\n e.stopPropagation();\n e.preventDefault();\n $(\"#cantoViewBody\").find(\".loading-icon\").removeClass(\"hidden\");\n let targetURL = $(e.currentTarget).closest(\".single-image\").data(\"xurl\");\n let previewURL = targetURL + \"?Authorization=\" + _accessToken;\n displayFullyImage(previewURL);\n })\n .on(\"click\", \".single-image\", function (e) {\n $(\"#cantoViewBody\").find(\".loading-icon\").removeClass(\"hidden\");\n //display image\n let targetURL = $(e.currentTarget).closest(\".single-image\").data(\"xurl\");\n let targetID = $(e.currentTarget).closest(\".single-image\").data(\"id\");\n cantoAPI.getHugeRedirectURL(targetURL, targetID);\n //display detail\n let id = $(this).data(\"id\");\n let scheme = $(this).data(\"scheme\");\n cantoAPI.getDetail(id, scheme, imageNewDetail);\n })\n .on(\"click\", \"#logoutBtn\", function (e) {\n $(\".loading-icon\").removeClass(\"hidden\");\n cantoAPI.logout();\n })\n //treeview event\n .on(\"click\", \"#treeviewSection ul li\", function (e) {\n e.cancelBubble = true;\n e.stopPropagation();\n e.preventDefault();\n let childList = $(e.currentTarget).children(\"ul\");\n // childList.toggleClass(\"hidden\");\n if (\"treeviewContent\" == $(e.currentTarget)[0].id) {\n //load init image list.\n $(\"#cantoViewBody\").find(\"#globalSearch input\").val(\"\");\n $(\"#cantoViewBody\").find(\"#treeviewSection ul li\").removeClass(\"selected\");\n $(\"#cantoViewBody\").find(\".type-font\").removeClass(\"current\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").scrollTop(0);\n currentImageList = [];\n searchedBy = \"\";\n isLoadingComplete = false;\n getImageInit(\"allfile\");\n\n } else if (childList && childList.length) {\n childList.animate({\n height: 'toggle'\n });\n } else if ($(e.currentTarget).hasClass(\"has-sub-folder\")) {\n let subTreeId = $(e.currentTarget).data(\"id\");\n $(e.currentTarget).addClass(\"current-tree-node\");\n $(e.currentTarget).find(\".folder-loading\").removeClass(\"hidden\");\n $(e.currentTarget).find(\".icon-s-Folder_open-20px\").addClass(\"hidden\");\n cantoAPI.loadSubTree(subTreeId, subTreeRender);\n\n } else {\n $(\"#treeviewSection ul li\").removeClass(\"selected\");\n $(\"#cantoViewBody\").find(\".type-font\").removeClass(\"current\");\n $(\"#insertAlbumWrapper\").removeClass(\"hidden\");\n $(e.currentTarget).addClass(\"selected\");\n $(\"#cantoViewBody\").find(\"#globalSearch input\").val(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").scrollTop(0);\n currentImageList = [];\n isLoadingComplete = false;\n searchedBy = \"bytree\";\n let albumId = $(e.currentTarget).data(\"id\");\n cantoAPI.getListByAlbum(albumId, imageListDisplay);\n }\n\n })\n .on(\"click\", \"#globalSearchBtn\", function (e) {\n let value = $(\"#cantoViewBody\").find(\"#globalSearch input\").val();\n if (!value) {\n //load init image list.\n $(\"#cantoViewBody\").find(\"#treeviewSection ul li\").removeClass(\"selected\");\n let initSchme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n $(\"#cantoViewBody\").find(\"#globalSearch input\").val(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").scrollTop(0);\n currentImageList = [];\n searchedBy = \"\";\n isLoadingComplete = false;\n getImageInit(initSchme);\n }\n searchedBy = \"bySearch\";\n isLoadingComplete = false;\n $(\"#cantoViewBody\").find(\"#treeviewSection ul li\").removeClass(\"selected\");\n $(\"#cantoViewBody\").find(\".type-font\").removeClass(\"current\");\n let initSchme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n let data = {};\n data.scheme = initSchme;\n data.keywords = value;\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n $(\"#cantoViewBody\").find(\"#imagesContent\").scrollTop(0);\n currentImageList = [];\n cantoAPI.getFilterList(data, imageListDisplay);\n });\n $(\"#cantoViewBody\").find(\"#cantoImageBody\").on(\"scroll\", function () {\n if (isScrollToPageBottom() && !isLoadingComplete) {\n loadMoreAction();\n }\n });\n\n let inputObj = $(\"#cantoViewBody\").find(\"#globalSearch input\");\n $(inputObj).bind('keyup', function (event) {\n if (event.keyCode == \"13\") {\n $(\"#cantoViewBody\").find('#globalSearchBtn').click();\n }\n });\n\n let imageListSection = $(\"#cantoViewBody\").find(\"#cantoImageBody\");\n $(imageListSection).resize(function () {\n imageResize();\n });\n}\n\nfunction getImageInit(scheme) {\n cantoAPI.getListByScheme(scheme, imageListDisplay);\n}\n\nfunction imageListDisplay(imageList) {\n if (!(imageList && imageList.length > 0)) {\n return;\n }\n let formatArr = [];\n if (_formatDistrict && _formatDistrict.length > 1) {\n formatArr = _formatDistrict.split(\";\");\n }\n for (let i = 0; i < imageList.length; i++) {\n let d = imageList[i];\n let extension = d.name.substring(d.name.lastIndexOf('.') + 1);\n if (formatArr.length && !formatArr.includes(extension)) {\n continue;\n }\n let html = \"\";\n let disname = d.name;\n if (d.name.length > 150) {\n disname = d.name.substr(0, 142) + '...' + d.name.substr(-5);\n }\n html += `
\n \n \n
${disname}
\n \n
`;\n $(\"#cantoViewBody\").find(\"#imagesContent\").append(html);\n cantoAPI.getRedirectURL(d.url.preview, d.id);\n }\n let currentCount = $(\"#cantoViewBody\").find('.single-image').length;\n if (currentCount == 0) {\n $(\"#cantoViewBody\").find(\"#noItem\").removeClass(\"hidden\");\n } else {\n $(\"#cantoViewBody\").find(\"#noItem\").addClass(\"hidden\");\n }\n let rem = [];\n $(\"#cantoViewBody\").find('.single-image').hover(function () {\n let nameTop = $(this).height() - $(this).find(\".single-image-name\").height() - 20;\n $(this).find('.single-image-name').stop().animate({top: nameTop});\n }, function () {\n $(this).find('.single-image-name').stop().animate({top: '100%'});\n });\n $(\"#cantoViewBody\").find('.single-image .select-box').off('click').on('click', function (e) {\n e.cancelBubble = true;\n e.stopPropagation();\n e.preventDefault();\n\n rem.push($(\".single-image\").index($(this).closest(\".single-image\")));\n if (e.shiftKey) {\n let iMin = Math.min(rem[rem.length - 2], rem[rem.length - 1]);\n let iMax = Math.max(rem[rem.length - 2], rem[rem.length - 1]);\n for (i = iMin; i <= iMax; i++) {\n let selectedCount = $(\"#cantoViewBody\").find(\".single-image .icon-s-Ok2_32\").length;\n if (selectedCount >= 20) {\n $(\".max-select-tips\").fadeIn(\"normal\").delay(2000).fadeOut(1000);\n return;\n }\n $(\".single-image:eq(\" + i + \") .select-box\").addClass(\"icon-s-Ok2_32\");\n $(\".single-image:eq(\" + i + \")\").addClass(\"selected\");\n }\n } else {\n let selectedCount = $(\"#cantoViewBody\").find(\".single-image .icon-s-Ok2_32\").length;\n if (selectedCount >= 20) {\n if (!$(this).hasClass(\"icon-s-Ok2_32\")) {\n $(\".max-select-tips\").fadeIn(\"normal\").delay(2000).fadeOut(1000);\n }\n $(this).removeClass(\"icon-s-Ok2_32\");\n $(this).closest(\".single-image\").removeClass(\"selected\");\n return;\n } else {\n $(this).toggleClass(\"icon-s-Ok2_32\");\n $(this).closest(\".single-image\").toggleClass(\"selected\");\n }\n\n }\n handleSelectedMode();\n });\n imageResize();\n handleSelectedMode();\n\n let bodyHeight = $(\"#cantoImageBody\").height();\n let documentHeight = $(\"#imagesContent\").height();\n if (documentHeight < bodyHeight && !isLoadingComplete) {\n loadMoreAction();\n }\n}\n\nlet handleSelectedMode = function () {\n let selectedCount = $(\"#cantoViewBody\").find(\".single-image .icon-s-Ok2_32\").length;\n $(\"#cantoViewBody\").find(\"#selected-count\").html(selectedCount);\n if (selectedCount) {\n $(\"#cantoViewBody\").find(\"#globalSearch\").addClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#filterSection\").addClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#selectedCountSection\").removeClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#selectedActionSection\").removeClass(\"hidden\");\n $(\"#insertAlbumWrapper\").addClass(\"hidden\");\n } else {\n $(\"#cantoViewBody\").find(\"#globalSearch\").removeClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#filterSection\").removeClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#selectedCountSection\").addClass(\"hidden\");\n $(\"#cantoViewBody\").find(\"#selectedActionSection\").addClass(\"hidden\");\n $(\"#insertAlbumWrapper\").removeClass(\"hidden\");\n }\n //toggle isAllSelectedMode\n $(\"#cantoViewBody\").find(\"#selectAllBtn\").addClass(\"all-selected\");\n $(\"#cantoViewBody\").find(\"#selectAllBtn\").attr(\"title\", \"Deselect All\");\n};\nlet resetImageURL = function (id, url) {\n let imgDom = $(\"#cantoViewBody\").find(\"#\" + id);\n let data = \"data:image\" + url;\n imgDom.attr(\"src\", data);\n};\n\nfunction displayFullyImage(src) {\n let $viewImageModal = $(\"#cantoViewBody\").find(\"#viewImageModal\");\n let $pageMask = $(\"#cantoViewBody\").find(\"#pageMask\");\n $viewImageModal.find(\"img\").attr(\"src\", src);\n $(\"#cantoViewBody\").find(\".loading-icon\").addClass(\"hidden\");\n $viewImageModal.removeClass(\"hidden\");\n $pageMask.removeClass(\"hidden\");\n $(\"#cantoViewBody\").find('.view-image-modal .close-btn').off('click').on('click', function () {\n $viewImageModal.addClass(\"hidden\");\n $pageMask.addClass(\"hidden\");\n });\n}\n\n\nfunction imageDetail(detailData) {\n if (detailData) {\n $(\"#cantoViewBody\").find(\"#imageDetailModal_name\").html(detailData.name);\n $(\"#cantoViewBody\").find(\"#imageDetailModal_size\").html(detailData.size + \"KB\");\n $(\"#cantoViewBody\").find(\"#imageDetailModal_created\").html(dateHandler(detailData.created));\n $(\"#cantoViewBody\").find(\"#imageDetailModal_uploaded\").html(dateHandler(detailData.lastUploaded));\n $(\"#cantoViewBody\").find(\"#imageDetailModal_status\").html(detailData.approvalStatus);\n $(\"#cantoViewBody\").find(\"#insertIntoPostBtn\").data(\"downloadurl\", detailData.url.download);\n\n let $imageDetailModal = $(\"#cantoViewBody\").find(\"#imageDetailModal\");\n $(\"#cantoViewBody\").find(\".loading-icon\").addClass(\"hidden\");\n $imageDetailModal.removeClass(\"hidden\");\n $(\"#cantoViewBody\").find('#imageDetailModal .close-btn').off('click').on('click', function () {\n $imageDetailModal.addClass(\"hidden\");\n });\n }\n}\n\nfunction imageNewDetail(detailData) {\n let sliceString = function (string, dom, length) {\n if (!string) {\n $(dom).closest(\".detail-item\").addClass(\"hidden\");\n return \"Null\";\n } else {\n $(dom).closest(\".detail-item\").removeClass(\"hidden\");\n }\n if (!length) {\n length = 150;\n }\n if (string.length > length) {\n $(dom).removeClass(\"hidden\");\n return string.slice(0, length) + \"...\";\n } else {\n $(dom).addClass(\"hidden\");\n return string;\n }\n };\n if (detailData) {\n $(\"#cantoViewBody\").find(\"#imagebox_name\").html(detailData.name);\n $(\"#cantoViewBody\").find(\"#imagebox_size\").html(Math.round(detailData.size / 1024) + \"KB\");\n $(\"#cantoViewBody\").find(\"#imagebox_created\").html(detailData.metadata ? (detailData.metadata[\"Create Date\"] ? detailData.metadata[\"Create Date\"] : \" \") : \" \");\n $(\"#cantoViewBody\").find(\"#imagebox_uploaded\").html(dateHandler(detailData.lastUploaded));\n $(\"#cantoViewBody\").find(\"#imagebox_status\").html(detailData.approvalStatus);\n let copyrightMoreDom = $(\"#imagebox_copyright\").closest(\".detail-item\").find(\".more\");\n $(\"#cantoViewBody\").find(\"#imagebox_copyright\").html(sliceString(detailData.copyright, copyrightMoreDom, 177));\n $(\"#cantoViewBody\").find(\"#imagebox_copyright\").data(\"field\", detailData.copyright);\n let tactMoreDom = $(\"#imagebox_tac\").closest(\".detail-item\").find(\".more\");\n $(\"#cantoViewBody\").find(\"#imagebox_tac\").html(sliceString(detailData.termsAndConditions, tactMoreDom, 160));\n $(\"#cantoViewBody\").find(\"#imagebox_tac\").data(\"field\", detailData.termsAndConditions);\n $(\"#cantoViewBody\").find(\"#insertBtn\").data(\"id\", detailData.id);\n $(\"#cantoViewBody\").find(\"#insertBtn\").data(\"scheme\", detailData.scheme);\n }\n\n let $imageDetailModal = $(\"#cantoViewBody\").find(\"#imagePreviewModal\");\n $(\"#cantoViewBody\").find(\".loading-icon\").addClass(\"hidden\");\n $imageDetailModal.removeClass(\"hidden\");\n $(\"#cantoViewBody\").find('#imagePreviewModal .close-btn').off('click').on('click', function () {\n $imageDetailModal.addClass(\"hidden\");\n });\n $(\"#cantoViewBody\").find('#imagePreviewModal #cancelBtn').off('click').on('click', function () {\n $imageDetailModal.addClass(\"hidden\");\n });\n $(\"#cantoViewBody\").find('#imagePreviewModal .detail-item .more').off('click').on('click', function () {\n let text = $(this).closest(\".detail-item\").find(\".content\").data(\"field\");\n $(this).closest(\".detail-item\").find(\".content\").html(text);\n $(this).addClass(\"hidden\");\n });\n $(\"#cantoViewBody\").find('#imagePreviewModal #insertBtn').off('click').on('click', function () {\n $(\"#cantoViewBody\").find(\".loading-icon\").removeClass(\"hidden\");\n let assetArray = [\n {\n id: detailData.id,\n scheme: detailData.scheme,\n }\n ];\n cantoAPI.insertImage(assetArray);\n });\n}\n\nfunction dateHandler(str) {\n return str.substr(0, 4) + '-' + str.substr(4, 2) + '-'\n + str.substr(6, 2) + ' ' + str.substr(8, 2) + ':' + str.substr(10, 2);\n}\n\nfunction treeviewDataHandler() {\n cantoAPI.loadTree(treeviewController);\n}\n\nlet treeviewController = function (dummyData) {\n let html = \"\";\n html = treeviewFirstRender(dummyData);\n $(\"#cantoViewBody\").find(\"#treeviewContent\").append(html);\n $(\"#cantoViewBody\").find(\"#treeviewContent > ul\").animate({\n height: 'toggle'\n });\n\n};\nlet treeviewFirstRender = function (data) {\n let html = \"
\";\n $.each(data, function (i, d) {\n let listclass = \" \";\n if (d.size == 0) {\n listclass = \"no-child\";\n } else if (d.scheme == \"folder\") {\n listclass = \"has-sub-folder\";\n }\n html += `
`;\n let iconStyle = \"icon-s-Folder_open-20px\";\n if (d.scheme == \"album\") {\n iconStyle = \"icon-s-Album-20px\";\n }\n html += `\n \n ${d.name}\n
`;\n });\n html += \"
\";\n return html;\n};\nlet subTreeRender = function (data) {\n let html = treeviewRender(data);\n $(\"#cantoViewBody\").find(\".current-tree-node\").append(html);\n $(\"#cantoViewBody\").find(\".current-tree-node > ul\").animate({\n height: 'toggle'\n });\n $(\"#cantoViewBody\").find(\".current-tree-node\").find(\".folder-loading\").addClass(\"hidden\");\n $(\"#cantoViewBody\").find(\".current-tree-node\").find(\".icon-s-Folder_open-20px\").removeClass(\"hidden\");\n $(\"#cantoViewBody\").find(\".current-tree-node\").removeClass(\"current-tree-node\");\n};\nlet treeviewRender = function (data) {\n let html = \"
\";\n $.each(data, function (i, d) {\n let listclass = \" \";\n if (d.size == 0) {\n listclass = \"no-child\";\n }\n html += `
`;\n let iconStyle = \"icon-s-Folder_open-20px\";\n if (d.scheme == \"album\") {\n iconStyle = \"icon-s-Album-20px\";\n }\n html += `\n ${d.name}`;\n if (d.children && d.children.length) {\n html += treeviewRender(d.children);\n }\n html += '
';\n });\n html += \"
\";\n return html;\n};\n\nfunction imageResize() {\n let initCount = 8;\n // let totalWidth = totalWidth = Number($(\"#cantoViewBody\").find(\"#imagesContent\")[0].offsetWidth);\n let totalWidth = Number($(\"#cantoViewBody\").find(\"#imagesContent\")[0].offsetWidth);\n let singleImageWidth = 0;\n let getCountInALine = function (n) {\n singleImageWidth = Number((totalWidth - 8) / n - 2);\n if ((singleImageWidth >= 160) && (singleImageWidth <= 210)) {\n return singleImageWidth;\n } else if (singleImageWidth < 160) {\n n--;\n getCountInALine(n);\n } else if (singleImageWidth > 210) {\n n++;\n getCountInALine(n);\n }\n };\n let singleWidth = getCountInALine(initCount);\n $(\"#cantoViewBody\").find('.single-image').css(\"width\", singleWidth);\n}\n\n//scroll to load more\n\nfunction isScrollToPageBottom() {\n let bodyHeight = $(\"#cantoImageBody\").height();\n let documentHeight = $(\"#imagesContent\").height();\n let scrollHeight = $(\"#cantoImageBody\").scrollTop();\n let isToBottom = documentHeight - bodyHeight - scrollHeight < 0;\n let nowCount = $(\".single-image\").length == 0;\n return isToBottom && !nowCount;\n}\n\nfunction loadMoreHandler(limit) {\n let start = currentImageList.length == 0 ? 0 : apiNextStart;\n let filterString = \"sortBy=time&sortDirection=descending&limit=\" + limit + \"&start=\" + start;\n let imageCount = $(\".single-image\").length;\n if (imageCount !== 0) {\n $(\"#loadingMore\").fadeIn(\"slow\");\n } else {\n $(\"#cantoViewBody\").find(\"#imagesContent\").html(\"\");\n }\n return filterString;\n}\n\nfunction loadMoreAction() {\n if (searchedBy == \"bySearch\") {\n let value = $(\"#cantoViewBody\").find(\"#globalSearch input\").val();\n if (!value) {\n return;\n }\n let initSchme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n let data = {};\n data.scheme = initSchme;\n data.keywords = value;\n cantoAPI.getFilterList(data, imageListDisplay);\n } else if (searchedBy == \"bytree\") {\n let albumId = $(\"#cantoViewBody\").find(\"#treeviewSection ul li\").find(\".selected\").data(\"id\");\n cantoAPI.getListByAlbum(albumId, imageListDisplay);\n } else {\n let initSchme = $(\"#cantoViewBody\").find(\".type-font.current\").data(\"type\");\n getImageInit(initSchme);\n }\n}\n\nfunction uploadFileToCanto(e) {\n let url = `https://${_tenants}/api/v1/upload/setting`;\n fetch(url, {\n method: \"GET\",\n headers: {\n \"Authorization\": `${_tokenType} ${_accessToken}`,\n \"Content-Type\": \"application/json; charset=utf-8\"\n },\n }).then(response => {\n return response.json();\n }).then(data => {\n const formData = new FormData();\n formData.append(\"key\", data.key);\n formData.append(\"acl\", data.acl);\n formData.append(\"AWSAccessKeyId\", data.AWSAccessKeyId);\n formData.append(\"Policy\", data.Policy);\n formData.append(\"Signature\", data.Signature);\n formData.append(\"x-amz-meta-file_name\", e.currentTarget.files[0].name);\n formData.append(\"x-amz-meta-tag\", \"\");\n formData.append(\"x-amz-meta-scheme\", \"\");\n formData.append(\"x-amz-meta-id\", \"\");\n formData.append(\"x-amz-meta-album_id\", \"\");\n formData.append(\"file\", e.currentTarget.files[0]);\n let statusBar = parent.document.querySelector(\".modal-status-bar\");\n\n fetch(data.url, {\n method: \"post\",\n body: formData,\n mode: \"no-cors\",\n redirect: 'follow'\n }).then(response => {\n document.getElementById(\"uploadBtn\").style.background = \"linear-gradient(16deg, rgb(205 101 1) 0%, rgb(169 218 0 / 100%) 100%)\";\n document.getElementById(\"uploadBtn\").value = \"Uploading image...\";\n }).catch(error => {\n console.log(error);\n }).finally(() => {\n document.getElementById(\"uploadBtn\").value = \"Upload complete - processing\";\n checkStatusInterval(e.currentTarget.files[0].name);\n });\n }).catch(error => {\n console.log(\"An error occurred while attempting to grab upload settings!\");\n console.log(error);\n });\n\n function checkStatusInterval(filename) {\n let url = `https://${_tenants}/api/v1/upload/status?hours=1`;\n let statusBar = parent.document.querySelector(\".modal-status-bar\");\n setInterval(() => {\n\n fetch(url, {\n method: \"get\",\n headers: {\"Authorization\": _tokenType + \" \" + _accessToken},\n }).then(response => {\n return response.json();\n }).then(body => {\n if (body.results && body.results.length > 0) {\n let results = body.results.filter(e => {\n if (e.name == filename && e.status != \"Done\") {\n return e;\n }\n });\n if (results.filter(e => e != undefined).length == 0) {\n document.getElementById(\"uploadBtn\").value = \"Canto processing complete! Reloading\";\n window.location.reload();\n }\n }\n }).catch(error => {\n console.log(\"an error occurred!\");\n console.log(error)\n });\n }, 5000);\n }\n\n}\n\nparent.document.querySelector(\".modal-status-bar\").style.display = \"none\";\n\n// Accept HMR as per: https://vitejs.dev/guide/api-hmr.html\nif (import.meta.hot) {\n import.meta.hot.accept(() => {\n console.log(\"HMR\")\n });\n}\n\n"],"names":["_accessToken","_tokenType","_tenants","cantoAPI","_APIHeaders","searchedBy","currentImageList","singleCountLoad","apiNextStart","isLoadingComplete","_formatDistrict","MAX_CONTENT_REQUEST_ITEMS","MAX_ALBUM_REQUEST_ITEMS","setToken","tokenInfo","callback","url","request","data","treeID","albumID","filterString","loadMoreHandler","previewURL","ID","scheme","contentID","targetWindow","buffer","albumId","start","result","response","imageArray","imageArraySubset","id","album","albumName","error","getFrameDom","addEventListener","getTokenInfo","event","treeviewDataHandler","initSchme","getImageInit","contentIframe","e","uploadFileToCanto","imageResize","imageListDisplay","handleSelectedMode","assetArray","selectedArray","i","obj","displayFullyImage","targetURL","targetID","imageNewDetail","childList","subTreeId","subTreeRender","value","isScrollToPageBottom","loadMoreAction","inputObj","imageListSection","imageList","formatArr","extension","html","disname","rem","nameTop","iMin","iMax","bodyHeight","selectedCount","src","$viewImageModal","$pageMask","detailData","sliceString","string","dom","length","dateHandler","copyrightMoreDom","tactMoreDom","$imageDetailModal","text","str","treeviewController","dummyData","treeviewFirstRender","d","listclass","iconStyle","treeviewRender","initCount","totalWidth","singleImageWidth","getCountInALine","n","singleWidth","documentHeight","scrollHeight","isToBottom","nowCount","limit","formData","checkStatusInterval","filename","body"],"mappings":"AACA,IAAIA,EAAe,GAEfC,EAAa,GACbC,EAAW,GACXC,EAAW,CAAA,EACXC,EAAc,CAAA,EACdC,EAAa,GACbC,EAAmB,CAAA,EACnBC,EAAkB,GAClBC,EAAe,EACfC,EAAoB,GACpBC,EAAkB,GACtB,MAAMC,EAA4B,IAC5BC,EAA0B,IAIhC,SAASC,EAASC,EAAW,CAC3Bd,EAAec,EAAU,YACzBZ,EAAWY,EAAU,OACrBb,EAAaa,EAAU,UAAYA,EAAU,UAAY,SACzDV,EAAc,CACZ,cAAiBH,EAAa,IAAMD,EACpC,eAAgB,mCACpB,EACEU,EAAkBI,EAAU,cAC9B,CAGAX,EAAS,SAAW,SAAUY,EAAU,CACtC,IAAIC,EAAM,WAAad,EAAW,2DAClC,EAAE,KAAK,CACL,QAASE,EACT,KAAM,MACN,IAAKY,EACL,MAAO,GACP,MAAO,SAAUC,EAAS,CACxB,MAAM,iBAAiB,CACxB,EACD,QAAS,SAAUC,EAAM,CACvBH,EAASG,EAAK,OAAO,CACtB,CACL,CAAG,CACH,EACAf,EAAS,YAAc,SAAUgB,EAAQJ,EAAU,CACjD,IAAIC,E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AU,IAChD,SAAS,eAAe,WAAW,EAAE,MAAQ,uCAC7C,OAAO,SAAS,SAG5B,CAAO,EAAE,MAAMT,GAAS,CAChB,QAAQ,IAAI,oBAAoB,EAChC,QAAQ,IAAIA,CAAK,CACzB,CAAO,CACF,EAAE,GAAI,CACR,CAEH,CAEA,OAAO,SAAS,cAAc,mBAAmB,EAAE,MAAM,QAAU"}
\ No newline at end of file
diff --git a/src/web/assets/dist/assets/canto-embed-f0b95696.js.map.gz b/src/web/assets/dist/assets/canto-embed-f0b95696.js.map.gz
new file mode 100644
index 0000000..1701ead
Binary files /dev/null and b/src/web/assets/dist/assets/canto-embed-f0b95696.js.map.gz differ
diff --git a/src/web/assets/dist/assets/canto-field-ce0b6f6c.js b/src/web/assets/dist/assets/canto-field-ce0b6f6c.js
new file mode 100644
index 0000000..d1f756d
--- /dev/null
+++ b/src/web/assets/dist/assets/canto-field-ce0b6f6c.js
@@ -0,0 +1,17 @@
+(function(t){let d={},f,g,p,C,v;const r="CantoDamConnector",b={env:"canto.com"};function y(a,n){this.element=a,this.options=t.extend({},b,n),this._defaults=b,this._name=r,this.init()}y.prototype={init:function(){t(()=>{I(this.options);const a=o=>"#"+this.options.prefix+"-"+Craft.namespaceId(o,this.options.id),n=a("damAssetPreview");function m(){const o=a("damAssetPreviewWrapper");if(t(o).remove(),t(n).attr("data-thumbnailurl")==null||t(n).attr("data-thumbnailurl")=="none")t(n).hide();else{const e=t(n).attr("data-thumbnailurl"),l=t(n).attr("data-albumName");let i=t(n).attr("data-thumbnailName");const c=t(n).attr("data-assetCount"),u=c==1?"":"canto-asset-preview-stack";i=c==1?i:`${c} images`,l.length&&(i+=" / "+l),t(a("chooseAsset")).html("Choose a Different DAM Asset"),t(n).prepend(`
+