@canonry/canonry 7.58.3 → 7.58.4
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.
- package/assets/assets/{AgentSetupPage-CRvCLiCD.js → AgentSetupPage-CoD9a386.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-B3qnQtNg.js → MeasurementPropertyPage-BZmvjMiS.js} +1 -1
- package/assets/assets/{ProjectPage-j9V9UFfY.js → ProjectPage-DMIoYBCF.js} +2 -2
- package/assets/assets/{RunsPage-CvqCrsiH.js → RunsPage-DtvesLu2.js} +1 -1
- package/assets/assets/{SettingsPage-CX5Rzsm3.js → SettingsPage-BjE3d5Ae.js} +1 -1
- package/assets/assets/{SiteHealthSection-CYKyJBaJ.js → SiteHealthSection-D6RLbM2o.js} +2 -2
- package/assets/assets/{TrafficPage-DNC0DP-U.js → TrafficPage-CHZlfMgd.js} +1 -1
- package/assets/assets/{index-CQwjYVPD.js → index-CgAMnZFS.js} +5 -5
- package/assets/assets/index-DElT2Fss.css +1 -0
- package/assets/assets/{react-sigma_core.esm.min-BNkIcXRz.js → react-sigma_core.esm.min-TGwpCHs4.js} +1 -1
- package/assets/assets/{service-CWdIU_mf.js → service-CUJkePNp.js} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-SXGLLWS4.js → chunk-6A6BD5KS.js} +1 -1
- package/dist/{chunk-JDRKZOUP.js → chunk-BNGGUL7F.js} +1 -1
- package/dist/{chunk-BDUHO7KK.js → chunk-CFGA6OAK.js} +4 -4
- package/dist/{cli-commands-3HTHHRXT.js → cli-commands-JBLV55EA.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{demo-TPOKI7ZM.js → demo-F5TRWB6V.js} +1 -1
- package/dist/{demo-server-ZBNKYYM2.js → demo-server-WIVTG6GH.js} +151 -5
- package/dist/index.js +1 -1
- package/dist/{init-4IKMMWAD.js → init-LABWY7HI.js} +1 -1
- package/dist/{serve-2AOLGG3F.js → serve-3WJL5N2Z.js} +1 -1
- package/package.json +1 -1
- package/assets/assets/index-B662I7kR.css +0 -1
package/assets/assets/{react-sigma_core.esm.min-BNkIcXRz.js → react-sigma_core.esm.min-TGwpCHs4.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{rt as n}from"./vendor-lucide-4KkDquAu.js";import{c as r,l as i}from"./SiteHealthSection-
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{rt as n}from"./vendor-lucide-4KkDquAu.js";import{c as r,l as i}from"./SiteHealthSection-D6RLbM2o.js";var a=e(n(),1);function o(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){if(e){if(typeof e==`string`)return o(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function c(e){if(Array.isArray(e))return e}function l(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function u(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(e,t){return c(e)||l(e,t)||s(e,t)||u()}function f(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=s(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(c)throw a}}}}function p(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function m(e,t,n){return e[0]=t,e[4]=typeof n==`number`?n:t,e}function h(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function g(e,t,n){return e[6]=t,e[7]=n,e}function _(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=t[0],f=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8];return e[0]=d*n+f*a+p*c,e[1]=d*r+f*o+p*l,e[2]=d*i+f*s+p*u,e[3]=m*n+h*a+g*c,e[4]=m*r+h*o+g*l,e[5]=m*i+h*s+g*u,e[6]=_*n+v*a+y*c,e[7]=_*r+v*o+y*l,e[8]=_*i+v*s+y*u,e}function v(e,t){var n=Math.cos(t),r=Math.sin(t);return{x:n*e.x+r*e.y,y:-r*e.x+n*e.y}}function y(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],i=e[1],a=e[3],o=e[4],s=e[6],c=e[7],l=t.x,u=t.y;return{x:l*r+u*a+s*n,y:l*i+u*o+c*n}}function b(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function x(e,t,n,r,i){var a=e.angle,o=e.ratio,s=e.x,c=e.y,l=t.width,u=t.height,d=p(),f=Math.min(l,u)-2*r,v=b(t,n);return i?(_(d,g(p(),s,c)),_(d,m(p(),o)),_(d,h(p(),a)),_(d,m(p(),l/f/2/v,u/f/2/v))):(_(d,m(p(),f/l*2*v,f/u*2*v)),_(d,h(p(),-a)),_(d,m(p(),1/o)),_(d,g(p(),-s,-c))),d}function S(e,t,n){var r=y(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),i=r.x,a=r.y;return 1/Math.sqrt(i**2+a**2)/n.width}function C(e,t,n,r,i){return[Math.floor(t/i*r),Math.floor(e.drawingBufferHeight/i-n/i*r)]}var w={black:`#000000`,silver:`#C0C0C0`,gray:`#808080`,grey:`#808080`,white:`#FFFFFF`,maroon:`#800000`,red:`#FF0000`,purple:`#800080`,fuchsia:`#FF00FF`,green:`#008000`,lime:`#00FF00`,olive:`#808000`,yellow:`#FFFF00`,navy:`#000080`,blue:`#0000FF`,teal:`#008080`,aqua:`#00FFFF`,darkblue:`#00008B`,mediumblue:`#0000CD`,darkgreen:`#006400`,darkcyan:`#008B8B`,deepskyblue:`#00BFFF`,darkturquoise:`#00CED1`,mediumspringgreen:`#00FA9A`,springgreen:`#00FF7F`,cyan:`#00FFFF`,midnightblue:`#191970`,dodgerblue:`#1E90FF`,lightseagreen:`#20B2AA`,forestgreen:`#228B22`,seagreen:`#2E8B57`,darkslategray:`#2F4F4F`,darkslategrey:`#2F4F4F`,limegreen:`#32CD32`,mediumseagreen:`#3CB371`,turquoise:`#40E0D0`,royalblue:`#4169E1`,steelblue:`#4682B4`,darkslateblue:`#483D8B`,mediumturquoise:`#48D1CC`,indigo:`#4B0082`,darkolivegreen:`#556B2F`,cadetblue:`#5F9EA0`,cornflowerblue:`#6495ED`,rebeccapurple:`#663399`,mediumaquamarine:`#66CDAA`,dimgray:`#696969`,dimgrey:`#696969`,slateblue:`#6A5ACD`,olivedrab:`#6B8E23`,slategray:`#708090`,slategrey:`#708090`,lightslategray:`#778899`,lightslategrey:`#778899`,mediumslateblue:`#7B68EE`,lawngreen:`#7CFC00`,chartreuse:`#7FFF00`,aquamarine:`#7FFFD4`,skyblue:`#87CEEB`,lightskyblue:`#87CEFA`,blueviolet:`#8A2BE2`,darkred:`#8B0000`,darkmagenta:`#8B008B`,saddlebrown:`#8B4513`,darkseagreen:`#8FBC8F`,lightgreen:`#90EE90`,mediumpurple:`#9370DB`,darkviolet:`#9400D3`,palegreen:`#98FB98`,darkorchid:`#9932CC`,yellowgreen:`#9ACD32`,sienna:`#A0522D`,brown:`#A52A2A`,darkgray:`#A9A9A9`,darkgrey:`#A9A9A9`,lightblue:`#ADD8E6`,greenyellow:`#ADFF2F`,paleturquoise:`#AFEEEE`,lightsteelblue:`#B0C4DE`,powderblue:`#B0E0E6`,firebrick:`#B22222`,darkgoldenrod:`#B8860B`,mediumorchid:`#BA55D3`,rosybrown:`#BC8F8F`,darkkhaki:`#BDB76B`,mediumvioletred:`#C71585`,indianred:`#CD5C5C`,peru:`#CD853F`,chocolate:`#D2691E`,tan:`#D2B48C`,lightgray:`#D3D3D3`,lightgrey:`#D3D3D3`,thistle:`#D8BFD8`,orchid:`#DA70D6`,goldenrod:`#DAA520`,palevioletred:`#DB7093`,crimson:`#DC143C`,gainsboro:`#DCDCDC`,plum:`#DDA0DD`,burlywood:`#DEB887`,lightcyan:`#E0FFFF`,lavender:`#E6E6FA`,darksalmon:`#E9967A`,violet:`#EE82EE`,palegoldenrod:`#EEE8AA`,lightcoral:`#F08080`,khaki:`#F0E68C`,aliceblue:`#F0F8FF`,honeydew:`#F0FFF0`,azure:`#F0FFFF`,sandybrown:`#F4A460`,wheat:`#F5DEB3`,beige:`#F5F5DC`,whitesmoke:`#F5F5F5`,mintcream:`#F5FFFA`,ghostwhite:`#F8F8FF`,salmon:`#FA8072`,antiquewhite:`#FAEBD7`,linen:`#FAF0E6`,lightgoldenrodyellow:`#FAFAD2`,oldlace:`#FDF5E6`,magenta:`#FF00FF`,deeppink:`#FF1493`,orangered:`#FF4500`,tomato:`#FF6347`,hotpink:`#FF69B4`,coral:`#FF7F50`,darkorange:`#FF8C00`,lightsalmon:`#FFA07A`,orange:`#FFA500`,lightpink:`#FFB6C1`,pink:`#FFC0CB`,gold:`#FFD700`,peachpuff:`#FFDAB9`,navajowhite:`#FFDEAD`,moccasin:`#FFE4B5`,bisque:`#FFE4C4`,mistyrose:`#FFE4E1`,blanchedalmond:`#FFEBCD`,papayawhip:`#FFEFD5`,lavenderblush:`#FFF0F5`,seashell:`#FFF5EE`,cornsilk:`#FFF8DC`,lemonchiffon:`#FFFACD`,floralwhite:`#FFFAF0`,snow:`#FFFAFA`,lightyellow:`#FFFFE0`,ivory:`#FFFFF0`},T=new Int8Array(4),E=new Int32Array(T.buffer,0,1),D=new Float32Array(T.buffer,0,1),O=/^\s*rgba?\s*\(/,k=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function A(e){var t=0,n=0,r=0,i=1,a=e.toLowerCase();if(a===`transparent`)return{r:0,g:0,b:0,a:0};if(a in w)return A(w[a]);if(e[0]===`#`)e.length===4?(t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),r=parseInt(e.charAt(5)+e.charAt(6),16)),e.length===9&&(i=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(O.test(e)){var o=e.match(k);o&&(t=+o[1],n=+o[2],r=+o[3],o[4]&&(i=+o[4]))}return{r:t,g:n,b:r,a:i}}function j(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=A(e),r=n.r,i=n.g,a=n.b,o=n.a;return t?[r/255*o,i/255*o,a/255*o,o]:[r/255,i/255,a/255,o]}var M={};for(var N in w)M[N]=F(w[N]),M[w[N]]=M[N];function P(e,t,n,r,i){return E[0]=r<<24|n<<16|t<<8|e,i&&(E[0]&=4278190079),D[0]}function F(e){if(e=e.toLowerCase(),M[e]!==void 0)return M[e];var t=A(e),n=t.r,r=t.g,i=t.b,a=t.a;a=a*255|0;var o=P(n,r,i,a,!0);return M[e]=o,o}function I(e,t){D[0]=F(e);var n=E[0];return t&&(n|=16777216),[n&255,n>>8&255,n>>16&255,n>>24&255]}function ee(e){var t=e>>>8&255,n=e>>>16&255,r=e>>>24&255;return((e&255)<<24|r<<16|n<<8|t)>>>0}function te(e,t,n,r){return(n<<24|t<<16|e<<8|r)>>>0}function L(e,t,n,r,i,a){var o=d(C(e,n,r,i,a),2),s=o[0],c=o[1],l=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(s,c,1,1,e.RGBA,e.UNSIGNED_BYTE,l);var u=d(l,4);return[u[0],u[1],u[2],u[3]]}function ne(e){var t=A(e),n=t.r,r=t.g,i=t.b,a=t.a;return`vec4(${(n/255).toFixed(6)}, ${(r/255).toFixed(6)}, ${(i/255).toFixed(6)}, ${a.toFixed(6)})`}function re(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ie(e){var t=re(e,`string`);return typeof t==`symbol`?t:t+``}function R(e,t,n){return(t=ie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ae(Object(n),!0).forEach(function(t){R(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function B(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function oe(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,ie(r.key),r)}}function V(e,t,n){return t&&oe(e.prototype,t),n&&oe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function se(e){return se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},se(e)}function ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ce=function(){return!!e})()}function le(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function ue(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return le(e)}function H(e,t,n){return t=se(t),ue(e,ce()?Reflect.construct(t,n||[],se(e).constructor):t.apply(e,n))}function de(e,t){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},de(e,t)}function U(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&de(e,t)}function fe(e){if(Array.isArray(e))return o(e)}function pe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function me(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W(e){return fe(e)||pe(e)||s(e)||me()}function G(e){"@babel/helpers - typeof";return G=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},G(e)}function he(e){return G(e)===`object`&&e!==null&&`attribute`in e}function ge(){return{name:`circle`,glsl:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{G as t,U as n,W as r,rt as i}from"./vendor-lucide-4KkDquAu.js";import{n as a,r as o}from"./vendor-markdown-9SSeLNHZ.js";import{Ao as s,Fo as c,Go as l,Ho as u,Io as d,Jo as f,Ko as p,Lo as m,Ma as h,Mo as g,No as _,Po as v,Qo as y,Ra as b,Ro as x,Uo as S,Vo as C,Wo as w,Xo as T,Yo as E,Zo as D,a as O,jo as k,pt as A,qo as j,r as M,vt as N,zo as P}from"./ToneBadge-DYEbxp5S.js";import{x as F}from"./format-helpers-DOEct2q8.js";import{at as I,rt as L}from"./index-CQwjYVPD.js";var R=e(i(),1),z=o(),B=`Sources`,V={copy:`Copy answer`,copying:`Copying…`,copied:`Copied`,failed:`Could not copy. Select and copy the answer above.`};function H({previewLength:e,highlight:t}){return n=>{if(e!==void 0&&Number.isFinite(e)){let t=Math.max(0,Math.floor(e)),r={field:`value`,omitted:!1},i=e=>{if(e.type===`definition`)return!0;if(e.children)return e.children=e.children.filter(i),e.children.length>0;let n=e.type===`image`||e.type===`imageReference`?`alt`:`value`,a=e[n];if(a===void 0)return t>0;let o=Array.from(a);if(o.length===0)return t>0;if(t===0)return r.omitted=!0,!1;let s=o.length>t,c=o.slice(0,t);if(s&&!/\s/.test(o[t])){let e=c.length-1;for(;e>=0&&!/\s/.test(c[e]);)e--;e>=0&&e>t-40&&(c.length=e)}return r.omitted||=s,e[n]=c.join(``),t=s?0:t-c.length,c.length!==0&&(r.lastNode=e,r.field=n,!0)};i(n),r.omitted&&(r.lastNode?r.lastNode[r.field]=`${r.lastNode[r.field].trimEnd()}…`:n.children?.push({type:`paragraph`,children:[{type:`text`,value:`…`}]}))}if(t){let e=t=>{[`link`,`linkReference`,`code`,`inlineCode`].includes(t.type)||(t.type===`text`&&(t.data={...t.data,hName:`span`}),t.children?.forEach(e))};e(n)}}}function U({headingLevel:e}){return t=>{let n=[],r=e=>{e.type===`heading`&&e.depth&&n.push(e),e.children?.forEach(r)};r(t);let i=n.reduce((e,t)=>Math.min(e,t.depth),6);for(let t of n){let n=t.depth-i;t.depth=Math.min(6,e+n),t.data={...t.data,hProperties:{...t.data?.hProperties,"data-answer-heading-level":n+1}}}}}function W({answer:e}){let[t,n]=(0,R.useState)(`idle`),r=(0,R.useRef)(!1),i=async()=>{if(!r.current){r.current=!0,n(`copying`);try{await navigator.clipboard.writeText(e),n(`copied`)}catch{n(`failed`)}finally{r.current=!1}}};return(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-3`,children:[(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:`min-h-11 px-2`,"aria-disabled":t===`copying`,"aria-busy":t===`copying`,onClick:()=>{i()},children:t===`copying`?V.copying:V.copy}),(0,z.jsx)(`span`,{role:`status`,className:`text-sm text-secondary`,children:t===`copied`?V.copied:t===`failed`?V.failed:``})]})}var G=(0,R.memo)(function({children:e,headingLevel:t=4,copyable:n=!1,highlightGroups:r,previewLength:i}){return(0,z.jsxs)(`div`,{className:`answer-markdown`,children:[(0,z.jsx)(a,{remarkPlugins:[[U,{headingLevel:t}],[H,{previewLength:i,highlight:!!r?.length}]],components:{p:({children:e})=>(0,z.jsx)(`p`,{className:`mb-3 whitespace-pre-wrap last:mb-0`,children:e}),ul:({children:e})=>(0,z.jsx)(`ul`,{className:`mb-3 ml-5 list-disc space-y-1`,children:e}),ol:({children:e,start:t})=>(0,z.jsx)(`ol`,{start:t,className:`mb-3 ml-5 list-decimal space-y-1`,children:e}),pre:({children:e})=>(0,z.jsx)(`pre`,{className:`mb-3 overflow-x-auto whitespace-pre-wrap`,children:e}),span:({children:e})=>(0,z.jsx)(`span`,{children:typeof e==`string`&&r?e.split(/(https?:\/\/[^\s<>]+)/i).map((e,t)=>t%2?e:(0,z.jsx)(R.Fragment,{children:L(e,r)},t)):e}),a:({children:e,href:t})=>{let n=I(t);return n?(0,z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`text-link underline`,children:e}):(0,z.jsx)(`span`,{children:e})},img:({alt:e})=>(0,z.jsx)(`span`,{children:e})},children:e}),n&&e.trim()?(0,z.jsx)(W,{answer:e},e):null]})}),K=`min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,q=`flex min-h-11 w-full items-center justify-between gap-3 rounded px-2 text-left text-sm text-primary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,J=e=>e.kind===`project`?`Whole site`:e.label,Y={allMarkets:`All markets`,browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:`Browse all properties`},ee=e=>e?.kind===`group`&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,X=e=>`${e} ${e===1?`property`:`properties`}`;function te({options:e,selected:i,onSelect:a,marketKey:o,label:s=`Measurement scope`,labelVisibility:c=`visible`,allowGroupSelect:l=!0}){let u=[...e].sort((e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0})||e.id.localeCompare(t.id)),[d,f]=(0,R.useState)(``),[p,m]=(0,R.useState)([]),[h,g]=(0,R.useState)(!1),_=(0,R.useRef)(null),v=(0,R.useRef)(null),y=(0,R.useId)(),b=u.filter(e=>e.kind===`group`),x=new Map(b.map(e=>[e.id,e])),S=x.get(p.at(-1)??``),C=x.get(p.at(-2)??``),w=d.trim().toLocaleLowerCase(),T=b.filter(e=>!e.parentGroupIds?.some(e=>x.has(e))),E=u.filter(e=>e.kind===`property`),D=e=>(e.parentGroupIds??[]).map(e=>x.get(e)?.label).filter(Boolean).join(` · `),O=e=>`${J(e)} ${D(e)}`.toLocaleLowerCase().includes(w),k=e=>{let t=[...e.parentGroupIds??[]],n=new Set;for(;t.length;){let e=t.pop();if(e===S?.id)return!0;n.has(e)||(n.add(e),t.push(...x.get(e)?.parentGroupIds??[]))}return!1},A=(h?[]:S?b.filter(e=>w?k(e):e.parentGroupIds?.includes(S.id)):w?b:T).filter(O),j=u.find(e=>e.kind===`market`&&e.id===(o??(i.kind===`market`?i.id:void 0))),M=S&&j&&(S.marketKeys?.includes(j.id)||j.parentGroupIds?.includes(S.id))?j.id:void 0,N=l?M??ee(S):void 0,P=(S?E.filter(e=>e.parentGroupIds?.includes(S.id)&&(!N||e.marketKeys?.includes(N))):w||h||b.length===0?E:[]).filter(O),F=u.filter(e=>e.kind!==`market`||h||!l&&!S&&!w&&b.length>0||l&&S?.marketKeys?.length===1&&!w?!1:(S?w?k(e):e.parentGroupIds?.includes(S.id):w||!e.parentGroupIds?.some(e=>x.has(e)))&&O(e)),I=S||h?[]:u.filter(e=>e.kind===`project`&&O(e));(0,R.useEffect)(()=>{let e=e=>{_.current?.open&&e.target instanceof Node&&!_.current.contains(e.target)&&(_.current.open=!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[]);let L=e=>{_.current&&(_.current.open=!1,_.current.querySelector(`summary`)?.focus());let t=l?e.kind===`property`?N:e.kind===`group`&&e.id===S?.id?M:void 0:void 0;t?a(e,t):a(e)},B=e=>{let t=[],n=x.get(e.parentGroupIds?.[0]??``);for(;n&&!t.includes(n.id)&&n.id!==e.id;)t.unshift(n.id),n=x.get(n.parentGroupIds?.[0]??``);return[...t,e.id]},V=()=>{let e=i.kind===`group`?x.get(i.id):void 0,t=x.get(j?.parentGroupIds?.[0]??``),n=(i.parentGroupIds??[]).flatMap(e=>{let t=x.get(e);return t?[B(t)]:[]}),r=n.find(e=>e.at(-1)===S?.id)??n.sort((e,t)=>t.length-e.length)[0]??[],a=t?B(t):i.marketKeys?.length?[]:r;m(e?B(e):a),g(i.kind===`property`&&a.length===0&&b.length>0),f(``)},H=e=>{m(B(e)),g(!1),f(``),v.current?.focus()},U=(e,t=J(e))=>(0,z.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,z.jsxs)(`button`,{type:`button`,className:q,"aria-label":e.kind===`group`&&!l?Y.browse(J(e)):Y.select(J(e)),"aria-current":i.kind===e.kind&&i.id===e.id?`true`:void 0,onClick:()=>e.kind===`group`&&!l?H(e):L(e),children:[(0,z.jsxs)(`span`,{className:`min-w-0 break-words`,children:[t,w&&D(e)?(0,z.jsx)(`span`,{className:`block text-[13px] text-secondary`,children:D(e)}):null]}),(0,z.jsx)(`span`,{className:`shrink-0 text-right text-[13px] text-secondary`,children:e.kind===`market`?l?`Query context`:`Market`:e.kind===`property`?`Property`:X(e.targetCount)})]}),l&&e.kind===`group`&&e.id!==S?.id&&u.some(t=>t.parentGroupIds?.includes(e.id))?(0,z.jsx)(`button`,{type:`button`,"aria-label":Y.browse(e.label),title:`Browse ${e.label}`,className:`flex min-h-11 min-w-11 items-center justify-center rounded text-secondary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,onClick:()=>H(e),children:(0,z.jsx)(n,{size:18,"aria-hidden":`true`})}):null]},`${e.kind}:${e.id}`),W=(e,t)=>t.length>0?(0,z.jsxs)(`section`,{"aria-label":e,className:`mt-2`,children:[(0,z.jsx)(`h3`,{className:`px-2 py-2 text-[13px] font-medium text-secondary`,children:e}),t.map(e=>U(e))]}):null,G=(e,t,n)=>t.length>0?(0,z.jsxs)(`details`,{open:n,className:`mt-2 border-y border-default`,children:[(0,z.jsxs)(`summary`,{className:`min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[e,` (`,t.length,`)`]}),t.map(e=>U(e))]},`${S?.id??`root`}:${e}`):null;return(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{id:`${y}-label`,className:c===`sr-only`?`sr-only`:`mb-1 block text-sm font-medium text-heading`,children:s}),(0,z.jsxs)(`details`,{ref:_,className:`relative`,onToggle:e=>{e.target===e.currentTarget&&e.currentTarget.open&&v.current?.focus()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.currentTarget.open=!1,e.currentTarget.querySelector(`summary`)?.focus())},children:[(0,z.jsxs)(`summary`,{id:`${y}-value`,"aria-labelledby":`${y}-label ${y}-value`,className:`${K} visibility-scope-trigger`,onClick:()=>{_.current?.open||V()},children:[`${J(i)}${i.kind===`group`?` · ${X(i.targetCount)}`:i.kind===`property`?` · ${u.find(e=>e.kind===`market`&&e.id===o)?.label??(i.marketKeys?.length?Y.allMarkets:`Property`)}`:i.kind===`market`?` · Market`:``}`,(0,z.jsx)(t,{size:16,"aria-hidden":`true`,className:`shrink-0 text-secondary`})]}),(0,z.jsxs)(`div`,{className:`visibility-scope-menu`,children:[S||h?(0,z.jsxs)(`div`,{className:`mb-2 border-b border-default pb-2`,children:[(0,z.jsx)(`button`,{type:`button`,className:q,"aria-label":`Back to ${C?.label??`all groups`}`,onClick:()=>{m(p.slice(0,-1)),g(!1),f(``),v.current?.focus()},children:(0,z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(r,{size:16,"aria-hidden":`true`}),C?.label??`All groups`]})}),(0,z.jsx)(`p`,{className:`px-2 py-1 text-sm font-medium text-heading`,"aria-live":`polite`,children:S?.label??`All properties`})]}):null,(0,z.jsx)(`input`,{ref:v,type:`search`,"aria-label":`Search scopes`,className:K,placeholder:S?`Search within this group`:h?`Search properties`:`Search groups or properties`,value:d,onChange:e=>f(e.target.value)}),(0,z.jsxs)(`div`,{className:`mt-2 max-h-80 overflow-y-auto`,children:[l&&S&&!w?U(S,`All properties in this group`):null,I.map(e=>U(e)),S&&!w?G(`Subgroups`,A,!0):W(S?`Subgroups`:`Groups`,A),w?W(`Properties`,P):G(S&&A.length>0?`All properties`:`Properties`,P,!S||A.length===0),W(`Markets`,F),!S&&!h&&!w&&b.length>0&&E.length>0?(0,z.jsxs)(`button`,{type:`button`,className:`${q} mt-2 border-t border-default`,"aria-label":Y.browseAll,onClick:()=>{g(!0),v.current?.focus()},children:[(0,z.jsx)(`span`,{children:`All properties`}),(0,z.jsx)(n,{size:18,"aria-hidden":`true`})]}):null,w&&A.length+P.length+F.length+I.length===0?(0,z.jsx)(`p`,{className:`py-3 text-sm text-secondary`,children:`No matching scopes.`}):null]})]})]})]})}function ne(e){let t=e[0];return!t||e.every(e=>e.mode===t.mode&&e.scope.kind===t.scope.kind&&e.scope.key===t.scope.key&&e.queryClass===t.queryClass&&e.measurement.displayedRunId===t.measurement.displayedRunId)}function Z(e){return e.state===`unavailable`?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:`not_applicable`}:{numerator:e.numerator,denominator:e.denominator,...e.unattributed===void 0?{}:{unattributed:e.unattributed},...e.unchecked===void 0?{}:{unchecked:e.unchecked}}}function Q(e){return e.kind===`exact`?e.url:e.kind===`prefix`?`https://${e.host}${e.pathPrefix===`/`?``:e.pathPrefix}/*`:`https://${e.host}/*`}function re(e){return e===`assigned`?`this-property`:e===`sibling`?`another-property`:e===`ownedUnmapped`?`owned-unassigned`:e===`external`?`external`:e===`ambiguous`?`multiple-properties`:`invalid-url`}function ie(e){return e===`assigned`?`positive`:e===`external`?`neutral`:e===`invalid`?`negative`:`caution`}function ae(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function oe(e,t,n){let r=new Map;if(!t)return r;let i=new Map(e.usageEdges.map(e=>[ae(e),e.targetKey])),a=new Map(e.assignments.map(e=>[`${e.targetKey}:${e.queryId}`,e.queryClass])),o=new Map(e.usageEdges.map(e=>[ae(e),a.get(`${e.targetKey}:${e.queryId}`)]));for(let e of t.evidence){if(n&&o.get(e.usageEdgeId)!==n)continue;let t=i.get(e.usageEdgeId);if(!t)continue;let a=r.get(t)??[];a.push({id:`${e.observationId}:${e.expectedSlotId}:${e.usageEdgeId}:${e.sourceUrl}`,kind:re(e.classification),query:e.queryText,provider:e.provider,location:e.location,url:e.sourceUrl,tone:ie(e.classification),historical:e.historical||e.bridged}),r.set(t,a)}return r}function se(e){if(e.flags>0)return{label:`Review`,tone:`caution`};let t=[e.mentionCoverage,e.citationCoverage].filter(e=>e.state===`unavailable`).map(e=>e.reason);return t.includes(`no_completed_run`)?{label:`Not measured`,tone:`neutral`}:t.includes(`plan_v1`)?{label:`Update setup`,tone:`caution`}:t.includes(`evidence_incomplete`)?{label:`Evidence incomplete`,tone:`caution`}:t.includes(`identity_ambiguous`)?{label:F.ambiguous,tone:`caution`}:t.includes(`no_population`)?{label:`No queries`,tone:`neutral`}:t.includes(`not_applicable`)?{label:`Not applicable`,tone:`neutral`}:{label:`Complete`,tone:`positive`}}function ce(e){return e===`complete`?{label:`Complete`,tone:`positive`}:e===`partial`?{label:`Partial`,tone:`caution`}:e===`queued`?{label:`Queued`,tone:`neutral`}:e===`running`?{label:`Running`,tone:`neutral`}:e===`failed`?{label:`Failed`,tone:`negative`}:{label:`Not measured`,tone:`neutral`}}function le(e){if(!e)return``;let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):``}function ue(e){let t=e.nextAction.count??e.flags.total;if(e.nextAction.kind===`review_flags`)return`${t} flagged ${t===1?`result needs`:`results need`} review.`;if(e.nextAction.kind===`complete_setup`)return`Finish setup.`;if(e.nextAction.kind===`republish_setup`)return`Setup update required.`;if(e.nextAction.kind===`run_measurement`)return`Ready to measure.`}function de({overview:e,activePlan:t,report:n,reportState:r=n?`ready`:`loading`,sort:i}){if(t.plan.schemaVersion!==2||e.mode!==`active-v2`)throw Error(`The current overview requires an active version-two setup.`);if(e.scope.kind!==`all`&&e.scope.kind!==`group`)throw Error(`The current overview requires an All Properties or group scope.`);let a=t.plan,o=new Map(a.targets.map(e=>[e.stableKey,e])),s=new Map(a.querySnapshots.map(e=>[e.queryId,e.queryText])),c=new Map;for(let t of a.assignments){if(e.queryClass!==`all`&&t.queryClass!==e.queryClass)continue;let n=s.get(t.queryId);if(!n)continue;let r=c.get(t.targetKey)??new Set;r.add(n),c.set(t.targetKey,r)}let l=n?.revision===t.revision&&n.run?.id===e.measurement.displayedRunId?n:null,u=e.measurement.displayedRunId===void 0||l?`ready`:r===`error`||n!=null?`error`:`loading`,d=oe(a,l,e.queryClass===`all`?void 0:e.queryClass),f=new Map;for(let e of a.groups)for(let t of e.targetKeys)f.has(t)||f.set(t,e.label);let p=e.properties.items.map(e=>{let t=o.get(e.targetKey),n=d.get(e.targetKey)??[];return{id:e.targetKey,name:e.label,mentionCoverage:Z(e.mentionCoverage),citationCoverage:Z(e.citationCoverage),status:se(e),providers:e.providers?.map(e=>({provider:e.provider,mentionCoverage:Z(e.mentionCoverage),citationCoverage:Z(e.citationCoverage)})),market:f.get(e.targetKey),assignedQueries:[...c.get(e.targetKey)??[]],urls:t?.urlMatchers.map(Q)??[],evidence:n,evidenceState:u,historical:n.some(e=>e.historical)}}),m=e.namedShareOfVoice?.entries.map(t=>({name:t.label,coverage:{numerator:t.credits,denominator:e.namedShareOfVoice.denominator}})),h=e.properties.items.flatMap(e=>e.flags>0?[{id:`property:${e.targetKey}`,property:e.label,summary:`${e.flags} ${e.flags===1?`result needs`:`results need`} review.`,tone:`caution`,count:e.flags}]:[]);return{classReporting:`available`,latestMeasurement:{status:ce(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:le(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind===`group`?{kind:`group`,...e.scope.key?{key:e.scope.key}:{}}:{kind:`all`},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:Z(e.metrics.propertiesMentioned),mentionCoverage:Z(e.metrics.mentionCoverage),citationCoverage:Z(e.metrics.citationCoverage)},properties:p,...m?{shareOfVoice:m}:{}},propertyTotal:e.properties.totalEstimate??p.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...i?{sort:i}:{}},availableGroups:a.groups.map(e=>({id:e.stableKey,label:e.label})),...ue(e)?{nextActionText:ue(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:h}}function fe(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`web-${Date.now()}-${Math.random().toString(36).slice(2)}`}function $(e){return{"If-Match":e,"Idempotency-Key":fe()}}function pe(e){return e instanceof O&&(e.statusCode===404||e.statusCode===409||e.statusCode===412)}function me(e,t){return e instanceof O?t:(e instanceof Error?e.message.trim():``)||t}function he(e){let t=`Could not calculate assignment impact.`;if(!(e instanceof O)||e.code!==`VALIDATION_ERROR`)return t;let n=e.message.trim();return e.details?.displayToOperator===!0&&n?n:t}var ge={loadSetup:e=>N(()=>b({client:A,path:{name:e}})),loadDraft:e=>N(()=>h({client:A,path:{name:e}})),createDraft:(e,t)=>N(()=>c({client:A,path:{name:e},headers:{"Idempotency-Key":fe()},body:{expectedActiveRevision:t}})),importSitemap:(e,t,n)=>N(()=>P({client:A,path:{name:e},headers:$(t),body:n})),applySitemapSelection:(e,t,n,r)=>N(()=>_({client:A,path:{name:e},headers:$(t),body:{selections:n,selectedTargetKeys:r}})),previewAssignments:(e,t)=>N(()=>C({client:A,path:{name:e},body:t})),applyAssignments:(e,t,n)=>N(()=>s({client:A,path:{name:e},headers:$(t),body:n})),replaceAssignments:(e,t,n)=>N(()=>f({client:A,path:{name:e},headers:$(t),body:n})),applyPairedAssignments:(e,t,n,r)=>N(()=>g({client:A,path:{name:e},headers:$(t),body:{pairs:n,...r?{contextOverride:r}:{}}})),previewMarketRouting:(e,t)=>N(()=>S({client:A,path:{name:e},body:t})),routeMarkets:(e,t,n)=>N(()=>E({client:A,path:{name:e},headers:$(t),body:n})),removeAssignment:(e,t,n,r)=>N(()=>l({client:A,path:{name:e},headers:$(t),body:{targetKeys:n,queryId:r}})),excludeTarget:(e,t,n)=>N(()=>x({client:A,path:{name:e},headers:$(t),body:{targetKey:n,cleanup:`assignments-and-group-memberships`}})),upsertTarget:(e,t,n)=>N(()=>y({client:A,path:{name:e},headers:$(t),body:{target:n}})),upsertGroup:(e,t,n)=>N(()=>D({client:A,path:{name:e},headers:$(t),body:{group:n}})),removeGroup:(e,t,n)=>N(()=>j({client:A,path:{name:e},headers:$(t),body:{groupKey:n}})),upsertCompetitor:(e,t,n)=>N(()=>T({client:A,path:{name:e},headers:$(t),body:n})),removeCompetitor:(e,t,n,r)=>N(()=>p({client:A,path:{name:e},headers:$(t),body:{groupKey:n,competitorKey:r}})),previewGroupMembership:(e,t)=>N(()=>u({client:A,path:{name:e},body:t})),applyGroupMembership:(e,t,n)=>N(()=>k({client:A,path:{name:e},headers:$(t),body:n})),compilePreview:e=>N(()=>v({client:A,path:{name:e}})),diffPreview:e=>N(()=>d({client:A,path:{name:e}})),publish:(e,t,n)=>N(()=>w({client:A,path:{name:e},headers:$(t),body:n})),discard:(e,t)=>N(()=>m({client:A,path:{name:e},headers:$(t)}))};export{de as a,Y as c,G as d,me as i,te as l,he as n,ne as o,pe as r,Q as s,ge as t,B as u};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{G as t,U as n,W as r,rt as i}from"./vendor-lucide-4KkDquAu.js";import{n as a,r as o}from"./vendor-markdown-9SSeLNHZ.js";import{Ao as s,Fo as c,Go as l,Ho as u,Io as d,Jo as f,Ko as p,Lo as m,Ma as h,Mo as g,No as _,Po as v,Qo as y,Ra as b,Ro as x,Uo as S,Vo as C,Wo as w,Xo as T,Yo as E,Zo as D,a as O,jo as k,pt as A,qo as j,r as M,vt as N,zo as P}from"./ToneBadge-DYEbxp5S.js";import{x as F}from"./format-helpers-DOEct2q8.js";import{at as I,rt as L}from"./index-CgAMnZFS.js";var R=e(i(),1),z=o(),B=`Sources`,V={copy:`Copy answer`,copying:`Copying…`,copied:`Copied`,failed:`Could not copy. Select and copy the answer above.`};function H({previewLength:e,highlight:t}){return n=>{if(e!==void 0&&Number.isFinite(e)){let t=Math.max(0,Math.floor(e)),r={field:`value`,omitted:!1},i=e=>{if(e.type===`definition`)return!0;if(e.children)return e.children=e.children.filter(i),e.children.length>0;let n=e.type===`image`||e.type===`imageReference`?`alt`:`value`,a=e[n];if(a===void 0)return t>0;let o=Array.from(a);if(o.length===0)return t>0;if(t===0)return r.omitted=!0,!1;let s=o.length>t,c=o.slice(0,t);if(s&&!/\s/.test(o[t])){let e=c.length-1;for(;e>=0&&!/\s/.test(c[e]);)e--;e>=0&&e>t-40&&(c.length=e)}return r.omitted||=s,e[n]=c.join(``),t=s?0:t-c.length,c.length!==0&&(r.lastNode=e,r.field=n,!0)};i(n),r.omitted&&(r.lastNode?r.lastNode[r.field]=`${r.lastNode[r.field].trimEnd()}…`:n.children?.push({type:`paragraph`,children:[{type:`text`,value:`…`}]}))}if(t){let e=t=>{[`link`,`linkReference`,`code`,`inlineCode`].includes(t.type)||(t.type===`text`&&(t.data={...t.data,hName:`span`}),t.children?.forEach(e))};e(n)}}}function U({headingLevel:e}){return t=>{let n=[],r=e=>{e.type===`heading`&&e.depth&&n.push(e),e.children?.forEach(r)};r(t);let i=n.reduce((e,t)=>Math.min(e,t.depth),6);for(let t of n){let n=t.depth-i;t.depth=Math.min(6,e+n),t.data={...t.data,hProperties:{...t.data?.hProperties,"data-answer-heading-level":n+1}}}}}function W({answer:e}){let[t,n]=(0,R.useState)(`idle`),r=(0,R.useRef)(!1),i=async()=>{if(!r.current){r.current=!0,n(`copying`);try{await navigator.clipboard.writeText(e),n(`copied`)}catch{n(`failed`)}finally{r.current=!1}}};return(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-3`,children:[(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:`min-h-11 px-2`,"aria-disabled":t===`copying`,"aria-busy":t===`copying`,onClick:()=>{i()},children:t===`copying`?V.copying:V.copy}),(0,z.jsx)(`span`,{role:`status`,className:`text-sm text-secondary`,children:t===`copied`?V.copied:t===`failed`?V.failed:``})]})}var G=(0,R.memo)(function({children:e,headingLevel:t=4,copyable:n=!1,highlightGroups:r,previewLength:i}){return(0,z.jsxs)(`div`,{className:`answer-markdown`,children:[(0,z.jsx)(a,{remarkPlugins:[[U,{headingLevel:t}],[H,{previewLength:i,highlight:!!r?.length}]],components:{p:({children:e})=>(0,z.jsx)(`p`,{className:`mb-3 whitespace-pre-wrap last:mb-0`,children:e}),ul:({children:e})=>(0,z.jsx)(`ul`,{className:`mb-3 ml-5 list-disc space-y-1`,children:e}),ol:({children:e,start:t})=>(0,z.jsx)(`ol`,{start:t,className:`mb-3 ml-5 list-decimal space-y-1`,children:e}),pre:({children:e})=>(0,z.jsx)(`pre`,{className:`mb-3 overflow-x-auto whitespace-pre-wrap`,children:e}),span:({children:e})=>(0,z.jsx)(`span`,{children:typeof e==`string`&&r?e.split(/(https?:\/\/[^\s<>]+)/i).map((e,t)=>t%2?e:(0,z.jsx)(R.Fragment,{children:L(e,r)},t)):e}),a:({children:e,href:t})=>{let n=I(t);return n?(0,z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`text-link underline`,children:e}):(0,z.jsx)(`span`,{children:e})},img:({alt:e})=>(0,z.jsx)(`span`,{children:e})},children:e}),n&&e.trim()?(0,z.jsx)(W,{answer:e},e):null]})}),K=`min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,q=`flex min-h-11 w-full items-center justify-between gap-3 rounded px-2 text-left text-sm text-primary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,J=e=>e.kind===`project`?`Whole site`:e.label,Y={allMarkets:`All markets`,browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:`Browse all properties`},ee=e=>e?.kind===`group`&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,X=e=>`${e} ${e===1?`property`:`properties`}`;function te({options:e,selected:i,onSelect:a,marketKey:o,label:s=`Measurement scope`,labelVisibility:c=`visible`,allowGroupSelect:l=!0}){let u=[...e].sort((e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0})||e.id.localeCompare(t.id)),[d,f]=(0,R.useState)(``),[p,m]=(0,R.useState)([]),[h,g]=(0,R.useState)(!1),_=(0,R.useRef)(null),v=(0,R.useRef)(null),y=(0,R.useId)(),b=u.filter(e=>e.kind===`group`),x=new Map(b.map(e=>[e.id,e])),S=x.get(p.at(-1)??``),C=x.get(p.at(-2)??``),w=d.trim().toLocaleLowerCase(),T=b.filter(e=>!e.parentGroupIds?.some(e=>x.has(e))),E=u.filter(e=>e.kind===`property`),D=e=>(e.parentGroupIds??[]).map(e=>x.get(e)?.label).filter(Boolean).join(` · `),O=e=>`${J(e)} ${D(e)}`.toLocaleLowerCase().includes(w),k=e=>{let t=[...e.parentGroupIds??[]],n=new Set;for(;t.length;){let e=t.pop();if(e===S?.id)return!0;n.has(e)||(n.add(e),t.push(...x.get(e)?.parentGroupIds??[]))}return!1},A=(h?[]:S?b.filter(e=>w?k(e):e.parentGroupIds?.includes(S.id)):w?b:T).filter(O),j=u.find(e=>e.kind===`market`&&e.id===(o??(i.kind===`market`?i.id:void 0))),M=S&&j&&(S.marketKeys?.includes(j.id)||j.parentGroupIds?.includes(S.id))?j.id:void 0,N=l?M??ee(S):void 0,P=(S?E.filter(e=>e.parentGroupIds?.includes(S.id)&&(!N||e.marketKeys?.includes(N))):w||h||b.length===0?E:[]).filter(O),F=u.filter(e=>e.kind!==`market`||h||!l&&!S&&!w&&b.length>0||l&&S?.marketKeys?.length===1&&!w?!1:(S?w?k(e):e.parentGroupIds?.includes(S.id):w||!e.parentGroupIds?.some(e=>x.has(e)))&&O(e)),I=S||h?[]:u.filter(e=>e.kind===`project`&&O(e));(0,R.useEffect)(()=>{let e=e=>{_.current?.open&&e.target instanceof Node&&!_.current.contains(e.target)&&(_.current.open=!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[]);let L=e=>{_.current&&(_.current.open=!1,_.current.querySelector(`summary`)?.focus());let t=l?e.kind===`property`?N:e.kind===`group`&&e.id===S?.id?M:void 0:void 0;t?a(e,t):a(e)},B=e=>{let t=[],n=x.get(e.parentGroupIds?.[0]??``);for(;n&&!t.includes(n.id)&&n.id!==e.id;)t.unshift(n.id),n=x.get(n.parentGroupIds?.[0]??``);return[...t,e.id]},V=()=>{let e=i.kind===`group`?x.get(i.id):void 0,t=x.get(j?.parentGroupIds?.[0]??``),n=(i.parentGroupIds??[]).flatMap(e=>{let t=x.get(e);return t?[B(t)]:[]}),r=n.find(e=>e.at(-1)===S?.id)??n.sort((e,t)=>t.length-e.length)[0]??[],a=t?B(t):i.marketKeys?.length?[]:r;m(e?B(e):a),g(i.kind===`property`&&a.length===0&&b.length>0),f(``)},H=e=>{m(B(e)),g(!1),f(``),v.current?.focus()},U=(e,t=J(e))=>(0,z.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,z.jsxs)(`button`,{type:`button`,className:q,"aria-label":e.kind===`group`&&!l?Y.browse(J(e)):Y.select(J(e)),"aria-current":i.kind===e.kind&&i.id===e.id?`true`:void 0,onClick:()=>e.kind===`group`&&!l?H(e):L(e),children:[(0,z.jsxs)(`span`,{className:`min-w-0 break-words`,children:[t,w&&D(e)?(0,z.jsx)(`span`,{className:`block text-[13px] text-secondary`,children:D(e)}):null]}),(0,z.jsx)(`span`,{className:`shrink-0 text-right text-[13px] text-secondary`,children:e.kind===`market`?l?`Query context`:`Market`:e.kind===`property`?`Property`:X(e.targetCount)})]}),l&&e.kind===`group`&&e.id!==S?.id&&u.some(t=>t.parentGroupIds?.includes(e.id))?(0,z.jsx)(`button`,{type:`button`,"aria-label":Y.browse(e.label),title:`Browse ${e.label}`,className:`flex min-h-11 min-w-11 items-center justify-center rounded text-secondary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,onClick:()=>H(e),children:(0,z.jsx)(n,{size:18,"aria-hidden":`true`})}):null]},`${e.kind}:${e.id}`),W=(e,t)=>t.length>0?(0,z.jsxs)(`section`,{"aria-label":e,className:`mt-2`,children:[(0,z.jsx)(`h3`,{className:`px-2 py-2 text-[13px] font-medium text-secondary`,children:e}),t.map(e=>U(e))]}):null,G=(e,t,n)=>t.length>0?(0,z.jsxs)(`details`,{open:n,className:`mt-2 border-y border-default`,children:[(0,z.jsxs)(`summary`,{className:`min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[e,` (`,t.length,`)`]}),t.map(e=>U(e))]},`${S?.id??`root`}:${e}`):null;return(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{id:`${y}-label`,className:c===`sr-only`?`sr-only`:`mb-1 block text-sm font-medium text-heading`,children:s}),(0,z.jsxs)(`details`,{ref:_,className:`relative`,onToggle:e=>{e.target===e.currentTarget&&e.currentTarget.open&&v.current?.focus()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.currentTarget.open=!1,e.currentTarget.querySelector(`summary`)?.focus())},children:[(0,z.jsxs)(`summary`,{id:`${y}-value`,"aria-labelledby":`${y}-label ${y}-value`,className:`${K} visibility-scope-trigger`,onClick:()=>{_.current?.open||V()},children:[`${J(i)}${i.kind===`group`?` · ${X(i.targetCount)}`:i.kind===`property`?` · ${u.find(e=>e.kind===`market`&&e.id===o)?.label??(i.marketKeys?.length?Y.allMarkets:`Property`)}`:i.kind===`market`?` · Market`:``}`,(0,z.jsx)(t,{size:16,"aria-hidden":`true`,className:`shrink-0 text-secondary`})]}),(0,z.jsxs)(`div`,{className:`visibility-scope-menu`,children:[S||h?(0,z.jsxs)(`div`,{className:`mb-2 border-b border-default pb-2`,children:[(0,z.jsx)(`button`,{type:`button`,className:q,"aria-label":`Back to ${C?.label??`all groups`}`,onClick:()=>{m(p.slice(0,-1)),g(!1),f(``),v.current?.focus()},children:(0,z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(r,{size:16,"aria-hidden":`true`}),C?.label??`All groups`]})}),(0,z.jsx)(`p`,{className:`px-2 py-1 text-sm font-medium text-heading`,"aria-live":`polite`,children:S?.label??`All properties`})]}):null,(0,z.jsx)(`input`,{ref:v,type:`search`,"aria-label":`Search scopes`,className:K,placeholder:S?`Search within this group`:h?`Search properties`:`Search groups or properties`,value:d,onChange:e=>f(e.target.value)}),(0,z.jsxs)(`div`,{className:`mt-2 max-h-80 overflow-y-auto`,children:[l&&S&&!w?U(S,`All properties in this group`):null,I.map(e=>U(e)),S&&!w?G(`Subgroups`,A,!0):W(S?`Subgroups`:`Groups`,A),w?W(`Properties`,P):G(S&&A.length>0?`All properties`:`Properties`,P,!S||A.length===0),W(`Markets`,F),!S&&!h&&!w&&b.length>0&&E.length>0?(0,z.jsxs)(`button`,{type:`button`,className:`${q} mt-2 border-t border-default`,"aria-label":Y.browseAll,onClick:()=>{g(!0),v.current?.focus()},children:[(0,z.jsx)(`span`,{children:`All properties`}),(0,z.jsx)(n,{size:18,"aria-hidden":`true`})]}):null,w&&A.length+P.length+F.length+I.length===0?(0,z.jsx)(`p`,{className:`py-3 text-sm text-secondary`,children:`No matching scopes.`}):null]})]})]})]})}function ne(e){let t=e[0];return!t||e.every(e=>e.mode===t.mode&&e.scope.kind===t.scope.kind&&e.scope.key===t.scope.key&&e.queryClass===t.queryClass&&e.measurement.displayedRunId===t.measurement.displayedRunId)}function Z(e){return e.state===`unavailable`?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:`not_applicable`}:{numerator:e.numerator,denominator:e.denominator,...e.unattributed===void 0?{}:{unattributed:e.unattributed},...e.unchecked===void 0?{}:{unchecked:e.unchecked}}}function Q(e){return e.kind===`exact`?e.url:e.kind===`prefix`?`https://${e.host}${e.pathPrefix===`/`?``:e.pathPrefix}/*`:`https://${e.host}/*`}function re(e){return e===`assigned`?`this-property`:e===`sibling`?`another-property`:e===`ownedUnmapped`?`owned-unassigned`:e===`external`?`external`:e===`ambiguous`?`multiple-properties`:`invalid-url`}function ie(e){return e===`assigned`?`positive`:e===`external`?`neutral`:e===`invalid`?`negative`:`caution`}function ae(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function oe(e,t,n){let r=new Map;if(!t)return r;let i=new Map(e.usageEdges.map(e=>[ae(e),e.targetKey])),a=new Map(e.assignments.map(e=>[`${e.targetKey}:${e.queryId}`,e.queryClass])),o=new Map(e.usageEdges.map(e=>[ae(e),a.get(`${e.targetKey}:${e.queryId}`)]));for(let e of t.evidence){if(n&&o.get(e.usageEdgeId)!==n)continue;let t=i.get(e.usageEdgeId);if(!t)continue;let a=r.get(t)??[];a.push({id:`${e.observationId}:${e.expectedSlotId}:${e.usageEdgeId}:${e.sourceUrl}`,kind:re(e.classification),query:e.queryText,provider:e.provider,location:e.location,url:e.sourceUrl,tone:ie(e.classification),historical:e.historical||e.bridged}),r.set(t,a)}return r}function se(e){if(e.flags>0)return{label:`Review`,tone:`caution`};let t=[e.mentionCoverage,e.citationCoverage].filter(e=>e.state===`unavailable`).map(e=>e.reason);return t.includes(`no_completed_run`)?{label:`Not measured`,tone:`neutral`}:t.includes(`plan_v1`)?{label:`Update setup`,tone:`caution`}:t.includes(`evidence_incomplete`)?{label:`Evidence incomplete`,tone:`caution`}:t.includes(`identity_ambiguous`)?{label:F.ambiguous,tone:`caution`}:t.includes(`no_population`)?{label:`No queries`,tone:`neutral`}:t.includes(`not_applicable`)?{label:`Not applicable`,tone:`neutral`}:{label:`Complete`,tone:`positive`}}function ce(e){return e===`complete`?{label:`Complete`,tone:`positive`}:e===`partial`?{label:`Partial`,tone:`caution`}:e===`queued`?{label:`Queued`,tone:`neutral`}:e===`running`?{label:`Running`,tone:`neutral`}:e===`failed`?{label:`Failed`,tone:`negative`}:{label:`Not measured`,tone:`neutral`}}function le(e){if(!e)return``;let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):``}function ue(e){let t=e.nextAction.count??e.flags.total;if(e.nextAction.kind===`review_flags`)return`${t} flagged ${t===1?`result needs`:`results need`} review.`;if(e.nextAction.kind===`complete_setup`)return`Finish setup.`;if(e.nextAction.kind===`republish_setup`)return`Setup update required.`;if(e.nextAction.kind===`run_measurement`)return`Ready to measure.`}function de({overview:e,activePlan:t,report:n,reportState:r=n?`ready`:`loading`,sort:i}){if(t.plan.schemaVersion!==2||e.mode!==`active-v2`)throw Error(`The current overview requires an active version-two setup.`);if(e.scope.kind!==`all`&&e.scope.kind!==`group`)throw Error(`The current overview requires an All Properties or group scope.`);let a=t.plan,o=new Map(a.targets.map(e=>[e.stableKey,e])),s=new Map(a.querySnapshots.map(e=>[e.queryId,e.queryText])),c=new Map;for(let t of a.assignments){if(e.queryClass!==`all`&&t.queryClass!==e.queryClass)continue;let n=s.get(t.queryId);if(!n)continue;let r=c.get(t.targetKey)??new Set;r.add(n),c.set(t.targetKey,r)}let l=n?.revision===t.revision&&n.run?.id===e.measurement.displayedRunId?n:null,u=e.measurement.displayedRunId===void 0||l?`ready`:r===`error`||n!=null?`error`:`loading`,d=oe(a,l,e.queryClass===`all`?void 0:e.queryClass),f=new Map;for(let e of a.groups)for(let t of e.targetKeys)f.has(t)||f.set(t,e.label);let p=e.properties.items.map(e=>{let t=o.get(e.targetKey),n=d.get(e.targetKey)??[];return{id:e.targetKey,name:e.label,mentionCoverage:Z(e.mentionCoverage),citationCoverage:Z(e.citationCoverage),status:se(e),providers:e.providers?.map(e=>({provider:e.provider,mentionCoverage:Z(e.mentionCoverage),citationCoverage:Z(e.citationCoverage)})),market:f.get(e.targetKey),assignedQueries:[...c.get(e.targetKey)??[]],urls:t?.urlMatchers.map(Q)??[],evidence:n,evidenceState:u,historical:n.some(e=>e.historical)}}),m=e.namedShareOfVoice?.entries.map(t=>({name:t.label,coverage:{numerator:t.credits,denominator:e.namedShareOfVoice.denominator}})),h=e.properties.items.flatMap(e=>e.flags>0?[{id:`property:${e.targetKey}`,property:e.label,summary:`${e.flags} ${e.flags===1?`result needs`:`results need`} review.`,tone:`caution`,count:e.flags}]:[]);return{classReporting:`available`,latestMeasurement:{status:ce(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:le(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind===`group`?{kind:`group`,...e.scope.key?{key:e.scope.key}:{}}:{kind:`all`},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:Z(e.metrics.propertiesMentioned),mentionCoverage:Z(e.metrics.mentionCoverage),citationCoverage:Z(e.metrics.citationCoverage)},properties:p,...m?{shareOfVoice:m}:{}},propertyTotal:e.properties.totalEstimate??p.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...i?{sort:i}:{}},availableGroups:a.groups.map(e=>({id:e.stableKey,label:e.label})),...ue(e)?{nextActionText:ue(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:h}}function fe(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`web-${Date.now()}-${Math.random().toString(36).slice(2)}`}function $(e){return{"If-Match":e,"Idempotency-Key":fe()}}function pe(e){return e instanceof O&&(e.statusCode===404||e.statusCode===409||e.statusCode===412)}function me(e,t){return e instanceof O?t:(e instanceof Error?e.message.trim():``)||t}function he(e){let t=`Could not calculate assignment impact.`;if(!(e instanceof O)||e.code!==`VALIDATION_ERROR`)return t;let n=e.message.trim();return e.details?.displayToOperator===!0&&n?n:t}var ge={loadSetup:e=>N(()=>b({client:A,path:{name:e}})),loadDraft:e=>N(()=>h({client:A,path:{name:e}})),createDraft:(e,t)=>N(()=>c({client:A,path:{name:e},headers:{"Idempotency-Key":fe()},body:{expectedActiveRevision:t}})),importSitemap:(e,t,n)=>N(()=>P({client:A,path:{name:e},headers:$(t),body:n})),applySitemapSelection:(e,t,n,r)=>N(()=>_({client:A,path:{name:e},headers:$(t),body:{selections:n,selectedTargetKeys:r}})),previewAssignments:(e,t)=>N(()=>C({client:A,path:{name:e},body:t})),applyAssignments:(e,t,n)=>N(()=>s({client:A,path:{name:e},headers:$(t),body:n})),replaceAssignments:(e,t,n)=>N(()=>f({client:A,path:{name:e},headers:$(t),body:n})),applyPairedAssignments:(e,t,n,r)=>N(()=>g({client:A,path:{name:e},headers:$(t),body:{pairs:n,...r?{contextOverride:r}:{}}})),previewMarketRouting:(e,t)=>N(()=>S({client:A,path:{name:e},body:t})),routeMarkets:(e,t,n)=>N(()=>E({client:A,path:{name:e},headers:$(t),body:n})),removeAssignment:(e,t,n,r)=>N(()=>l({client:A,path:{name:e},headers:$(t),body:{targetKeys:n,queryId:r}})),excludeTarget:(e,t,n)=>N(()=>x({client:A,path:{name:e},headers:$(t),body:{targetKey:n,cleanup:`assignments-and-group-memberships`}})),upsertTarget:(e,t,n)=>N(()=>y({client:A,path:{name:e},headers:$(t),body:{target:n}})),upsertGroup:(e,t,n)=>N(()=>D({client:A,path:{name:e},headers:$(t),body:{group:n}})),removeGroup:(e,t,n)=>N(()=>j({client:A,path:{name:e},headers:$(t),body:{groupKey:n}})),upsertCompetitor:(e,t,n)=>N(()=>T({client:A,path:{name:e},headers:$(t),body:n})),removeCompetitor:(e,t,n,r)=>N(()=>p({client:A,path:{name:e},headers:$(t),body:{groupKey:n,competitorKey:r}})),previewGroupMembership:(e,t)=>N(()=>u({client:A,path:{name:e},body:t})),applyGroupMembership:(e,t,n)=>N(()=>k({client:A,path:{name:e},headers:$(t),body:n})),compilePreview:e=>N(()=>v({client:A,path:{name:e}})),diffPreview:e=>N(()=>d({client:A,path:{name:e}})),publish:(e,t,n)=>N(()=>w({client:A,path:{name:e},headers:$(t),body:n})),discard:(e,t)=>N(()=>m({client:A,path:{name:e},headers:$(t)}))};export{de as a,Y as c,G as d,me as i,te as l,he as n,ne as o,pe as r,Q as s,ge as t,B as u};
|
package/assets/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
|
|
13
13
|
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
|
|
14
14
|
<title>Canonry</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-CgAMnZFS.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-XKyaHtl9.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/vendor-lucide-4KkDquAu.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/vendor-markdown-9SSeLNHZ.js">
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<link rel="modulepreload" crossorigin href="./assets/InfoTooltip-DV3_9Qp1.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="./assets/card-im88-x1b.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="./assets/vendor-yaml-Y43rmNgW.js">
|
|
32
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
32
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DElT2Fss.css">
|
|
33
33
|
</head>
|
|
34
34
|
<body>
|
|
35
35
|
<div id="root"></div>
|
|
@@ -5656,7 +5656,7 @@ function nonBlank(value) {
|
|
|
5656
5656
|
return trimmed ? trimmed : void 0;
|
|
5657
5657
|
}
|
|
5658
5658
|
function resolveBuildCommit(env = process.env) {
|
|
5659
|
-
const embedded = true ? "
|
|
5659
|
+
const embedded = true ? "defc4dd5f82b7402ab8fc0b78cd5ac850deb3e35" : void 0;
|
|
5660
5660
|
return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
|
|
5661
5661
|
}
|
|
5662
5662
|
function resolveInstanceIdentity(env = process.env) {
|
|
@@ -47,7 +47,7 @@ function queueServeHandoff() {
|
|
|
47
47
|
async function runPendingServeHandoff(format) {
|
|
48
48
|
if (!pendingServeHandoff) return;
|
|
49
49
|
pendingServeHandoff = false;
|
|
50
|
-
const { serveCommand } = await import("./serve-
|
|
50
|
+
const { serveCommand } = await import("./serve-3WJL5N2Z.js");
|
|
51
51
|
await serveCommand(format);
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -599,7 +599,7 @@ var DEMO_CLI_COMMANDS = [{
|
|
|
599
599
|
options: { host: stringOption(), port: stringOption(), "trust-proxy": multiStringOption() },
|
|
600
600
|
allowPositionals: false,
|
|
601
601
|
run: async (input) => {
|
|
602
|
-
const { demoCommand } = await import("./demo-
|
|
602
|
+
const { demoCommand } = await import("./demo-F5TRWB6V.js");
|
|
603
603
|
await demoCommand({
|
|
604
604
|
host: getString(input.values, "host"),
|
|
605
605
|
port: getString(input.values, "port"),
|
|
@@ -6615,7 +6615,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
6615
6615
|
options: { access: stringOption() },
|
|
6616
6616
|
run: async (input) => {
|
|
6617
6617
|
if (input.positionals.length > 1) throw usageError("Expected at most one command group");
|
|
6618
|
-
const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-PJYR3JHX.js"), import("./cli-commands-
|
|
6618
|
+
const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-PJYR3JHX.js"), import("./cli-commands-JBLV55EA.js")]);
|
|
6619
6619
|
printCliCatalog(REGISTERED_CLI_COMMANDS2, input.format, input.positionals[0], getString(input.values, "access"));
|
|
6620
6620
|
}
|
|
6621
6621
|
},
|
|
@@ -6664,7 +6664,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
6664
6664
|
},
|
|
6665
6665
|
allowPositionals: false,
|
|
6666
6666
|
run: async (input) => {
|
|
6667
|
-
const { initCommand } = await import("./init-
|
|
6667
|
+
const { initCommand } = await import("./init-LABWY7HI.js");
|
|
6668
6668
|
await initCommand({
|
|
6669
6669
|
force: getBoolean(input.values, "force"),
|
|
6670
6670
|
ref: getString(input.values, "ref"),
|
|
@@ -6719,7 +6719,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
6719
6719
|
allowPositionals: false,
|
|
6720
6720
|
run: async (input) => {
|
|
6721
6721
|
applyServerEnv(input.values);
|
|
6722
|
-
const { serveCommand } = await import("./serve-
|
|
6722
|
+
const { serveCommand } = await import("./serve-3WJL5N2Z.js");
|
|
6723
6723
|
await serveCommand(input.format);
|
|
6724
6724
|
}
|
|
6725
6725
|
},
|
package/dist/cli.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node --import tsx
|
|
2
2
|
import {
|
|
3
3
|
REGISTERED_CLI_COMMANDS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CFGA6OAK.js";
|
|
5
5
|
import "./chunk-6GO5VVAC.js";
|
|
6
6
|
import {
|
|
7
7
|
buildSetupState,
|
|
8
8
|
runPendingServeHandoff
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BNGGUL7F.js";
|
|
10
10
|
import "./chunk-WLIGKWVB.js";
|
|
11
11
|
import "./chunk-VJWDBFSL.js";
|
|
12
12
|
import "./chunk-TSENU4GG.js";
|
|
@@ -40,7 +40,7 @@ function parseDemoTrustedProxies(values) {
|
|
|
40
40
|
async function demoCommand(options) {
|
|
41
41
|
const { host, port } = parseDemoListenOptions(options);
|
|
42
42
|
const trustProxy = parseDemoTrustedProxies(options.trustProxy);
|
|
43
|
-
const { createDemoServer } = await import("./demo-server-
|
|
43
|
+
const { createDemoServer } = await import("./demo-server-WIVTG6GH.js");
|
|
44
44
|
const app = await createDemoServer({ trustProxy });
|
|
45
45
|
let stopping = false;
|
|
46
46
|
const stop = () => {
|
|
@@ -91,6 +91,9 @@ import {
|
|
|
91
91
|
researchRunQueries,
|
|
92
92
|
researchRuns,
|
|
93
93
|
runs,
|
|
94
|
+
seoJobs,
|
|
95
|
+
seoProfiles,
|
|
96
|
+
seoTasks,
|
|
94
97
|
simpleMeasurementDefinitions,
|
|
95
98
|
siteAuditPages,
|
|
96
99
|
siteAuditSnapshots,
|
|
@@ -109,6 +112,12 @@ import {
|
|
|
109
112
|
RunKinds,
|
|
110
113
|
RunStatuses,
|
|
111
114
|
RunTriggers,
|
|
115
|
+
SeoAdapterOutcomes,
|
|
116
|
+
SeoCapabilities,
|
|
117
|
+
SeoProviders,
|
|
118
|
+
SeoRunStatuses,
|
|
119
|
+
SeoScopeKinds,
|
|
120
|
+
SeoTargetKinds,
|
|
112
121
|
SiteCrawlFetchStates,
|
|
113
122
|
SiteCrawlIndexabilityReasons,
|
|
114
123
|
SiteCrawlIndexabilityStates,
|
|
@@ -126,6 +135,7 @@ import {
|
|
|
126
135
|
determineAnswerMentioned,
|
|
127
136
|
effectiveBrandNames,
|
|
128
137
|
effectiveDomains,
|
|
138
|
+
emptySeoResults,
|
|
129
139
|
extractRecommendedCompetitors,
|
|
130
140
|
factorStatusFromScore,
|
|
131
141
|
formatPercent,
|
|
@@ -1267,6 +1277,17 @@ var DEMO_READ_ROUTES = /* @__PURE__ */ new Set([
|
|
|
1267
1277
|
"/api/v1/projects/:name/schedule",
|
|
1268
1278
|
"/api/v1/projects/:name/schedules",
|
|
1269
1279
|
"/api/v1/projects/:name/search",
|
|
1280
|
+
// Stored SEO evidence only. Refresh intents, sync, cancellation, and operator reads stay closed.
|
|
1281
|
+
"/api/v1/projects/:name/seo/context",
|
|
1282
|
+
"/api/v1/projects/:name/seo/status",
|
|
1283
|
+
"/api/v1/projects/:name/seo/profiles",
|
|
1284
|
+
"/api/v1/projects/:name/seo/profiles/:id",
|
|
1285
|
+
"/api/v1/projects/:name/seo/overview",
|
|
1286
|
+
"/api/v1/projects/:name/seo/keyword-metrics",
|
|
1287
|
+
"/api/v1/projects/:name/seo/domain-intelligence",
|
|
1288
|
+
"/api/v1/projects/:name/seo/ranked-keywords",
|
|
1289
|
+
"/api/v1/projects/:name/seo/runs",
|
|
1290
|
+
"/api/v1/projects/:name/seo/runs/:id",
|
|
1270
1291
|
"/api/v1/projects/:name/snapshots",
|
|
1271
1292
|
"/api/v1/projects/:name/snapshots/diff",
|
|
1272
1293
|
"/api/v1/projects/:name/technical-aeo",
|
|
@@ -1309,7 +1330,7 @@ var DEMO_CLIENT_CONFIG = {
|
|
|
1309
1330
|
dashboard: { showAgentBar: false, showUpdateNotification: false }
|
|
1310
1331
|
};
|
|
1311
1332
|
var INLINE_SCRIPT = /<script(?<attributes>[^>]*)>(?<body>[\s\S]*?)<\/script>/gi;
|
|
1312
|
-
var DEMO_DOCUMENT_PATH = /^\/(?:projects(?:\/[^/.]+(?:\/(?:portfolio|discovery|search-console|activity|technical-aeo|conversions|local|queries|backlinks|report|history|settings|properties)(?:\/[^/.]+)*)?)?|runs|history|traffic(?:\/[^/.]+(?:\/[^/.]+)?)?)\/?$/;
|
|
1333
|
+
var DEMO_DOCUMENT_PATH = /^\/(?:projects(?:\/[^/.]+(?:\/(?:portfolio|discovery|search-console|seo-data|activity|technical-aeo|conversions|local|queries|backlinks|report|history|settings|properties)(?:\/[^/.]+)*)?)?|runs|history|traffic(?:\/[^/.]+(?:\/[^/.]+)?)?)\/?$/;
|
|
1313
1334
|
var DEMO_TITLE = "Canonry live demo";
|
|
1314
1335
|
var DEMO_DESCRIPTION = "The open-source AEO operating platform. Sample data, no sign-in.";
|
|
1315
1336
|
var DEMO_PREVIEW_IMAGE = "demo-og.png";
|
|
@@ -3176,8 +3197,132 @@ function seedLocalAndCommercialSignals(db, input) {
|
|
|
3176
3197
|
db.insert(conversionTrackingContracts).values({ id: `${prefix}-conversion`, projectId: project.id, name: "Sample lead", eventName: "generate_lead", googleAds: { customerId: "demo-customer", conversionActionId: "demo-action", conversionId: "AW-123456", conversionLabel: "demo-label", campaignIds: [campaignId], requireBiddableGoal: true, requirePrimaryAction: true }, gtm: { accountId: "demo-account", containerId: "demo-container", tagId: "demo-tag", triggerIds: ["demo-trigger"], variableIds: ["demo-value", "demo-currency"] }, runtime: { verificationRequired: true, requireTransactionId: true, requireValue: true, requireCurrency: true, productionHosts: [project.domain] }, createdAt: nowIso, updatedAt: nowIso }).run();
|
|
3177
3198
|
}
|
|
3178
3199
|
|
|
3200
|
+
// src/demo/seed-seo.ts
|
|
3201
|
+
import { eq as eq5 } from "drizzle-orm";
|
|
3202
|
+
function seedDemoSeo(db, context) {
|
|
3203
|
+
db.transaction((tx) => {
|
|
3204
|
+
for (const project of [context.simple, context.portfolio]) {
|
|
3205
|
+
const version = tx.select({ version: measurementPlanVersions }).from(measurementPlans).innerJoin(measurementPlanVersions, eq5(measurementPlans.activeVersionId, measurementPlanVersions.id)).where(eq5(measurementPlans.projectId, project.id)).get()?.version;
|
|
3206
|
+
const plan = version ? measurementPlanV2Schema.parse(JSON.parse(version.canonicalJson)) : null;
|
|
3207
|
+
const properties = harborProperties();
|
|
3208
|
+
const keywords = plan ? properties.map((property) => `luxury resorts in ${property.market.label.toLowerCase()} with ${["oceanfront pools", "family suites", "spa packages", "waterfront dining"][property.number - 1]}`) : ["roof repair near me", "roof replacement cost", "metal roofing contractors", "emergency roof repair", "shingle roof installation", "storm damage roof repair", "roof inspection", "flat roof repair"];
|
|
3209
|
+
const base = {
|
|
3210
|
+
name: "Whole site",
|
|
3211
|
+
connectionId: "demo-seo",
|
|
3212
|
+
capabilities: [SeoCapabilities["keyword-metrics"], SeoCapabilities["domain-intelligence"], SeoCapabilities["ranked-keywords"]],
|
|
3213
|
+
targets: [{ kind: SeoTargetKinds.domain, value: project.domain, includeSubdomains: true }],
|
|
3214
|
+
keywords,
|
|
3215
|
+
locationCode: 2840,
|
|
3216
|
+
languageCode: "en",
|
|
3217
|
+
limit: 100,
|
|
3218
|
+
scope: { kind: SeoScopeKinds.project, ...version ? { expectedPlanRevision: version.revision } : {} }
|
|
3219
|
+
};
|
|
3220
|
+
const profiles = [{ id: "all-site", input: base }];
|
|
3221
|
+
if (plan && version) {
|
|
3222
|
+
for (const scope of [
|
|
3223
|
+
...plan.groups.map((group) => ({ kind: SeoScopeKinds.group, key: group.stableKey, label: group.label, targetKeys: group.targetKeys })),
|
|
3224
|
+
...(plan.reportingScopes ?? []).map((market) => ({ kind: SeoScopeKinds.market, key: market.stableKey, label: market.label, targetKeys: market.usageEdges.map((edge) => edge.targetKey) })),
|
|
3225
|
+
...plan.targets.map((target) => ({ kind: SeoScopeKinds.property, key: target.stableKey, label: target.label, targetKeys: [target.stableKey] }))
|
|
3226
|
+
]) {
|
|
3227
|
+
profiles.push({ id: `${scope.kind}-${scope.key}`, input: {
|
|
3228
|
+
...base,
|
|
3229
|
+
name: `${scope.label} \xB7 ${scope.kind}`,
|
|
3230
|
+
targets: [],
|
|
3231
|
+
capabilities: [SeoCapabilities["keyword-metrics"]],
|
|
3232
|
+
keywords: properties.flatMap((property, index) => scope.targetKeys.includes(property.key) ? [keywords[index]] : []),
|
|
3233
|
+
scope: { kind: scope.kind, key: scope.key, expectedPlanRevision: version.revision }
|
|
3234
|
+
} });
|
|
3235
|
+
}
|
|
3236
|
+
}
|
|
3237
|
+
for (const { id: profileId, input } of profiles) {
|
|
3238
|
+
const createdAt = new Date(context.now.getTime() - 8 * 864e5).toISOString();
|
|
3239
|
+
tx.insert(seoProfiles).values({ projectId: project.id, id: profileId, revision: 1, input, createdAt, updatedAt: createdAt }).run();
|
|
3240
|
+
for (const daysAgo of [8, 1]) {
|
|
3241
|
+
const capturedAt = new Date(context.now.getTime() - daysAgo * 864e5).toISOString();
|
|
3242
|
+
const runId = `demo-seo-${project.id}-${profileId}-${daysAgo}`;
|
|
3243
|
+
tx.insert(runs).values({ id: runId, projectId: project.id, kind: RunKinds["seo-sync"], status: RunStatuses.completed, trigger: RunTriggers.manual, createdAt: capturedAt, startedAt: capturedAt, finishedAt: capturedAt }).run();
|
|
3244
|
+
tx.insert(seoJobs).values({
|
|
3245
|
+
id: runId,
|
|
3246
|
+
runId,
|
|
3247
|
+
projectId: project.id,
|
|
3248
|
+
projectKey: project.id,
|
|
3249
|
+
profileId,
|
|
3250
|
+
profileRevision: 1,
|
|
3251
|
+
profile: input,
|
|
3252
|
+
scopeSnapshot: { mode: plan ? "advanced" : "simple", scope: input.scope, ...version ? { planRevision: version.revision, planVersionId: version.id } : {} },
|
|
3253
|
+
requestHash: runId,
|
|
3254
|
+
idempotencyKey: runId,
|
|
3255
|
+
principalId: "public-demo-viewer",
|
|
3256
|
+
connectionId: input.connectionId,
|
|
3257
|
+
accountKey: "demo-no-provider-account",
|
|
3258
|
+
buckets: [],
|
|
3259
|
+
status: SeoRunStatuses.completed,
|
|
3260
|
+
createdAt: capturedAt,
|
|
3261
|
+
startedAt: capturedAt,
|
|
3262
|
+
finishedAt: capturedAt
|
|
3263
|
+
}).run();
|
|
3264
|
+
for (const capability of input.capabilities) {
|
|
3265
|
+
const provenance = { provider: SeoProviders.dataforseo, dataset: `demo-${capability}`, engine: "google", locationCode: input.locationCode, languageCode: input.languageCode, device: "unspecified", collectedAt: capturedAt, sourceUpdatedAt: capturedAt };
|
|
3266
|
+
const results = emptySeoResults();
|
|
3267
|
+
const target = input.targets[0] ?? null;
|
|
3268
|
+
if (capability === SeoCapabilities["keyword-metrics"]) {
|
|
3269
|
+
results.keywordMetrics = input.keywords.map((keyword) => {
|
|
3270
|
+
const index = keywords.indexOf(keyword);
|
|
3271
|
+
return {
|
|
3272
|
+
keyword,
|
|
3273
|
+
searchVolume: 2400 + index * 320,
|
|
3274
|
+
cpcUsd: 2.4 + index * 0.65,
|
|
3275
|
+
adCompetition: 0.52,
|
|
3276
|
+
keywordDifficulty: 28 + index * 3,
|
|
3277
|
+
searchIntent: "commercial",
|
|
3278
|
+
coreKeyword: null,
|
|
3279
|
+
provenance,
|
|
3280
|
+
monthlySearches: Array.from({ length: 6 }, (_, month) => {
|
|
3281
|
+
const date = new Date(Date.UTC(context.now.getUTCFullYear(), context.now.getUTCMonth() - 6 + month, 1));
|
|
3282
|
+
return { year: date.getUTCFullYear(), month: date.getUTCMonth() + 1, searchVolume: 2e3 + index * 320 + month * 80 };
|
|
3283
|
+
})
|
|
3284
|
+
};
|
|
3285
|
+
});
|
|
3286
|
+
} else if (capability === SeoCapabilities["domain-intelligence"] && target) {
|
|
3287
|
+
results.domainIntelligence = [{ target, organicKeywords: plan ? 3240 : 486, estimatedOrganicTraffic: plan ? 18400 : 2750, estimatedOrganicTrafficValueUsd: plan ? 46200 : 9100, top1: plan ? 126 : 18, top2To3: plan ? 284 : 42, top4To10: plan ? 812 : 116, top11To20: plan ? 640 : 94, provenance }];
|
|
3288
|
+
} else if (capability === SeoCapabilities["ranked-keywords"] && target) {
|
|
3289
|
+
results.rankedKeywords = input.keywords.map((keyword, index) => ({
|
|
3290
|
+
target,
|
|
3291
|
+
keyword,
|
|
3292
|
+
url: `https://${project.domain}${plan ? properties[index].path : ["/services/roof-repair/", "/services/roof-replacement/", "/services/metal-roofing/", "/services/emergency-roof-repair/", "/services/shingle-roofing/", "/services/storm-damage/", "/services/roof-inspection/", "/services/flat-roofing/"][index]}`,
|
|
3293
|
+
rankOrganic: index + (daysAgo === 1 ? 2 : 4),
|
|
3294
|
+
rankAbsolute: index + (daysAgo === 1 ? 4 : 6),
|
|
3295
|
+
searchVolume: 2400 + index * 320,
|
|
3296
|
+
estimatedTraffic: 420 - index * 25,
|
|
3297
|
+
cpcUsd: 2.4 + index * 0.65,
|
|
3298
|
+
keywordDifficulty: 28 + index * 3,
|
|
3299
|
+
serpFeatures: index % 2 === 0 ? ["local_pack", "people_also_ask"] : ["people_also_ask"],
|
|
3300
|
+
provenance
|
|
3301
|
+
}));
|
|
3302
|
+
}
|
|
3303
|
+
tx.insert(seoTasks).values({
|
|
3304
|
+
id: `${runId}-${capability}`,
|
|
3305
|
+
jobId: runId,
|
|
3306
|
+
request: { capability, target: capability === SeoCapabilities["keyword-metrics"] ? null : target, keywords: capability === SeoCapabilities["keyword-metrics"] ? input.keywords : [], locationCode: input.locationCode, languageCode: input.languageCode, limit: input.limit, tag: runId },
|
|
3307
|
+
status: SeoRunStatuses.completed,
|
|
3308
|
+
catalogRevision: "demo",
|
|
3309
|
+
collectionOutcome: SeoAdapterOutcomes.completed,
|
|
3310
|
+
reservedMicros: 0,
|
|
3311
|
+
actualMicros: 0,
|
|
3312
|
+
receipts: [],
|
|
3313
|
+
results,
|
|
3314
|
+
startedAt: capturedAt,
|
|
3315
|
+
finishedAt: capturedAt
|
|
3316
|
+
}).run();
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
});
|
|
3322
|
+
}
|
|
3323
|
+
|
|
3179
3324
|
// src/demo/stores.ts
|
|
3180
|
-
import { and as and4, eq as
|
|
3325
|
+
import { and as and4, eq as eq6 } from "drizzle-orm";
|
|
3181
3326
|
function refuseMutation() {
|
|
3182
3327
|
throw new Error("The public demo stores are view only.");
|
|
3183
3328
|
}
|
|
@@ -3196,9 +3341,9 @@ function demoReadOptions(db, context) {
|
|
|
3196
3341
|
// allowed, and no Google client id, secret, token, or transport is wired.
|
|
3197
3342
|
googleStateSecret: "public-demo-no-oauth-callbacks",
|
|
3198
3343
|
googleConnectionStore: {
|
|
3199
|
-
listConnections: (domain) => db.select().from(googleConnections).where(
|
|
3344
|
+
listConnections: (domain) => db.select().from(googleConnections).where(eq6(googleConnections.domain, domain)).all().map(mapGoogle),
|
|
3200
3345
|
getConnection: (domain, type) => {
|
|
3201
|
-
const row = db.select().from(googleConnections).where(and4(
|
|
3346
|
+
const row = db.select().from(googleConnections).where(and4(eq6(googleConnections.domain, domain), eq6(googleConnections.connectionType, type))).get();
|
|
3202
3347
|
return row ? mapGoogle(row) : void 0;
|
|
3203
3348
|
},
|
|
3204
3349
|
upsertConnection: refuseMutation,
|
|
@@ -3207,7 +3352,7 @@ function demoReadOptions(db, context) {
|
|
|
3207
3352
|
},
|
|
3208
3353
|
bingConnectionStore: {
|
|
3209
3354
|
getConnection: (domain) => {
|
|
3210
|
-
const row = db.select().from(bingConnections).where(
|
|
3355
|
+
const row = db.select().from(bingConnections).where(eq6(bingConnections.domain, domain)).get();
|
|
3211
3356
|
return row ? { domain, siteUrl: row.siteUrl, apiKey: "", createdAt: row.createdAt, updatedAt: row.updatedAt } : void 0;
|
|
3212
3357
|
},
|
|
3213
3358
|
upsertConnection: refuseMutation,
|
|
@@ -3265,6 +3410,7 @@ async function createDemoServer(options = {}) {
|
|
|
3265
3410
|
await seedDemoSignals(db, context);
|
|
3266
3411
|
seedDemoExploration(db, context);
|
|
3267
3412
|
seedDemoMarketing(db, context);
|
|
3413
|
+
seedDemoSeo(db, context);
|
|
3268
3414
|
const aeroPreviews = buildDemoAeroPreviews(db, context);
|
|
3269
3415
|
const app = await createDemoHttpServer({
|
|
3270
3416
|
db,
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonry/canonry",
|
|
3
|
-
"version": "7.58.
|
|
3
|
+
"version": "7.58.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
|
|
6
6
|
"keywords": [
|